@@ -143,7 +143,7 @@ |
||
| 143 | 143 | $seconds = (int) ($duration - $hours * 60 * 60 - $minutes * 60); |
| 144 | 144 | |
| 145 | 145 | if ($seconds <= 0) { |
| 146 | - return ' ms'; |
|
| 146 | + return ' ms'; |
|
| 147 | 147 | } elseif ($seconds > 0) { |
| 148 | 148 | return ' s'; |
| 149 | 149 | } |
@@ -30,61 +30,61 @@ |
||
| 30 | 30 | */ |
| 31 | 31 | class FileMimeType |
| 32 | 32 | { |
| 33 | - /** |
|
| 34 | - * Map of extensions to mime types. |
|
| 35 | - * |
|
| 36 | - * @var array $mimes |
|
| 37 | - */ |
|
| 38 | - public static $mimes = []; |
|
| 33 | + /** |
|
| 34 | + * Map of extensions to mime types. |
|
| 35 | + * |
|
| 36 | + * @var array $mimes |
|
| 37 | + */ |
|
| 38 | + public static $mimes = []; |
|
| 39 | 39 | |
| 40 | - /** |
|
| 41 | - * Constructor with an optional verification that the path is |
|
| 42 | - * really a mimes. |
|
| 43 | - * |
|
| 44 | - * @return mixed |
|
| 45 | - */ |
|
| 46 | - public function __construct() |
|
| 47 | - { |
|
| 48 | - static::$mimes = (array) require CON_PATH.'mimes.php'; |
|
| 49 | - } |
|
| 40 | + /** |
|
| 41 | + * Constructor with an optional verification that the path is |
|
| 42 | + * really a mimes. |
|
| 43 | + * |
|
| 44 | + * @return mixed |
|
| 45 | + */ |
|
| 46 | + public function __construct() |
|
| 47 | + { |
|
| 48 | + static::$mimes = (array) require CON_PATH.'mimes.php'; |
|
| 49 | + } |
|
| 50 | 50 | |
| 51 | - /** |
|
| 52 | - * Attempts to determine the best mime type for the given file extension. |
|
| 53 | - * |
|
| 54 | - * @param string $extension |
|
| 55 | - * |
|
| 56 | - * @return string|null The mime type found, or none if unable to determine |
|
| 57 | - */ |
|
| 58 | - public static function guessTypeFromExtension($extension) |
|
| 59 | - { |
|
| 60 | - $extension = trim(strtolower($extension), '. '); |
|
| 51 | + /** |
|
| 52 | + * Attempts to determine the best mime type for the given file extension. |
|
| 53 | + * |
|
| 54 | + * @param string $extension |
|
| 55 | + * |
|
| 56 | + * @return string|null The mime type found, or none if unable to determine |
|
| 57 | + */ |
|
| 58 | + public static function guessTypeFromExtension($extension) |
|
| 59 | + { |
|
| 60 | + $extension = trim(strtolower($extension), '. '); |
|
| 61 | 61 | |
| 62 | - if ( ! array_key_exists($extension, static::$mimes)) { |
|
| 63 | - return null; |
|
| 64 | - } |
|
| 62 | + if ( ! array_key_exists($extension, static::$mimes)) { |
|
| 63 | + return null; |
|
| 64 | + } |
|
| 65 | 65 | |
| 66 | - return is_array(static::$mimes[$extension]) ? static::$mimes[$extension][0] : static::$mimes[$extension]; |
|
| 67 | - } |
|
| 66 | + return is_array(static::$mimes[$extension]) ? static::$mimes[$extension][0] : static::$mimes[$extension]; |
|
| 67 | + } |
|
| 68 | 68 | |
| 69 | - /** |
|
| 70 | - * Attempts to determine the best file extension for a given mime type. |
|
| 71 | - * |
|
| 72 | - * @param string $type |
|
| 73 | - * |
|
| 74 | - * @return string|null The extension determined, or null if unable to match |
|
| 75 | - */ |
|
| 76 | - public static function guessExtensionFromType($type) |
|
| 77 | - { |
|
| 78 | - $type = trim(strtolower($type), '. '); |
|
| 69 | + /** |
|
| 70 | + * Attempts to determine the best file extension for a given mime type. |
|
| 71 | + * |
|
| 72 | + * @param string $type |
|
| 73 | + * |
|
| 74 | + * @return string|null The extension determined, or null if unable to match |
|
| 75 | + */ |
|
| 76 | + public static function guessExtensionFromType($type) |
|
| 77 | + { |
|
| 78 | + $type = trim(strtolower($type), '. '); |
|
| 79 | 79 | |
| 80 | - foreach (static::$mimes as $ext => $types) { |
|
| 81 | - if (is_string($types) && $types == $type) { |
|
| 82 | - return $ext; |
|
| 83 | - } elseif (is_array($types) && in_array($type, $types)) { |
|
| 84 | - return $ext; |
|
| 85 | - } |
|
| 86 | - } |
|
| 80 | + foreach (static::$mimes as $ext => $types) { |
|
| 81 | + if (is_string($types) && $types == $type) { |
|
| 82 | + return $ext; |
|
| 83 | + } elseif (is_array($types) && in_array($type, $types)) { |
|
| 84 | + return $ext; |
|
| 85 | + } |
|
| 86 | + } |
|
| 87 | 87 | |
| 88 | - return null; |
|
| 89 | - } |
|
| 88 | + return null; |
|
| 89 | + } |
|
| 90 | 90 | } |
| 91 | 91 | \ No newline at end of file |
@@ -40,7 +40,7 @@ discard block |
||
| 40 | 40 | */ |
| 41 | 41 | public function register() |
| 42 | 42 | { |
| 43 | - $this->app->singleton('encrypter', function ($app) { |
|
| 43 | + $this->app->singleton('encrypter', function($app) { |
|
| 44 | 44 | |
| 45 | 45 | $config = $app->make('config')->get('security'); |
| 46 | 46 | |
@@ -64,7 +64,7 @@ discard block |
||
| 64 | 64 | */ |
| 65 | 65 | protected function key(array $config) |
| 66 | 66 | { |
| 67 | - return take($config['key'], function ($key) { |
|
| 67 | + return take($config['key'], function($key) { |
|
| 68 | 68 | if (empty($key)) { |
| 69 | 69 | throw new RuntimeException('No application encryption key has been specified.'); |
| 70 | 70 | } |
@@ -176,7 +176,7 @@ |
||
| 176 | 176 | $connection->setEventDispatcher($this->app['events']); |
| 177 | 177 | } |
| 178 | 178 | |
| 179 | - $connection->setReconnector(function ($connection) { |
|
| 179 | + $connection->setReconnector(function($connection) { |
|
| 180 | 180 | $this->reconnect($connection->getName()); |
| 181 | 181 | }); |
| 182 | 182 | |
@@ -114,7 +114,7 @@ discard block |
||
| 114 | 114 | { |
| 115 | 115 | try { |
| 116 | 116 | $this->finder->find($view); |
| 117 | - } catch(InvalidArgumentException $e) { |
|
| 117 | + } catch (InvalidArgumentException $e) { |
|
| 118 | 118 | return false; |
| 119 | 119 | } |
| 120 | 120 | |
@@ -139,7 +139,7 @@ discard block |
||
| 139 | 139 | ); |
| 140 | 140 | |
| 141 | 141 | // Loader class instance. |
| 142 | - return take($this->viewInstance($view, $path, $data), function ($view) { |
|
| 142 | + return take($this->viewInstance($view, $path, $data), function($view) { |
|
| 143 | 143 | $this->callCreator($view); |
| 144 | 144 | }); |
| 145 | 145 | } |
@@ -38,274 +38,274 @@ |
||
| 38 | 38 | */ |
| 39 | 39 | class Factory implements FactoryContract |
| 40 | 40 | { |
| 41 | - use Extensions, |
|
| 42 | - Concerns\ManagesStacks, |
|
| 43 | - Concerns\ManagesLayouts, |
|
| 44 | - Concerns\ManagesComponents, |
|
| 45 | - Concerns\ManagesTranslations; |
|
| 41 | + use Extensions, |
|
| 42 | + Concerns\ManagesStacks, |
|
| 43 | + Concerns\ManagesLayouts, |
|
| 44 | + Concerns\ManagesComponents, |
|
| 45 | + Concerns\ManagesTranslations; |
|
| 46 | 46 | |
| 47 | - /** |
|
| 48 | - * The IoC container instance. |
|
| 49 | - * |
|
| 50 | - * @var \Syscodes\Contracts\Container\Container $container |
|
| 51 | - */ |
|
| 52 | - protected $container; |
|
| 47 | + /** |
|
| 48 | + * The IoC container instance. |
|
| 49 | + * |
|
| 50 | + * @var \Syscodes\Contracts\Container\Container $container |
|
| 51 | + */ |
|
| 52 | + protected $container; |
|
| 53 | 53 | |
| 54 | - /** |
|
| 55 | - * The engine implementation. |
|
| 56 | - * |
|
| 57 | - * @var \Syscodes\View\Engines\EngineResolver $engines |
|
| 58 | - */ |
|
| 59 | - protected $engines; |
|
| 54 | + /** |
|
| 55 | + * The engine implementation. |
|
| 56 | + * |
|
| 57 | + * @var \Syscodes\View\Engines\EngineResolver $engines |
|
| 58 | + */ |
|
| 59 | + protected $engines; |
|
| 60 | 60 | |
| 61 | - /** |
|
| 62 | - * The event dispatcher instance. |
|
| 63 | - * |
|
| 64 | - * @var \Syscodes\Contracts\Events\Dispatcher $events |
|
| 65 | - */ |
|
| 66 | - protected $events; |
|
| 61 | + /** |
|
| 62 | + * The event dispatcher instance. |
|
| 63 | + * |
|
| 64 | + * @var \Syscodes\Contracts\Events\Dispatcher $events |
|
| 65 | + */ |
|
| 66 | + protected $events; |
|
| 67 | 67 | |
| 68 | - /** |
|
| 69 | - * The view finder implementation. |
|
| 70 | - * |
|
| 71 | - * @var \Syscodes\View\FileViewFinder $finder |
|
| 72 | - */ |
|
| 73 | - protected $finder; |
|
| 68 | + /** |
|
| 69 | + * The view finder implementation. |
|
| 70 | + * |
|
| 71 | + * @var \Syscodes\View\FileViewFinder $finder |
|
| 72 | + */ |
|
| 73 | + protected $finder; |
|
| 74 | 74 | |
| 75 | - /** |
|
| 76 | - * The number of active rendering operations. |
|
| 77 | - * |
|
| 78 | - * @var int $renderCount |
|
| 79 | - */ |
|
| 80 | - protected $renderCount = 0; |
|
| 75 | + /** |
|
| 76 | + * The number of active rendering operations. |
|
| 77 | + * |
|
| 78 | + * @var int $renderCount |
|
| 79 | + */ |
|
| 80 | + protected $renderCount = 0; |
|
| 81 | 81 | |
| 82 | - /** |
|
| 83 | - * Array of shared data. |
|
| 84 | - * |
|
| 85 | - * @var array $shared |
|
| 86 | - */ |
|
| 87 | - protected $shared = []; |
|
| 82 | + /** |
|
| 83 | + * Array of shared data. |
|
| 84 | + * |
|
| 85 | + * @var array $shared |
|
| 86 | + */ |
|
| 87 | + protected $shared = []; |
|
| 88 | 88 | |
| 89 | - /** |
|
| 90 | - * Constructor: Create a new Parser class instance. |
|
| 91 | - * |
|
| 92 | - * @param \Syscodes\View\Engines\EngineResolver $engine |
|
| 93 | - * @param \Syscodes\Contracts\View\ViewFinder $finder |
|
| 94 | - * @param \Syscodes\Contracts\Events\Dispatcher $events |
|
| 95 | - * |
|
| 96 | - * @return void |
|
| 97 | - */ |
|
| 98 | - public function __construct(EngineResolver $engines, ViewFinder $finder, Dispatcher $events) |
|
| 99 | - { |
|
| 100 | - $this->finder = $finder; |
|
| 101 | - $this->engines = $engines; |
|
| 102 | - $this->events = $events; |
|
| 89 | + /** |
|
| 90 | + * Constructor: Create a new Parser class instance. |
|
| 91 | + * |
|
| 92 | + * @param \Syscodes\View\Engines\EngineResolver $engine |
|
| 93 | + * @param \Syscodes\Contracts\View\ViewFinder $finder |
|
| 94 | + * @param \Syscodes\Contracts\Events\Dispatcher $events |
|
| 95 | + * |
|
| 96 | + * @return void |
|
| 97 | + */ |
|
| 98 | + public function __construct(EngineResolver $engines, ViewFinder $finder, Dispatcher $events) |
|
| 99 | + { |
|
| 100 | + $this->finder = $finder; |
|
| 101 | + $this->engines = $engines; |
|
| 102 | + $this->events = $events; |
|
| 103 | 103 | |
| 104 | - $this->share('__env', $this); |
|
| 105 | - } |
|
| 104 | + $this->share('__env', $this); |
|
| 105 | + } |
|
| 106 | 106 | |
| 107 | - /** |
|
| 108 | - * {@inheritdoc} |
|
| 109 | - */ |
|
| 110 | - public function viewExists($view): bool |
|
| 111 | - { |
|
| 112 | - try { |
|
| 113 | - $this->finder->find($view); |
|
| 114 | - } catch(InvalidArgumentException $e) { |
|
| 115 | - return false; |
|
| 116 | - } |
|
| 107 | + /** |
|
| 108 | + * {@inheritdoc} |
|
| 109 | + */ |
|
| 110 | + public function viewExists($view): bool |
|
| 111 | + { |
|
| 112 | + try { |
|
| 113 | + $this->finder->find($view); |
|
| 114 | + } catch(InvalidArgumentException $e) { |
|
| 115 | + return false; |
|
| 116 | + } |
|
| 117 | 117 | |
| 118 | - return true; |
|
| 119 | - } |
|
| 118 | + return true; |
|
| 119 | + } |
|
| 120 | 120 | |
| 121 | - /** |
|
| 122 | - * {@inheritdoc} |
|
| 123 | - */ |
|
| 124 | - public function make($view, $data = []) |
|
| 125 | - { |
|
| 126 | - $path = $this->finder->find( |
|
| 127 | - $view = $this->normalizeName($view) |
|
| 128 | - ); |
|
| 121 | + /** |
|
| 122 | + * {@inheritdoc} |
|
| 123 | + */ |
|
| 124 | + public function make($view, $data = []) |
|
| 125 | + { |
|
| 126 | + $path = $this->finder->find( |
|
| 127 | + $view = $this->normalizeName($view) |
|
| 128 | + ); |
|
| 129 | 129 | |
| 130 | - // Loader class instance. |
|
| 131 | - return take($this->viewInstance($view, $path, $data), function ($view) { |
|
| 132 | - $this->callCreator($view); |
|
| 133 | - }); |
|
| 134 | - } |
|
| 130 | + // Loader class instance. |
|
| 131 | + return take($this->viewInstance($view, $path, $data), function ($view) { |
|
| 132 | + $this->callCreator($view); |
|
| 133 | + }); |
|
| 134 | + } |
|
| 135 | 135 | |
| 136 | - /** |
|
| 137 | - * Normalize a view name. |
|
| 138 | - * |
|
| 139 | - * @param string $name |
|
| 140 | - * |
|
| 141 | - * @return string |
|
| 142 | - */ |
|
| 143 | - protected function normalizeName($name): string |
|
| 144 | - { |
|
| 145 | - return ViewName::normalize($name); |
|
| 146 | - } |
|
| 136 | + /** |
|
| 137 | + * Normalize a view name. |
|
| 138 | + * |
|
| 139 | + * @param string $name |
|
| 140 | + * |
|
| 141 | + * @return string |
|
| 142 | + */ |
|
| 143 | + protected function normalizeName($name): string |
|
| 144 | + { |
|
| 145 | + return ViewName::normalize($name); |
|
| 146 | + } |
|
| 147 | 147 | |
| 148 | - /** |
|
| 149 | - * Create a new view instance from the given arguments. |
|
| 150 | - * |
|
| 151 | - * @param string $file View filename |
|
| 152 | - * @param string $path Path filename |
|
| 153 | - * @param array $data Array of values |
|
| 154 | - * |
|
| 155 | - * @return \Syscodes\Contracts\View\View |
|
| 156 | - */ |
|
| 157 | - protected function viewInstance($view, $path, $data) |
|
| 158 | - { |
|
| 159 | - return new View($this, $this->getEngineFromPath($path), $view, $path, $data); |
|
| 160 | - } |
|
| 148 | + /** |
|
| 149 | + * Create a new view instance from the given arguments. |
|
| 150 | + * |
|
| 151 | + * @param string $file View filename |
|
| 152 | + * @param string $path Path filename |
|
| 153 | + * @param array $data Array of values |
|
| 154 | + * |
|
| 155 | + * @return \Syscodes\Contracts\View\View |
|
| 156 | + */ |
|
| 157 | + protected function viewInstance($view, $path, $data) |
|
| 158 | + { |
|
| 159 | + return new View($this, $this->getEngineFromPath($path), $view, $path, $data); |
|
| 160 | + } |
|
| 161 | 161 | |
| 162 | - /** |
|
| 163 | - * Get the appropriate view engine for the given path. |
|
| 164 | - * |
|
| 165 | - * @param string $path |
|
| 166 | - * |
|
| 167 | - * @return \Syscodes\Components\Contracts\View\Engine |
|
| 168 | - * |
|
| 169 | - * @throws \InvalidArgumentException |
|
| 170 | - */ |
|
| 171 | - public function getEngineFromPath($path) |
|
| 172 | - { |
|
| 173 | - if ( ! $extension = $this->getExtension($path)) { |
|
| 174 | - throw new InvalidArgumentException("Unrecognized extension in file: {$path}"); |
|
| 175 | - } |
|
| 162 | + /** |
|
| 163 | + * Get the appropriate view engine for the given path. |
|
| 164 | + * |
|
| 165 | + * @param string $path |
|
| 166 | + * |
|
| 167 | + * @return \Syscodes\Components\Contracts\View\Engine |
|
| 168 | + * |
|
| 169 | + * @throws \InvalidArgumentException |
|
| 170 | + */ |
|
| 171 | + public function getEngineFromPath($path) |
|
| 172 | + { |
|
| 173 | + if ( ! $extension = $this->getExtension($path)) { |
|
| 174 | + throw new InvalidArgumentException("Unrecognized extension in file: {$path}"); |
|
| 175 | + } |
|
| 176 | 176 | |
| 177 | - $engine = $this->extensions[$extension]; |
|
| 177 | + $engine = $this->extensions[$extension]; |
|
| 178 | 178 | |
| 179 | - return $this->engines->resolve($engine); |
|
| 180 | - } |
|
| 179 | + return $this->engines->resolve($engine); |
|
| 180 | + } |
|
| 181 | 181 | |
| 182 | - /** |
|
| 183 | - * Get the extension used by the view file. |
|
| 184 | - * |
|
| 185 | - * @param string $path |
|
| 186 | - * |
|
| 187 | - * @return string |
|
| 188 | - */ |
|
| 189 | - protected function getExtension($path) |
|
| 190 | - { |
|
| 191 | - $extensions = array_keys($this->extensions); |
|
| 182 | + /** |
|
| 183 | + * Get the extension used by the view file. |
|
| 184 | + * |
|
| 185 | + * @param string $path |
|
| 186 | + * |
|
| 187 | + * @return string |
|
| 188 | + */ |
|
| 189 | + protected function getExtension($path) |
|
| 190 | + { |
|
| 191 | + $extensions = array_keys($this->extensions); |
|
| 192 | 192 | |
| 193 | - return Arr::first($extensions, function($value) use ($path) { |
|
| 194 | - return Str::endsWith($path, '.'.$value); |
|
| 195 | - }); |
|
| 196 | - } |
|
| 193 | + return Arr::first($extensions, function($value) use ($path) { |
|
| 194 | + return Str::endsWith($path, '.'.$value); |
|
| 195 | + }); |
|
| 196 | + } |
|
| 197 | 197 | |
| 198 | - /** |
|
| 199 | - * {@inheritdoc} |
|
| 200 | - */ |
|
| 201 | - public function callCreator(View $view): void |
|
| 202 | - { |
|
| 203 | - $this->events->dispatch('creating: '.$view->getView(), [$view]); |
|
| 204 | - } |
|
| 198 | + /** |
|
| 199 | + * {@inheritdoc} |
|
| 200 | + */ |
|
| 201 | + public function callCreator(View $view): void |
|
| 202 | + { |
|
| 203 | + $this->events->dispatch('creating: '.$view->getView(), [$view]); |
|
| 204 | + } |
|
| 205 | 205 | |
| 206 | - /** |
|
| 207 | - * {@inheritdoc} |
|
| 208 | - */ |
|
| 209 | - public function getExtensions(): array |
|
| 210 | - { |
|
| 211 | - return $this->extensions; |
|
| 212 | - } |
|
| 206 | + /** |
|
| 207 | + * {@inheritdoc} |
|
| 208 | + */ |
|
| 209 | + public function getExtensions(): array |
|
| 210 | + { |
|
| 211 | + return $this->extensions; |
|
| 212 | + } |
|
| 213 | 213 | |
| 214 | - /** |
|
| 215 | - * {@inheritdoc} |
|
| 216 | - */ |
|
| 217 | - public function share($key, $value = null) |
|
| 218 | - { |
|
| 219 | - $keys = is_array($key) ? $key : [$key => $value]; |
|
| 214 | + /** |
|
| 215 | + * {@inheritdoc} |
|
| 216 | + */ |
|
| 217 | + public function share($key, $value = null) |
|
| 218 | + { |
|
| 219 | + $keys = is_array($key) ? $key : [$key => $value]; |
|
| 220 | 220 | |
| 221 | - foreach ($keys as $key => $value) { |
|
| 222 | - $this->shared[$key] = $value; |
|
| 223 | - } |
|
| 221 | + foreach ($keys as $key => $value) { |
|
| 222 | + $this->shared[$key] = $value; |
|
| 223 | + } |
|
| 224 | 224 | |
| 225 | - return $value; |
|
| 226 | - } |
|
| 225 | + return $value; |
|
| 226 | + } |
|
| 227 | 227 | |
| 228 | - /** |
|
| 229 | - * {@inheritdoc} |
|
| 230 | - */ |
|
| 231 | - public function replaceNamespace($namespace, $hints): self |
|
| 232 | - { |
|
| 233 | - $this->finder->replaceNamespace($namespace, $hints); |
|
| 228 | + /** |
|
| 229 | + * {@inheritdoc} |
|
| 230 | + */ |
|
| 231 | + public function replaceNamespace($namespace, $hints): self |
|
| 232 | + { |
|
| 233 | + $this->finder->replaceNamespace($namespace, $hints); |
|
| 234 | 234 | |
| 235 | - return $this; |
|
| 236 | - } |
|
| 235 | + return $this; |
|
| 236 | + } |
|
| 237 | 237 | |
| 238 | - /** |
|
| 239 | - * {@inheritdoc} |
|
| 240 | - */ |
|
| 241 | - public function increment(): int |
|
| 242 | - { |
|
| 243 | - return $this->renderCount++; |
|
| 244 | - } |
|
| 238 | + /** |
|
| 239 | + * {@inheritdoc} |
|
| 240 | + */ |
|
| 241 | + public function increment(): int |
|
| 242 | + { |
|
| 243 | + return $this->renderCount++; |
|
| 244 | + } |
|
| 245 | 245 | |
| 246 | - /** |
|
| 247 | - * {@inheritdoc} |
|
| 248 | - */ |
|
| 249 | - public function decrement(): int |
|
| 250 | - { |
|
| 251 | - return $this->renderCount--; |
|
| 252 | - } |
|
| 246 | + /** |
|
| 247 | + * {@inheritdoc} |
|
| 248 | + */ |
|
| 249 | + public function decrement(): int |
|
| 250 | + { |
|
| 251 | + return $this->renderCount--; |
|
| 252 | + } |
|
| 253 | 253 | |
| 254 | - /** |
|
| 255 | - * {@inheritdoc} |
|
| 256 | - */ |
|
| 257 | - public function doneRendering(): bool |
|
| 258 | - { |
|
| 259 | - return $this->renderCount == 0; |
|
| 260 | - } |
|
| 254 | + /** |
|
| 255 | + * {@inheritdoc} |
|
| 256 | + */ |
|
| 257 | + public function doneRendering(): bool |
|
| 258 | + { |
|
| 259 | + return $this->renderCount == 0; |
|
| 260 | + } |
|
| 261 | 261 | |
| 262 | - /** |
|
| 263 | - * {@inheritdoc} |
|
| 264 | - */ |
|
| 265 | - public function flushState(): void |
|
| 266 | - { |
|
| 267 | - $this->renderCount = 0; |
|
| 262 | + /** |
|
| 263 | + * {@inheritdoc} |
|
| 264 | + */ |
|
| 265 | + public function flushState(): void |
|
| 266 | + { |
|
| 267 | + $this->renderCount = 0; |
|
| 268 | 268 | |
| 269 | - $this->flushSections(); |
|
| 270 | - } |
|
| 269 | + $this->flushSections(); |
|
| 270 | + } |
|
| 271 | 271 | |
| 272 | - /** |
|
| 273 | - * {@inheritdoc} |
|
| 274 | - */ |
|
| 275 | - public function flushStateIfDoneRendering(): void |
|
| 276 | - { |
|
| 277 | - if ($this->doneRendering()) { |
|
| 278 | - $this->flushState(); |
|
| 279 | - } |
|
| 280 | - } |
|
| 272 | + /** |
|
| 273 | + * {@inheritdoc} |
|
| 274 | + */ |
|
| 275 | + public function flushStateIfDoneRendering(): void |
|
| 276 | + { |
|
| 277 | + if ($this->doneRendering()) { |
|
| 278 | + $this->flushState(); |
|
| 279 | + } |
|
| 280 | + } |
|
| 281 | 281 | |
| 282 | - /** |
|
| 283 | - * {@inheritdoc} |
|
| 284 | - */ |
|
| 285 | - public function getShared(): array |
|
| 286 | - { |
|
| 287 | - return $this->shared; |
|
| 288 | - } |
|
| 282 | + /** |
|
| 283 | + * {@inheritdoc} |
|
| 284 | + */ |
|
| 285 | + public function getShared(): array |
|
| 286 | + { |
|
| 287 | + return $this->shared; |
|
| 288 | + } |
|
| 289 | 289 | |
| 290 | - /** |
|
| 291 | - * Get the IoC container instance. |
|
| 292 | - * |
|
| 293 | - * @return \Syscodes\Contracts\Container\Container |
|
| 294 | - */ |
|
| 295 | - public function getContainer() |
|
| 296 | - { |
|
| 297 | - return $this->container; |
|
| 298 | - } |
|
| 290 | + /** |
|
| 291 | + * Get the IoC container instance. |
|
| 292 | + * |
|
| 293 | + * @return \Syscodes\Contracts\Container\Container |
|
| 294 | + */ |
|
| 295 | + public function getContainer() |
|
| 296 | + { |
|
| 297 | + return $this->container; |
|
| 298 | + } |
|
| 299 | 299 | |
| 300 | - /** |
|
| 301 | - * Set the IoC container instance. |
|
| 302 | - * |
|
| 303 | - * @param \Syscodes\Contracts\Container\Container $container |
|
| 304 | - * |
|
| 305 | - * @return void |
|
| 306 | - */ |
|
| 307 | - public function setContainer(Container $container) |
|
| 308 | - { |
|
| 309 | - $this->container = $container; |
|
| 310 | - } |
|
| 300 | + /** |
|
| 301 | + * Set the IoC container instance. |
|
| 302 | + * |
|
| 303 | + * @param \Syscodes\Contracts\Container\Container $container |
|
| 304 | + * |
|
| 305 | + * @return void |
|
| 306 | + */ |
|
| 307 | + public function setContainer(Container $container) |
|
| 308 | + { |
|
| 309 | + $this->container = $container; |
|
| 310 | + } |
|
| 311 | 311 | } |
| 312 | 312 | \ No newline at end of file |
@@ -57,7 +57,7 @@ discard block |
||
| 57 | 57 | */ |
| 58 | 58 | public function registerView() |
| 59 | 59 | { |
| 60 | - $this->app->singleton('view', function ($app) { |
|
| 60 | + $this->app->singleton('view', function($app) { |
|
| 61 | 61 | // The resolver will be used by an environment to get each of the various |
| 62 | 62 | // engine implementations such as plain PHP or Plaze engine. |
| 63 | 63 | $resolver = $app['view.engine.resolver']; |
@@ -84,7 +84,7 @@ discard block |
||
| 84 | 84 | */ |
| 85 | 85 | public function registerViewFinder() |
| 86 | 86 | { |
| 87 | - $this->app->bind('view.finder', function ($app) { |
|
| 87 | + $this->app->bind('view.finder', function($app) { |
|
| 88 | 88 | return new FileViewFinder($app['files'], $app['config']['view.paths']); |
| 89 | 89 | }); |
| 90 | 90 | } |
@@ -96,7 +96,7 @@ discard block |
||
| 96 | 96 | */ |
| 97 | 97 | public function registerPlazeTranspiler() |
| 98 | 98 | { |
| 99 | - $this->app->singleton('plaze.transpiler', function ($app) { |
|
| 99 | + $this->app->singleton('plaze.transpiler', function($app) { |
|
| 100 | 100 | return new PlazeTranspiler( |
| 101 | 101 | $app['files'], $app['config']['view.transpiled'] |
| 102 | 102 | ); |
@@ -111,7 +111,7 @@ discard block |
||
| 111 | 111 | */ |
| 112 | 112 | public function registerEngineResolver() |
| 113 | 113 | { |
| 114 | - $this->app->singleton('view.engine.resolver', function () { |
|
| 114 | + $this->app->singleton('view.engine.resolver', function() { |
|
| 115 | 115 | $resolver = new EngineResolver; |
| 116 | 116 | |
| 117 | 117 | // Register of the various view engines with the resolver |
@@ -133,7 +133,7 @@ discard block |
||
| 133 | 133 | */ |
| 134 | 134 | public function registerFileEngine($resolver) |
| 135 | 135 | { |
| 136 | - $resolver->register('file', function () { |
|
| 136 | + $resolver->register('file', function() { |
|
| 137 | 137 | return new FileEngine; |
| 138 | 138 | }); |
| 139 | 139 | } |
@@ -147,7 +147,7 @@ discard block |
||
| 147 | 147 | */ |
| 148 | 148 | public function registerPhpEngine($resolver) |
| 149 | 149 | { |
| 150 | - $resolver->register('php', function () { |
|
| 150 | + $resolver->register('php', function() { |
|
| 151 | 151 | return new PhpEngine($this->app['files']); |
| 152 | 152 | }); |
| 153 | 153 | } |
@@ -161,7 +161,7 @@ discard block |
||
| 161 | 161 | */ |
| 162 | 162 | public function registerPlazeEngine($resolver) |
| 163 | 163 | { |
| 164 | - $resolver->register('plaze', function () { |
|
| 164 | + $resolver->register('plaze', function() { |
|
| 165 | 165 | return new TranspilerEngine($this->app['plaze.transpiler'], $this->app['files']); |
| 166 | 166 | }); |
| 167 | 167 | } |
@@ -71,7 +71,7 @@ discard block |
||
| 71 | 71 | { |
| 72 | 72 | $pattern = sprintf('/(@)?%s\s*(.+?)\s*%s(\r?\n)?/s', $this->rawTags[0], $this->rawTags[1]); |
| 73 | 73 | |
| 74 | - $callback = function ($matches) { |
|
| 74 | + $callback = function($matches) { |
|
| 75 | 75 | $whitespace = empty($matches[3]) ? '' : $matches[3].$matches[3]; |
| 76 | 76 | |
| 77 | 77 | return $matches[1] ? substr($matches[0], 1) : "<?php echo {$matches[2]}; ?>{$whitespace}"; |
@@ -91,7 +91,7 @@ discard block |
||
| 91 | 91 | { |
| 92 | 92 | $pattern = sprintf('/(@)?%s\s*(.+?)\s*%s(\r?\n)?/s', $this->contentTags[0], $this->contentTags[1]); |
| 93 | 93 | |
| 94 | - $callback = function ($matches) { |
|
| 94 | + $callback = function($matches) { |
|
| 95 | 95 | $whitespace = empty($matches[3]) ? '' : $matches[3].$matches[3]; |
| 96 | 96 | |
| 97 | 97 | $wrapped = sprintf($this->echoFormat, $matches[2]); |
@@ -113,7 +113,7 @@ discard block |
||
| 113 | 113 | { |
| 114 | 114 | $pattern = sprintf('/(@)?%s\s*(.+?)\s*%s(\r?\n)?/s', $this->escapedTags[0], $this->escapedTags[1]); |
| 115 | 115 | |
| 116 | - $callback = function ($matches) { |
|
| 116 | + $callback = function($matches) { |
|
| 117 | 117 | $whitespace = empty($matches[3]) ? '' : $matches[3].$matches[3]; |
| 118 | 118 | |
| 119 | 119 | return $matches[1] ? $matches[0] : "<?php echo e({$matches[2]}); ?>{$whitespace}"; |
@@ -164,7 +164,7 @@ |
||
| 164 | 164 | |
| 165 | 165 | foreach ($transitions as $transition) { |
| 166 | 166 | if ($transition['time'] > $this->format('U')) { |
| 167 | - $dayLightSaving = (bool) $transition['isdst'] ?? $dayLightSaving; |
|
| 167 | + $dayLightSaving = (bool) $transition['isdst'] ?? $dayLightSaving; |
|
| 168 | 168 | } |
| 169 | 169 | } |
| 170 | 170 | |
@@ -69,7 +69,7 @@ |
||
| 69 | 69 | */ |
| 70 | 70 | function dd() |
| 71 | 71 | { |
| 72 | - array_map(function ($x) { |
|
| 72 | + array_map(function($x) { |
|
| 73 | 73 | var_dump($x); |
| 74 | 74 | }, func_get_args()); |
| 75 | 75 | |