Skip to content

Commit

Permalink
Default to output controller
Browse files Browse the repository at this point in the history
  • Loading branch information
laoneo committed Oct 18, 2018
1 parent 68785e9 commit ef36898
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 9 deletions.
9 changes: 5 additions & 4 deletions libraries/src/Cache/CacheController.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
*
* @since 1.7.0
*/
class CacheController implements CacheControllerInterface
abstract class CacheController implements CacheControllerInterface
{
/**
* Cache object
Expand Down Expand Up @@ -81,8 +81,8 @@ public function __call($name, $arguments)
*
* @return CacheControllerInterface
*
* @since 1.7.0
* @throws \RuntimeException
* @since 1.7.0
* @throws \RuntimeException
* @deprecated 5.0 Use the cache controller factory instead
*/
public static function getInstance($type = 'output', $options = array())
Expand Down Expand Up @@ -133,7 +133,8 @@ public static function getInstance($type = 'output', $options = array())
*
* @return array An array with directory elements
*
* @since 1.7.0
* @since 1.7.0
* @deprecated 5.0 Use the cache controller factory instead
*/
public static function addIncludePath($path = '')
{
Expand Down
10 changes: 5 additions & 5 deletions libraries/src/Cache/CacheControllerFactory.php
Original file line number Diff line number Diff line change
Expand Up @@ -30,15 +30,15 @@ class CacheControllerFactory implements CacheControllerFactoryInterface
*/
public function createCacheController($type = 'output', $options = array()): CacheControllerInterface
{
if (!$type)
{
$type = 'output';
}

$type = strtolower(preg_replace('/[^A-Z0-9_\.-]/i', '', $type));

$class = __NAMESPACE__ . '\\Controller\\' . ucfirst($type) . 'Controller';

if ($type == '' && !class_exists($class))
{
$class = CacheController::class;
}

// The class should now be loaded
if (!class_exists($class))
{
Expand Down

0 comments on commit ef36898

Please sign in to comment.