@@ -76,7 +76,7 @@ |
||
| 76 | 76 | public function offsetSet($offset, $value) |
| 77 | 77 | { |
| 78 | 78 | $this->load(); |
| 79 | - $this->pages[$offset] = $value; |
|
| 79 | + $this->pages[$offset] = $value; |
|
| 80 | 80 | } |
| 81 | 81 | |
| 82 | 82 | public function offsetUnset($offset) |
@@ -21,8 +21,8 @@ |
||
| 21 | 21 | */ |
| 22 | 22 | class Plugin extends AbstractPlugin |
| 23 | 23 | { |
| 24 | - const HANDLER_ERROR_LOG = 'error_log'; |
|
| 25 | - const HANDLER_DEVELOPMENT = 'development'; |
|
| 24 | + const HANDLER_ERROR_LOG = 'error_log'; |
|
| 25 | + const HANDLER_DEVELOPMENT = 'development'; |
|
| 26 | 26 | |
| 27 | 27 | protected $events = ['plugins_loaded' => 'onPluginsLoaded']; |
| 28 | 28 | |
@@ -94,7 +94,7 @@ |
||
| 94 | 94 | { |
| 95 | 95 | $folder = $folder ?: $this->settings['content_dir']; |
| 96 | 96 | return new PageCollection( |
| 97 | - function () use ($options, $folder) { |
|
| 97 | + function() use ($options, $folder) { |
|
| 98 | 98 | $options += $this->settings; |
| 99 | 99 | // ignore files with a leading '.' in its filename |
| 100 | 100 | $files = Utility::getFiles($folder, '\Phile\FilterIterator\ContentFileFilterIterator'); |
@@ -20,7 +20,7 @@ discard block |
||
| 20 | 20 | /** @var string slug */ |
| 21 | 21 | const SLUG_PREFIX = '-phile.phpFastCache.slug-'; |
| 22 | 22 | |
| 23 | - const SLUG = ['{', '}' , '(', ')', '/' , '\\' , '@', ':']; |
|
| 23 | + const SLUG = ['{', '}', '(', ')', '/', '\\', '@', ':']; |
|
| 24 | 24 | |
| 25 | 25 | /** |
| 26 | 26 | * @var \BasePhpFastCache the cache engine |
@@ -118,7 +118,7 @@ discard block |
||
| 118 | 118 | protected function slug($key) |
| 119 | 119 | { |
| 120 | 120 | $replacementTokens = array_map( |
| 121 | - function ($key) { |
|
| 121 | + function($key) { |
|
| 122 | 122 | return self::SLUG_PREFIX . $key; |
| 123 | 123 | }, |
| 124 | 124 | array_keys(self::SLUG) |
@@ -15,7 +15,6 @@ |
||
| 15 | 15 | use Phile\Core\Router; |
| 16 | 16 | use Phile\Model\Page; |
| 17 | 17 | use Phile\Repository\Page as Repository; |
| 18 | - |
|
| 19 | 18 | use Interop\Http\Server\MiddlewareInterface; |
| 20 | 19 | use Interop\Http\Server\RequestHandlerInterface; |
| 21 | 20 | use Psr\Http\Message\ResponseInterface; |
@@ -126,7 +126,7 @@ |
||
| 126 | 126 | ->withHeader('Content-Type', 'text/html; charset=' . $charset); |
| 127 | 127 | |
| 128 | 128 | if ($page->getPageId() == $this->config->get('not_found_page')) { |
| 129 | - $response = $response->withStatus(404) ; |
|
| 129 | + $response = $response->withStatus(404); |
|
| 130 | 130 | } |
| 131 | 131 | |
| 132 | 132 | return $response; |
@@ -25,7 +25,7 @@ |
||
| 25 | 25 | public static function loadConfiguration($file, Config $config) |
| 26 | 26 | { |
| 27 | 27 | // function isolates context of loaded files |
| 28 | - $load = function ($file) { |
|
| 28 | + $load = function($file) { |
|
| 29 | 29 | return include $file; |
| 30 | 30 | }; |
| 31 | 31 | $config->merge($load($file)); |
@@ -49,7 +49,7 @@ discard block |
||
| 49 | 49 | |
| 50 | 50 | //# setup bootstrap |
| 51 | 51 | $core = $container->get('Phile_App'); |
| 52 | - $core->addBootstrap(function ($eventBus, $config) { |
|
| 52 | + $core->addBootstrap(function($eventBus, $config) { |
|
| 53 | 53 | $configDir = $config->get('config_dir'); |
| 54 | 54 | Bootstrap::loadConfiguration($configDir . 'defaults.php', $config); |
| 55 | 55 | |
@@ -64,7 +64,7 @@ discard block |
||
| 64 | 64 | }); |
| 65 | 65 | |
| 66 | 66 | //# setup middleware |
| 67 | - $core->addMiddleware(function ($middleware, $eventBus, $config) use ($core) { |
|
| 67 | + $core->addMiddleware(function($middleware, $eventBus, $config) use ($core) { |
|
| 68 | 68 | $eventBus->trigger('phile.core.middleware.add', ['middleware' => $middleware]); |
| 69 | 69 | $middleware->add($core, 0); |
| 70 | 70 | }); |
@@ -30,7 +30,7 @@ discard block |
||
| 30 | 30 | * initialize autoloaders |
| 31 | 31 | */ |
| 32 | 32 | // load classes from Phile-core |
| 33 | -spl_autoload_register(function ($className) { |
|
| 33 | +spl_autoload_register(function($className) { |
|
| 34 | 34 | $fileName = LIB_DIR . str_replace("\\", DS, $className) . '.php'; |
| 35 | 35 | if (file_exists($fileName)) { |
| 36 | 36 | require_once $fileName; |
@@ -42,7 +42,7 @@ discard block |
||
| 42 | 42 | /** |
| 43 | 43 | * Setup global application-object |
| 44 | 44 | */ |
| 45 | -require 'container.php' ; |
|
| 45 | +require 'container.php'; |
|
| 46 | 46 | $app = Phile\Core\Container::getInstance()->get('Phile_App'); |
| 47 | 47 | |
| 48 | 48 | /** |
@@ -53,7 +53,7 @@ discard block |
||
| 53 | 53 | use Phile\Core\Event; |
| 54 | 54 | use Phile\Core\Registry; |
| 55 | 55 | |
| 56 | -$app->addBootstrap(function (Event $eventBus, Config $config) { |
|
| 56 | +$app->addBootstrap(function(Event $eventBus, Config $config) { |
|
| 57 | 57 | // Load configuration files into global $config configuration |
| 58 | 58 | $configDir = $config->get('config_dir'); |
| 59 | 59 | Bootstrap::loadConfiguration($configDir . 'defaults.php', $config); |
@@ -90,7 +90,7 @@ discard block |
||
| 90 | 90 | */ |
| 91 | 91 | use Phile\Core\RequestHandler; |
| 92 | 92 | |
| 93 | -$app->addMiddleware(function (RequestHandler $middleware, Event $eventBus, Config $config) use ($app) { |
|
| 93 | +$app->addMiddleware(function(RequestHandler $middleware, Event $eventBus, Config $config) use ($app) { |
|
| 94 | 94 | // Inject middleware from Phile-plugins |
| 95 | 95 | $eventBus->trigger('phile.core.middleware.add', ['middleware' => $middleware]); |
| 96 | 96 | |
@@ -10,8 +10,6 @@ |
||
| 10 | 10 | * @license http://opensource.org/licenses/MIT |
| 11 | 11 | */ |
| 12 | 12 | |
| 13 | -use Psr\Http\Message\ServerRequestInterface; |
|
| 14 | - |
|
| 15 | 13 | $config = [ |
| 16 | 14 | 'types' => [ |
| 17 | 15 | 'Phile_App' => Phile\Phile::class, |
@@ -31,14 +31,14 @@ |
||
| 31 | 31 | $container = new Phile\Core\Container($config); |
| 32 | 32 | Phile\Core\Container::setInstance($container); |
| 33 | 33 | |
| 34 | -$container->set('Phile_EventBus', function () { |
|
| 34 | +$container->set('Phile_EventBus', function() { |
|
| 35 | 35 | return new Phile\Core\Event; |
| 36 | 36 | }); |
| 37 | 37 | |
| 38 | -$container->set('Phile_Config', function () { |
|
| 38 | +$container->set('Phile_Config', function() { |
|
| 39 | 39 | return new Phile\Core\Config; |
| 40 | 40 | }); |
| 41 | 41 | |
| 42 | -$container->set('Phile_App', function ($container) { |
|
| 42 | +$container->set('Phile_App', function($container) { |
|
| 43 | 43 | return new Phile\Phile($container->get('Phile_EventBus'), $container->get('Phile_Config')); |
| 44 | 44 | }); |