@@ -92,7 +92,7 @@ |
||
| 92 | 92 | * |
| 93 | 93 | * After the stream has been detached, the stream is in an unusable state. |
| 94 | 94 | * |
| 95 | - * @return resource|null |
|
| 95 | + * @return resource |
|
| 96 | 96 | */ |
| 97 | 97 | public function detach() |
| 98 | 98 | { |
@@ -67,7 +67,7 @@ discard block |
||
| 67 | 67 | */ |
| 68 | 68 | public function __toString() |
| 69 | 69 | { |
| 70 | - if (! $this->isReadable()) { |
|
| 70 | + if (!$this->isReadable()) { |
|
| 71 | 71 | return ''; |
| 72 | 72 | } |
| 73 | 73 | |
@@ -79,7 +79,7 @@ discard block |
||
| 79 | 79 | */ |
| 80 | 80 | public function close() |
| 81 | 81 | { |
| 82 | - if (! $this->resource) { |
|
| 82 | + if (!$this->resource) { |
|
| 83 | 83 | return; |
| 84 | 84 | } |
| 85 | 85 | |
@@ -116,8 +116,8 @@ discard block |
||
| 116 | 116 | public function attach($resource, $mode = 'r') |
| 117 | 117 | { |
| 118 | 118 | $error = null; |
| 119 | - if (! is_resource($resource) && is_string($resource)) { |
|
| 120 | - set_error_handler(function ($e) use (&$error) { |
|
| 119 | + if (!is_resource($resource) && is_string($resource)) { |
|
| 120 | + set_error_handler(function($e) use (&$error) { |
|
| 121 | 121 | $error = $e; |
| 122 | 122 | }, E_WARNING); |
| 123 | 123 | $resource = fopen($resource, $mode); |
@@ -128,7 +128,7 @@ discard block |
||
| 128 | 128 | throw new InvalidArgumentException('Invalid stream reference provided'); |
| 129 | 129 | } |
| 130 | 130 | |
| 131 | - if (! is_resource($resource)) { |
|
| 131 | + if (!is_resource($resource)) { |
|
| 132 | 132 | throw new InvalidArgumentException( |
| 133 | 133 | 'Invalid stream provided; must be a string stream identifier or resource' |
| 134 | 134 | ); |
@@ -160,7 +160,7 @@ discard block |
||
| 160 | 160 | */ |
| 161 | 161 | public function tell() |
| 162 | 162 | { |
| 163 | - if (! $this->resource) { |
|
| 163 | + if (!$this->resource) { |
|
| 164 | 164 | return false; |
| 165 | 165 | } |
| 166 | 166 | |
@@ -174,7 +174,7 @@ discard block |
||
| 174 | 174 | */ |
| 175 | 175 | public function eof() |
| 176 | 176 | { |
| 177 | - if (! $this->resource) { |
|
| 177 | + if (!$this->resource) { |
|
| 178 | 178 | return true; |
| 179 | 179 | } |
| 180 | 180 | |
@@ -188,7 +188,7 @@ discard block |
||
| 188 | 188 | */ |
| 189 | 189 | public function isSeekable() |
| 190 | 190 | { |
| 191 | - if (! $this->resource) { |
|
| 191 | + if (!$this->resource) { |
|
| 192 | 192 | return false; |
| 193 | 193 | } |
| 194 | 194 | |
@@ -214,7 +214,7 @@ discard block |
||
| 214 | 214 | */ |
| 215 | 215 | public function seek($offset, $whence = SEEK_SET) |
| 216 | 216 | { |
| 217 | - if (! $this->resource || ! $this->isSeekable()) { |
|
| 217 | + if (!$this->resource || !$this->isSeekable()) { |
|
| 218 | 218 | return false; |
| 219 | 219 | } |
| 220 | 220 | |
@@ -230,7 +230,7 @@ discard block |
||
| 230 | 230 | */ |
| 231 | 231 | public function rewind() |
| 232 | 232 | { |
| 233 | - if (! $this->isSeekable()) { |
|
| 233 | + if (!$this->isSeekable()) { |
|
| 234 | 234 | return false; |
| 235 | 235 | } |
| 236 | 236 | |
@@ -246,7 +246,7 @@ discard block |
||
| 246 | 246 | */ |
| 247 | 247 | public function isWritable() |
| 248 | 248 | { |
| 249 | - if (! $this->resource) { |
|
| 249 | + if (!$this->resource) { |
|
| 250 | 250 | return false; |
| 251 | 251 | } |
| 252 | 252 | |
@@ -265,7 +265,7 @@ discard block |
||
| 265 | 265 | */ |
| 266 | 266 | public function write($string) |
| 267 | 267 | { |
| 268 | - if (! $this->resource) { |
|
| 268 | + if (!$this->resource) { |
|
| 269 | 269 | return false; |
| 270 | 270 | } |
| 271 | 271 | |
@@ -279,7 +279,7 @@ discard block |
||
| 279 | 279 | */ |
| 280 | 280 | public function isReadable() |
| 281 | 281 | { |
| 282 | - if (! $this->resource) { |
|
| 282 | + if (!$this->resource) { |
|
| 283 | 283 | return false; |
| 284 | 284 | } |
| 285 | 285 | |
@@ -302,7 +302,7 @@ discard block |
||
| 302 | 302 | */ |
| 303 | 303 | public function read($length) |
| 304 | 304 | { |
| 305 | - if (! $this->resource || ! $this->isReadable()) { |
|
| 305 | + if (!$this->resource || !$this->isReadable()) { |
|
| 306 | 306 | return false; |
| 307 | 307 | } |
| 308 | 308 | |
@@ -320,7 +320,7 @@ discard block |
||
| 320 | 320 | */ |
| 321 | 321 | public function getContents() |
| 322 | 322 | { |
| 323 | - if (! $this->isReadable()) { |
|
| 323 | + if (!$this->isReadable()) { |
|
| 324 | 324 | return ''; |
| 325 | 325 | } |
| 326 | 326 | |
@@ -341,7 +341,7 @@ discard block |
||
| 341 | 341 | } |
| 342 | 342 | |
| 343 | 343 | $metadata = stream_get_meta_data($this->resource); |
| 344 | - if (! array_key_exists($key, $metadata)) { |
|
| 344 | + if (!array_key_exists($key, $metadata)) { |
|
| 345 | 345 | return; |
| 346 | 346 | } |
| 347 | 347 | |
@@ -40,6 +40,9 @@ |
||
| 40 | 40 | $this->add($uri, 'post', $callback); |
| 41 | 41 | } |
| 42 | 42 | |
| 43 | + /** |
|
| 44 | + * @param string $method |
|
| 45 | + */ |
|
| 43 | 46 | public function add($uri, $method, $callback) |
| 44 | 47 | { |
| 45 | 48 | $this->routes[md5($uri . $method)] = array( |
@@ -14,7 +14,6 @@ |
||
| 14 | 14 | use Symfony\Component\Routing\Matcher\UrlMatcher as UrlMatcher; |
| 15 | 15 | use Symfony\Component\Routing\Route as Route; |
| 16 | 16 | use Symfony\Component\Routing\RouteCollection; |
| 17 | -use Symfony\Component\Routing\Router; |
|
| 18 | 17 | |
| 19 | 18 | /** |
| 20 | 19 | * The PPI MicroApp bootstrap class. |
@@ -41,7 +41,7 @@ |
||
| 41 | 41 | |
| 42 | 42 | public function add($uri, $method, $callback) |
| 43 | 43 | { |
| 44 | - $this->routes[md5($uri . $method)] = array( |
|
| 44 | + $this->routes[md5($uri.$method)] = array( |
|
| 45 | 45 | 'method' => $method, |
| 46 | 46 | 'uri' => $uri, |
| 47 | 47 | 'callback' => $callback, |
@@ -458,7 +458,7 @@ |
||
| 458 | 458 | * Get an option from the controller. |
| 459 | 459 | * |
| 460 | 460 | * @param string $option The option name |
| 461 | - * @param null $default The default value if the option does not exist |
|
| 461 | + * @param string $default The default value if the option does not exist |
|
| 462 | 462 | * |
| 463 | 463 | * @return mixed |
| 464 | 464 | */ |
@@ -254,34 +254,34 @@ |
||
| 254 | 254 | { |
| 255 | 255 | switch ($key = strtolower($key)) { |
| 256 | 256 | |
| 257 | - case 'ajax': |
|
| 258 | - if (!isset($this->isCache['ajax'])) { |
|
| 259 | - return $this->isCache['ajax'] = $this->getService('Request')->isXmlHttpRequest(); |
|
| 260 | - } |
|
| 261 | - |
|
| 262 | - return $this->isCache['ajax']; |
|
| 263 | - |
|
| 264 | - case 'put': |
|
| 265 | - case 'delete': |
|
| 266 | - case 'post': |
|
| 267 | - case 'patch': |
|
| 268 | - if (!isset($this->isCache['requestMethod'][$key])) { |
|
| 269 | - $this->isCache['requestMethod'][$key] = $this->getService('Request')->getMethod() === strtoupper($key); |
|
| 270 | - } |
|
| 271 | - |
|
| 272 | - return $this->isCache['requestMethod'][$key]; |
|
| 273 | - |
|
| 274 | - case 'ssl': |
|
| 275 | - case 'https': |
|
| 276 | - case 'secure': |
|
| 277 | - if (!isset($this->isCache['secure'])) { |
|
| 278 | - $this->isCache['secure'] = $this->getService('Request')->isSecure(); |
|
| 279 | - } |
|
| 280 | - |
|
| 281 | - return $this->isCache['secure']; |
|
| 282 | - |
|
| 283 | - default: |
|
| 284 | - throw new \InvalidArgumentException("Invalid 'is' key supplied: {$key}"); |
|
| 257 | + case 'ajax': |
|
| 258 | + if (!isset($this->isCache['ajax'])) { |
|
| 259 | + return $this->isCache['ajax'] = $this->getService('Request')->isXmlHttpRequest(); |
|
| 260 | + } |
|
| 261 | + |
|
| 262 | + return $this->isCache['ajax']; |
|
| 263 | + |
|
| 264 | + case 'put': |
|
| 265 | + case 'delete': |
|
| 266 | + case 'post': |
|
| 267 | + case 'patch': |
|
| 268 | + if (!isset($this->isCache['requestMethod'][$key])) { |
|
| 269 | + $this->isCache['requestMethod'][$key] = $this->getService('Request')->getMethod() === strtoupper($key); |
|
| 270 | + } |
|
| 271 | + |
|
| 272 | + return $this->isCache['requestMethod'][$key]; |
|
| 273 | + |
|
| 274 | + case 'ssl': |
|
| 275 | + case 'https': |
|
| 276 | + case 'secure': |
|
| 277 | + if (!isset($this->isCache['secure'])) { |
|
| 278 | + $this->isCache['secure'] = $this->getService('Request')->isSecure(); |
|
| 279 | + } |
|
| 280 | + |
|
| 281 | + return $this->isCache['secure']; |
|
| 282 | + |
|
| 283 | + default: |
|
| 284 | + throw new \InvalidArgumentException("Invalid 'is' key supplied: {$key}"); |
|
| 285 | 285 | |
| 286 | 286 | } |
| 287 | 287 | } |
@@ -81,7 +81,7 @@ |
||
| 81 | 81 | protected function helper($helperName) |
| 82 | 82 | { |
| 83 | 83 | if (!isset($this->helpers[$helperName])) { |
| 84 | - throw new \InvalidArgumentException('Unable to locate controller helper: ' . $helperName); |
|
| 84 | + throw new \InvalidArgumentException('Unable to locate controller helper: '.$helperName); |
|
| 85 | 85 | } |
| 86 | 86 | |
| 87 | 87 | return $this->helpers[$helperName]; |
@@ -31,7 +31,7 @@ |
||
| 31 | 31 | /** |
| 32 | 32 | * Given a request object, find the matching route |
| 33 | 33 | * |
| 34 | - * @param Request $request |
|
| 34 | + * @param SymfonyRequest $request |
|
| 35 | 35 | * @return \Illuminate\Routing\Route |
| 36 | 36 | */ |
| 37 | 37 | public function matchRequest(SymfonyRequest $request) |
@@ -22,7 +22,6 @@ |
||
| 22 | 22 | use PPI\Framework\View\TemplateLocator; |
| 23 | 23 | use PPI\Framework\View\TemplateNameParser; |
| 24 | 24 | // Mustache |
| 25 | -use Symfony\Bundle\FrameworkBundle\Templating\Loader\FilesystemLoader; |
|
| 26 | 25 | use Symfony\Component\Templating\Helper\AssetsHelper; |
| 27 | 26 | // Twig |
| 28 | 27 | |
@@ -113,7 +113,7 @@ |
||
| 113 | 113 | $serviceManager->get('templating.helper.assets'), |
| 114 | 114 | new RouterHelper($serviceManager->get('router')), |
| 115 | 115 | new SessionHelper($serviceManager->get('session')) |
| 116 | - ) |
|
| 116 | + ) |
|
| 117 | 117 | ); |
| 118 | 118 | }); |
| 119 | 119 | |
@@ -76,7 +76,7 @@ discard block |
||
| 76 | 76 | /* |
| 77 | 77 | * Templating Locator. |
| 78 | 78 | */ |
| 79 | - $serviceManager->setFactory('templating.locator', function ($serviceManager) use ($appCacheDir) { |
|
| 79 | + $serviceManager->setFactory('templating.locator', function($serviceManager) use ($appCacheDir) { |
|
| 80 | 80 | return new TemplateLocator( |
| 81 | 81 | $serviceManager->get('file_locator'), |
| 82 | 82 | $appCacheDir |
@@ -86,28 +86,28 @@ discard block |
||
| 86 | 86 | /* |
| 87 | 87 | * Templating Name Parser. |
| 88 | 88 | */ |
| 89 | - $serviceManager->setFactory('templating.name_parser', function ($serviceManager) { |
|
| 89 | + $serviceManager->setFactory('templating.name_parser', function($serviceManager) { |
|
| 90 | 90 | return new TemplateNameParser($serviceManager->get('modulemanager')); |
| 91 | 91 | }); |
| 92 | 92 | |
| 93 | 93 | /* |
| 94 | 94 | * Filesystem Loader. |
| 95 | 95 | */ |
| 96 | - $serviceManager->setFactory('templating.loader.filesystem', function ($serviceManager) { |
|
| 96 | + $serviceManager->setFactory('templating.loader.filesystem', function($serviceManager) { |
|
| 97 | 97 | return new FileSystemLoader($serviceManager->get('templating.locator')); |
| 98 | 98 | }); |
| 99 | 99 | |
| 100 | 100 | /* |
| 101 | 101 | * Templating assets helper. |
| 102 | 102 | */ |
| 103 | - $serviceManager->setFactory('templating.helper.assets', function ($serviceManager) { |
|
| 103 | + $serviceManager->setFactory('templating.helper.assets', function($serviceManager) { |
|
| 104 | 104 | return new AssetsHelper($serviceManager->get('request')->getBasePath()); |
| 105 | 105 | }); |
| 106 | 106 | |
| 107 | 107 | /* |
| 108 | 108 | * Templating globals. |
| 109 | 109 | */ |
| 110 | - $serviceManager->setFactory('templating.globals', function ($serviceManager) { |
|
| 110 | + $serviceManager->setFactory('templating.globals', function($serviceManager) { |
|
| 111 | 111 | return new GlobalVariables($serviceManager->get('servicemanager')); |
| 112 | 112 | }); |
| 113 | 113 | |
@@ -116,7 +116,7 @@ discard block |
||
| 116 | 116 | * |
| 117 | 117 | * TODO: Migrate to Symfony\Bundle\FrameworkBundle\Templating\PhpEngine |
| 118 | 118 | */ |
| 119 | - $serviceManager->setFactory('templating.engine.php', function ($serviceManager) use ($appCharset) { |
|
| 119 | + $serviceManager->setFactory('templating.engine.php', function($serviceManager) use ($appCharset) { |
|
| 120 | 120 | $engine = new PhpEngine( |
| 121 | 121 | $serviceManager->get('templating.name_parser'), |
| 122 | 122 | $serviceManager->get('templating.loader'), |
@@ -137,7 +137,7 @@ discard block |
||
| 137 | 137 | /* |
| 138 | 138 | * Twig Engine |
| 139 | 139 | */ |
| 140 | - $serviceManager->setFactory('templating.engine.twig', function ($serviceManager) { |
|
| 140 | + $serviceManager->setFactory('templating.engine.twig', function($serviceManager) { |
|
| 141 | 141 | |
| 142 | 142 | if (!class_exists('Twig_Environment')) { |
| 143 | 143 | throw new \Exception('PPI\Framework\TwigModule not found. Composer require: ppi/twig-module'); |
@@ -160,13 +160,13 @@ discard block |
||
| 160 | 160 | /* |
| 161 | 161 | * Smarty Engine. |
| 162 | 162 | */ |
| 163 | - $serviceManager->setFactory('templating.engine.smarty', function ($serviceManager) use ($appCacheDir) { |
|
| 163 | + $serviceManager->setFactory('templating.engine.smarty', function($serviceManager) use ($appCacheDir) { |
|
| 164 | 164 | |
| 165 | 165 | if (!class_exists('NoiseLabs\Bundle\SmartyBundle\SmartyEngine')) { |
| 166 | 166 | throw new \Exception('PPI\Framework\SmartyModule not found. Composer require: ppi/smarty-module'); |
| 167 | 167 | } |
| 168 | 168 | |
| 169 | - $cacheDir = $appCacheDir . DIRECTORY_SEPARATOR . 'smarty'; |
|
| 169 | + $cacheDir = $appCacheDir.DIRECTORY_SEPARATOR.'smarty'; |
|
| 170 | 170 | |
| 171 | 171 | $smartyEngine = new \PPI\Framework\View\Smarty\SmartyEngine( |
| 172 | 172 | new \Smarty(), |
@@ -174,8 +174,8 @@ discard block |
||
| 174 | 174 | $serviceManager->get('templating.name_parser'), |
| 175 | 175 | $serviceManager->get('templating.loader'), |
| 176 | 176 | array( |
| 177 | - 'cache_dir' => $cacheDir . DIRECTORY_SEPARATOR . 'cache', |
|
| 178 | - 'compile_dir' => $cacheDir . DIRECTORY_SEPARATOR . 'templates_c', |
|
| 177 | + 'cache_dir' => $cacheDir.DIRECTORY_SEPARATOR.'cache', |
|
| 178 | + 'compile_dir' => $cacheDir.DIRECTORY_SEPARATOR.'templates_c', |
|
| 179 | 179 | ), |
| 180 | 180 | $serviceManager->get('templating.globals'), |
| 181 | 181 | $serviceManager->get('logger') |
@@ -189,7 +189,7 @@ discard block |
||
| 189 | 189 | }); |
| 190 | 190 | |
| 191 | 191 | // Mustache Engine |
| 192 | - $serviceManager->setFactory('templating.engine.mustache', function ($serviceManager, $appCacheDir) { |
|
| 192 | + $serviceManager->setFactory('templating.engine.mustache', function($serviceManager, $appCacheDir) { |
|
| 193 | 193 | |
| 194 | 194 | if (!class_exists('Mustache_Engine')) { |
| 195 | 195 | throw new \Exception('PPI\Framework\MustacheModule not found. Composer require: ppi/mustache-module'); |
@@ -198,7 +198,7 @@ discard block |
||
| 198 | 198 | $rawMustacheEngine = new \Mustache_Engine(array( |
| 199 | 199 | 'loader' => new MustacheFileSystemLoader($serviceManager->get('templating.locator'), |
| 200 | 200 | $serviceManager->get('templating.name_parser')), |
| 201 | - 'cache' => $appCacheDir . DIRECTORY_SEPARATOR . 'mustache', |
|
| 201 | + 'cache' => $appCacheDir.DIRECTORY_SEPARATOR.'mustache', |
|
| 202 | 202 | )); |
| 203 | 203 | |
| 204 | 204 | return new MustacheEngine($rawMustacheEngine, $serviceManager->get('templating.name_parser')); |
@@ -207,11 +207,11 @@ discard block |
||
| 207 | 207 | /* |
| 208 | 208 | * Delegating Engine. |
| 209 | 209 | */ |
| 210 | - $serviceManager->setFactory('templating.engine.delegating', function ($serviceManager) use ($engineIds) { |
|
| 210 | + $serviceManager->setFactory('templating.engine.delegating', function($serviceManager) use ($engineIds) { |
|
| 211 | 211 | $delegatingEngine = new DelegatingEngine(); |
| 212 | 212 | // @todo - lazy load this |
| 213 | 213 | foreach ($engineIds as $id) { |
| 214 | - $delegatingEngine->addEngine($serviceManager->get('templating.engine.' . $id)); |
|
| 214 | + $delegatingEngine->addEngine($serviceManager->get('templating.engine.'.$id)); |
|
| 215 | 215 | } |
| 216 | 216 | |
| 217 | 217 | return $delegatingEngine; |
@@ -25,7 +25,7 @@ |
||
| 25 | 25 | * |
| 26 | 26 | * @param ServiceLocatorInterface $serviceLocator |
| 27 | 27 | * |
| 28 | - * @return \PPI\Framework\Router\RouterListener |
|
| 28 | + * @return RequestContext |
|
| 29 | 29 | */ |
| 30 | 30 | public function createService(ServiceLocatorInterface $serviceLocator) |
| 31 | 31 | { |
@@ -61,7 +61,6 @@ |
||
| 61 | 61 | $defaults = $defaults['framework']['router']; |
| 62 | 62 | |
| 63 | 63 | return isset($config['framework']['router']) ? |
| 64 | - $this->mergeConfiguration($defaults, $config['framework']['router']) : |
|
| 65 | - $defaults; |
|
| 64 | + $this->mergeConfiguration($defaults, $config['framework']['router']) : $defaults; |
|
| 66 | 65 | } |
| 67 | 66 | } |
@@ -70,7 +70,7 @@ |
||
| 70 | 70 | /** |
| 71 | 71 | * Renders a template. |
| 72 | 72 | * |
| 73 | - * @param mixed $name A template name |
|
| 73 | + * @param string $name A template name |
|
| 74 | 74 | * @param array $parameters An array of parameters to pass to the template |
| 75 | 75 | * |
| 76 | 76 | * @throws \InvalidArgumentException if the template does not exist |
@@ -180,11 +180,11 @@ |
||
| 180 | 180 | public function getContent(FlattenException $exception, $showAll = true) |
| 181 | 181 | { |
| 182 | 182 | switch ($exception->getStatusCode()) { |
| 183 | - case 404: |
|
| 184 | - $title = "The page you are looking for could not be found"; |
|
| 185 | - break; |
|
| 186 | - default: |
|
| 187 | - $title = "Oh noes, something's broken"; |
|
| 183 | + case 404: |
|
| 184 | + $title = "The page you are looking for could not be found"; |
|
| 185 | + break; |
|
| 186 | + default: |
|
| 187 | + $title = "Oh noes, something's broken"; |
|
| 188 | 188 | } |
| 189 | 189 | |
| 190 | 190 | $content = ''; |
@@ -138,7 +138,7 @@ discard block |
||
| 138 | 138 | |
| 139 | 139 | header(sprintf('HTTP/1.0 %s', $exception->getStatusCode())); |
| 140 | 140 | foreach ($exception->getHeaders() as $name => $value) { |
| 141 | - header($name . ': ' . $value, false); |
|
| 141 | + header($name.': '.$value, false); |
|
| 142 | 142 | } |
| 143 | 143 | |
| 144 | 144 | echo $this->decorate($this->getContent($exception, $this->showAllExceptions), $this->getStylesheet($exception)); |
@@ -229,7 +229,7 @@ discard block |
||
| 229 | 229 | |
| 230 | 230 | foreach ($e['trace'] as $trace) { |
| 231 | 231 | $i++; |
| 232 | - $content .= ' <tr><td>' . $i . '</td><td>'; |
|
| 232 | + $content .= ' <tr><td>'.$i.'</td><td>'; |
|
| 233 | 233 | if ($trace['function']) { |
| 234 | 234 | $content .= sprintf('at %s%s%s(%s)', $this->abbrClass($trace['class']), $trace['type'], $trace['function'], $this->formatArgs($trace['args'])); |
| 235 | 235 | } |
@@ -367,12 +367,12 @@ discard block |
||
| 367 | 367 | $formattedValue = sprintf("<em>object</em>(%s)", $this->abbrClass($item[1])); |
| 368 | 368 | } elseif ('array' === $item[0]) { |
| 369 | 369 | $formattedValue = sprintf("<em>array</em>(%s)", is_array($item[1]) ? $this->formatArgs($item[1]) : $item[1]); |
| 370 | - } elseif ('string' === $item[0]) { |
|
| 370 | + } elseif ('string' === $item[0]) { |
|
| 371 | 371 | $formattedValue = sprintf("'%s'", htmlspecialchars($item[1], ENT_QUOTES | ENT_SUBSTITUTE, $this->charset)); |
| 372 | 372 | } elseif ('null' === $item[0]) { |
| 373 | 373 | $formattedValue = '<em>null</em>'; |
| 374 | 374 | } elseif ('boolean' === $item[0]) { |
| 375 | - $formattedValue = '<em>' . strtolower(var_export($item[1], true)) . '</em>'; |
|
| 375 | + $formattedValue = '<em>'.strtolower(var_export($item[1], true)).'</em>'; |
|
| 376 | 376 | } elseif ('resource' === $item[0]) { |
| 377 | 377 | $formattedValue = '<em>resource</em>'; |
| 378 | 378 | } else { |
@@ -82,6 +82,8 @@ discard block |
||
| 82 | 82 | * Registers the exception handler. |
| 83 | 83 | * |
| 84 | 84 | * @param bool $debug |
| 85 | + * @param string $charset |
|
| 86 | + * @param string $fileLinkFormat |
|
| 85 | 87 | * |
| 86 | 88 | * @return ExceptionHandler The registered exception handler |
| 87 | 89 | */ |
@@ -128,7 +130,7 @@ discard block |
||
| 128 | 130 | * This method uses plain PHP functions like header() and echo to output |
| 129 | 131 | * the response. |
| 130 | 132 | * |
| 131 | - * @param \Exception|FlattenException $exception An \Exception instance |
|
| 133 | + * @param \Exception $exception An \Exception instance |
|
| 132 | 134 | */ |
| 133 | 135 | public function sendPhpResponse($exception) |
| 134 | 136 | { |
@@ -147,7 +149,7 @@ discard block |
||
| 147 | 149 | /** |
| 148 | 150 | * Creates the error Response associated with the given Exception. |
| 149 | 151 | * |
| 150 | - * @param \Exception|FlattenException $exception An \Exception instance |
|
| 152 | + * @param \Exception $exception An \Exception instance |
|
| 151 | 153 | * |
| 152 | 154 | * @return Response A Response instance |
| 153 | 155 | */ |
@@ -299,6 +301,10 @@ discard block |
||
| 299 | 301 | EOT; |
| 300 | 302 | } |
| 301 | 303 | |
| 304 | + /** |
|
| 305 | + * @param string $content |
|
| 306 | + * @param string $css |
|
| 307 | + */ |
|
| 302 | 308 | private function decorate($content, $css) |
| 303 | 309 | { |
| 304 | 310 | $baseStylesheet = $this->getBaseStylesheet(); |
@@ -133,7 +133,7 @@ discard block |
||
| 133 | 133 | $serviceManager->setShared($name, $value); |
| 134 | 134 | } |
| 135 | 135 | |
| 136 | - $serviceManager->addInitializer(function ($instance) use ($serviceManager) { |
|
| 136 | + $serviceManager->addInitializer(function($instance) use ($serviceManager) { |
|
| 137 | 137 | if ($instance instanceof EventManagerAwareInterface) { |
| 138 | 138 | if ($instance->getEventManager() instanceof EventManagerInterface) { |
| 139 | 139 | $instance->getEventManager()->setSharedManager( |
@@ -145,13 +145,13 @@ discard block |
||
| 145 | 145 | } |
| 146 | 146 | }); |
| 147 | 147 | |
| 148 | - $serviceManager->addInitializer(function ($instance) use ($serviceManager) { |
|
| 148 | + $serviceManager->addInitializer(function($instance) use ($serviceManager) { |
|
| 149 | 149 | if ($instance instanceof ServiceManagerAwareInterface) { |
| 150 | 150 | $instance->setServiceManager($serviceManager); |
| 151 | 151 | } |
| 152 | 152 | }); |
| 153 | 153 | |
| 154 | - $serviceManager->addInitializer(function ($instance) use ($serviceManager) { |
|
| 154 | + $serviceManager->addInitializer(function($instance) use ($serviceManager) { |
|
| 155 | 155 | if ($instance instanceof ServiceLocatorAwareInterface) { |
| 156 | 156 | $instance->setServiceLocator($serviceManager); |
| 157 | 157 | } |