@@ -45,7 +45,7 @@ discard block |
||
| 45 | 45 | |
| 46 | 46 | /** |
| 47 | 47 | * Valeurs autorisées pour l'environnement. |
| 48 | - * Tester le travail est exclu puisque klinge ne fonctionnera pas sur elle. |
|
| 48 | + * Tester le travail est exclu puisque klinge ne fonctionnera pas sur elle. |
|
| 49 | 49 | * |
| 50 | 50 | * @var array<int, string> |
| 51 | 51 | */ |
@@ -61,7 +61,7 @@ discard block |
||
| 61 | 61 | { |
| 62 | 62 | if (null === $env = $this->argument('environment')) { |
| 63 | 63 | $this->write('Votre environnement est actuellement défini comme: '); |
| 64 | - $this->ok(config('app.environment'))->eol(); |
|
| 64 | + $this->ok(config('app.environment'))->eol(); |
|
| 65 | 65 | |
| 66 | 66 | return; |
| 67 | 67 | } |
@@ -113,6 +113,6 @@ discard block |
||
| 113 | 113 | copy($baseEnv, $envFile); |
| 114 | 114 | } |
| 115 | 115 | |
| 116 | - return DotEnv::instance()->replace(['ENVIRONMENT' => $newEnv]); |
|
| 116 | + return DotEnv::instance()->replace(['ENVIRONMENT' => $newEnv]); |
|
| 117 | 117 | } |
| 118 | 118 | } |
@@ -74,14 +74,14 @@ discard block |
||
| 74 | 74 | return; |
| 75 | 75 | } |
| 76 | 76 | |
| 77 | - if (! in_array($env, self::$knownTypes, true)) { |
|
| 77 | + if (!in_array($env, self::$knownTypes, true)) { |
|
| 78 | 78 | $this->error(sprintf('Type d\'environnement non valide "%s". Attendu un des "%s".', $env, implode('" et "', self::$knownTypes))); |
| 79 | 79 | $this->newLine(); |
| 80 | 80 | |
| 81 | 81 | return; |
| 82 | 82 | } |
| 83 | 83 | |
| 84 | - if (! $this->writeNewEnvironmentToEnvFile($env)) { |
|
| 84 | + if (!$this->writeNewEnvironmentToEnvFile($env)) { |
|
| 85 | 85 | $this->error('Erreur dans l\'écriture nouvel environnement dans le fichier `.env`.'); |
| 86 | 86 | $this->newLine(); |
| 87 | 87 | |
@@ -101,8 +101,8 @@ discard block |
||
| 101 | 101 | $baseEnv = ROOTPATH . '.env.example'; |
| 102 | 102 | $envFile = ROOTPATH . '.env'; |
| 103 | 103 | |
| 104 | - if (! is_file($envFile)) { |
|
| 105 | - if (! is_file($baseEnv)) { |
|
| 104 | + if (!is_file($envFile)) { |
|
| 105 | + if (!is_file($baseEnv)) { |
|
| 106 | 106 | $this->writer->warn('Les deux fichiers `.env.example` et `.env` sont manquants.', true); |
| 107 | 107 | $this->write('Il est impossible d\'écrire le nouveau type d\'environnement.'); |
| 108 | 108 | $this->newLine(); |
@@ -25,7 +25,7 @@ discard block |
||
| 25 | 25 | */ |
| 26 | 26 | protected $group = 'BlitzPHP'; |
| 27 | 27 | |
| 28 | - /** |
|
| 28 | + /** |
|
| 29 | 29 | * @var string Nom |
| 30 | 30 | */ |
| 31 | 31 | protected $name = 'namespaces'; |
@@ -52,20 +52,20 @@ discard block |
||
| 52 | 52 | $m = (int) $this->option('m', 60); |
| 53 | 53 | |
| 54 | 54 | $tbody = true === $this->option('b') |
| 55 | - ? $this->outputBlitzNamespaces($m) |
|
| 56 | - : $this->outputAllNamespaces($m); |
|
| 55 | + ? $this->outputBlitzNamespaces($m) |
|
| 56 | + : $this->outputAllNamespaces($m); |
|
| 57 | 57 | |
| 58 | - $table = []; |
|
| 58 | + $table = []; |
|
| 59 | 59 | |
| 60 | - foreach ($tbody as $namespace) { |
|
| 61 | - $table[] = [ |
|
| 62 | - 'Namespace' => $namespace[0], |
|
| 63 | - 'Chemin' => $namespace[1], |
|
| 64 | - 'Trouvé?' => $namespace[2] ? 'Oui' : 'Manque', |
|
| 65 | - ]; |
|
| 66 | - } |
|
| 60 | + foreach ($tbody as $namespace) { |
|
| 61 | + $table[] = [ |
|
| 62 | + 'Namespace' => $namespace[0], |
|
| 63 | + 'Chemin' => $namespace[1], |
|
| 64 | + 'Trouvé?' => $namespace[2] ? 'Oui' : 'Manque', |
|
| 65 | + ]; |
|
| 66 | + } |
|
| 67 | 67 | |
| 68 | - $this->table($table); |
|
| 68 | + $this->table($table); |
|
| 69 | 69 | } |
| 70 | 70 | |
| 71 | 71 | private function outputAllNamespaces(int $maxLength): array |
@@ -50,7 +50,7 @@ discard block |
||
| 50 | 50 | */ |
| 51 | 51 | public function execute(array $params) |
| 52 | 52 | { |
| 53 | - $method = strtolower($this->argument('method', '')); |
|
| 53 | + $method = strtolower($this->argument('method', '')); |
|
| 54 | 54 | $route = $this->argument('route', ''); |
| 55 | 55 | |
| 56 | 56 | if (empty($route) || empty($method)) { |
@@ -72,18 +72,18 @@ discard block |
||
| 72 | 72 | // PageNotFoundException |
| 73 | 73 | if ($middlewares === ['<unknown>']) { |
| 74 | 74 | $this->fail("Impossible de trouver une route: ") . |
| 75 | - $this->colorize('"' . strtoupper($method) . ' ' . $route . '"', 'black'); |
|
| 75 | + $this->colorize('"' . strtoupper($method) . ' ' . $route . '"', 'black'); |
|
| 76 | 76 | |
| 77 | 77 | return EXIT_ERROR; |
| 78 | 78 | } |
| 79 | 79 | |
| 80 | - $this->table([ |
|
| 81 | - [ |
|
| 82 | - 'Methode' => strtoupper($method), |
|
| 83 | - 'Route' => $route, |
|
| 84 | - 'Middlewares' => implode(' ', $middlewares), |
|
| 85 | - ] |
|
| 86 | - ]); |
|
| 80 | + $this->table([ |
|
| 81 | + [ |
|
| 82 | + 'Methode' => strtoupper($method), |
|
| 83 | + 'Route' => $route, |
|
| 84 | + 'Middlewares' => implode(' ', $middlewares), |
|
| 85 | + ] |
|
| 86 | + ]); |
|
| 87 | 87 | |
| 88 | 88 | return EXIT_SUCCESS; |
| 89 | 89 | } |
@@ -51,7 +51,7 @@ |
||
| 51 | 51 | public function execute(array $params) |
| 52 | 52 | { |
| 53 | 53 | $method = strtolower($this->argument('method', '')); |
| 54 | - $route = $this->argument('route', ''); |
|
| 54 | + $route = $this->argument('route', ''); |
|
| 55 | 55 | |
| 56 | 56 | if (empty($route) || empty($method)) { |
| 57 | 57 | $this->fail('Vous devez spécifier un verbe HTTP et une route.')->eol(); |
@@ -143,6 +143,6 @@ |
||
| 143 | 143 | copy($baseEnv, $envFile); |
| 144 | 144 | } |
| 145 | 145 | |
| 146 | - return DotEnv::instance()->replace(['encryption.key' => $key]); |
|
| 146 | + return DotEnv::instance()->replace(['encryption.key' => $key]); |
|
| 147 | 147 | } |
| 148 | 148 | } |
@@ -58,7 +58,7 @@ discard block |
||
| 58 | 58 | |
| 59 | 59 | if (in_array($prefix, [null, true], true)) { |
| 60 | 60 | $prefix = 'hex2bin'; |
| 61 | - } elseif (! in_array($prefix, ['hex2bin', 'base64'], true)) { |
|
| 61 | + } elseif (!in_array($prefix, ['hex2bin', 'base64'], true)) { |
|
| 62 | 62 | $prefix = $this->choice('Veuillez utiliser un prefixe validee.', ['hex2bin', 'base64']); // @codeCoverageIgnore |
| 63 | 63 | } |
| 64 | 64 | |
@@ -78,7 +78,7 @@ discard block |
||
| 78 | 78 | return; |
| 79 | 79 | } |
| 80 | 80 | |
| 81 | - if (! $this->setNewEncryptionKey($encodedKey)) { |
|
| 81 | + if (!$this->setNewEncryptionKey($encodedKey)) { |
|
| 82 | 82 | $this->writer->error('Erreur dans la configuration d\'une nouvelle cle d\'encryption dans le fichier `.env`.', true); |
| 83 | 83 | |
| 84 | 84 | return; |
@@ -108,7 +108,7 @@ discard block |
||
| 108 | 108 | { |
| 109 | 109 | $currentKey = env('encryption.key', ''); |
| 110 | 110 | |
| 111 | - if ($currentKey !== '' && ! $this->confirmOverwrite()) { |
|
| 111 | + if ($currentKey !== '' && !$this->confirmOverwrite()) { |
|
| 112 | 112 | // Pas testable car require une entree au clavier |
| 113 | 113 | return false; // @codeCoverageIgnore |
| 114 | 114 | } |
@@ -132,8 +132,8 @@ discard block |
||
| 132 | 132 | $baseEnv = ROOTPATH . '.env.example'; |
| 133 | 133 | $envFile = ROOTPATH . '.env'; |
| 134 | 134 | |
| 135 | - if (! is_file($envFile)) { |
|
| 136 | - if (! is_file($baseEnv)) { |
|
| 135 | + if (!is_file($envFile)) { |
|
| 136 | + if (!is_file($baseEnv)) { |
|
| 137 | 137 | $this->writer->warn('Both default shipped `.env.example` file and custom `.env` are missing.'); |
| 138 | 138 | $this->write('Here\'s your new key instead: ' . $this->writer->warn($key), true); |
| 139 | 139 | |
@@ -30,7 +30,7 @@ |
||
| 30 | 30 | */ |
| 31 | 31 | protected $code = 302; |
| 32 | 32 | |
| 33 | - protected ?ResponseInterface $response = null; |
|
| 33 | + protected ?ResponseInterface $response = null; |
|
| 34 | 34 | |
| 35 | 35 | /** |
| 36 | 36 | * @param ResponseInterface|string $message Response object or a string containing a relative URI. |
@@ -40,15 +40,15 @@ discard block |
||
| 40 | 40 | */ |
| 41 | 41 | protected string $title = 'Routes'; |
| 42 | 42 | |
| 43 | - private DefinedRouteCollector $definedRouteCollector; |
|
| 44 | - private Router $router; |
|
| 43 | + private DefinedRouteCollector $definedRouteCollector; |
|
| 44 | + private Router $router; |
|
| 45 | 45 | |
| 46 | - public function __construct() |
|
| 47 | - { |
|
| 48 | - $rawRoutes = Services::routes(true); |
|
| 49 | - $this->router = Services::router($rawRoutes, null, true); |
|
| 50 | - $this->definedRouteCollector = new DefinedRouteCollector($rawRoutes); |
|
| 51 | - } |
|
| 46 | + public function __construct() |
|
| 47 | + { |
|
| 48 | + $rawRoutes = Services::routes(true); |
|
| 49 | + $this->router = Services::router($rawRoutes, null, true); |
|
| 50 | + $this->definedRouteCollector = new DefinedRouteCollector($rawRoutes); |
|
| 51 | + } |
|
| 52 | 52 | |
| 53 | 53 | /** |
| 54 | 54 | * {@inheritDoc} |
@@ -101,16 +101,16 @@ discard block |
||
| 101 | 101 | // Routes définies |
| 102 | 102 | $routes = []; |
| 103 | 103 | |
| 104 | - foreach ($this->definedRouteCollector->collect(false) as $route) { |
|
| 104 | + foreach ($this->definedRouteCollector->collect(false) as $route) { |
|
| 105 | 105 | // filtre pour les chaînes, car les rappels ne sont pas affichable |
| 106 | - if ($route['handler'] !== '(Closure)') { |
|
| 107 | - $routes[] = [ |
|
| 108 | - 'method' => strtoupper($route['method']), |
|
| 109 | - 'route' => $route['route'], |
|
| 110 | - 'name' => $route['name'], |
|
| 111 | - 'handler' => $route['handler'], |
|
| 112 | - ]; |
|
| 113 | - } |
|
| 106 | + if ($route['handler'] !== '(Closure)') { |
|
| 107 | + $routes[] = [ |
|
| 108 | + 'method' => strtoupper($route['method']), |
|
| 109 | + 'route' => $route['route'], |
|
| 110 | + 'name' => $route['name'], |
|
| 111 | + 'handler' => $route['handler'], |
|
| 112 | + ]; |
|
| 113 | + } |
|
| 114 | 114 | } |
| 115 | 115 | |
| 116 | 116 | return [ |
@@ -124,15 +124,15 @@ discard block |
||
| 124 | 124 | */ |
| 125 | 125 | public function getBadgeValue(): int |
| 126 | 126 | { |
| 127 | - $count = 0; |
|
| 127 | + $count = 0; |
|
| 128 | 128 | |
| 129 | - foreach ($this->definedRouteCollector->collect(false) as $route) { |
|
| 129 | + foreach ($this->definedRouteCollector->collect(false) as $route) { |
|
| 130 | 130 | if ($route['handler'] !== '(Closure)') { |
| 131 | - $count++; |
|
| 132 | - } |
|
| 131 | + $count++; |
|
| 132 | + } |
|
| 133 | 133 | } |
| 134 | 134 | |
| 135 | - return $count; |
|
| 135 | + return $count; |
|
| 136 | 136 | } |
| 137 | 137 | |
| 138 | 138 | /** |
@@ -99,7 +99,7 @@ |
||
| 99 | 99 | ]; |
| 100 | 100 | |
| 101 | 101 | // Routes définies |
| 102 | - $routes = []; |
|
| 102 | + $routes = []; |
|
| 103 | 103 | |
| 104 | 104 | foreach ($this->definedRouteCollector->collect(false) as $route) { |
| 105 | 105 | // filtre pour les chaînes, car les rappels ne sont pas affichable |
@@ -20,24 +20,24 @@ discard block |
||
| 20 | 20 | protected $message = ':attribute :value has been used'; |
| 21 | 21 | protected $fillableParams = ['table', 'column', 'ignore']; |
| 22 | 22 | |
| 23 | - /** |
|
| 23 | + /** |
|
| 24 | 24 | * The name of the ID column. |
| 25 | 25 | */ |
| 26 | 26 | protected string $idColumn = 'id'; |
| 27 | 27 | |
| 28 | - protected string $deletedAtColumn = ''; |
|
| 28 | + protected string $deletedAtColumn = ''; |
|
| 29 | 29 | |
| 30 | 30 | |
| 31 | 31 | public function __construct(protected ConnectionInterface $db) |
| 32 | 32 | { |
| 33 | 33 | } |
| 34 | 34 | |
| 35 | - /** |
|
| 35 | + /** |
|
| 36 | 36 | * Ignore the given ID during the unique check. |
| 37 | 37 | */ |
| 38 | 38 | public function ignore(mixed $id, ?string $idColumn = null): self |
| 39 | 39 | { |
| 40 | - if (class_exists(Model::class) && $id instanceof Model) { |
|
| 40 | + if (class_exists(Model::class) && $id instanceof Model) { |
|
| 41 | 41 | return $this->ignoreModel($id, $idColumn); |
| 42 | 42 | } |
| 43 | 43 | |
@@ -48,23 +48,23 @@ discard block |
||
| 48 | 48 | return $this; |
| 49 | 49 | } |
| 50 | 50 | |
| 51 | - /** |
|
| 51 | + /** |
|
| 52 | 52 | * Ignore the given model during the unique check. |
| 53 | 53 | */ |
| 54 | 54 | public function ignoreModel(Model $entity, ?string $idColumn = null): self |
| 55 | 55 | { |
| 56 | - $this->idColumn = $idColumn ?? $entity->getKeyName(); |
|
| 56 | + $this->idColumn = $idColumn ?? $entity->getKeyName(); |
|
| 57 | 57 | $this->params['ignore'] = $entity->{$this->idColumn}; |
| 58 | 58 | |
| 59 | 59 | return $this; |
| 60 | 60 | } |
| 61 | 61 | |
| 62 | - /** |
|
| 62 | + /** |
|
| 63 | 63 | * Ignore soft deleted models during the unique check. |
| 64 | 64 | */ |
| 65 | 65 | public function withoutTrashed(string $deletedAtColumn = 'deleted_at'): self |
| 66 | 66 | { |
| 67 | - $this->deletedAtColumn = $deletedAtColumn; |
|
| 67 | + $this->deletedAtColumn = $deletedAtColumn; |
|
| 68 | 68 | |
| 69 | 69 | return $this; |
| 70 | 70 | } |
@@ -78,14 +78,14 @@ discard block |
||
| 78 | 78 | $column = $this->parameter('column'); |
| 79 | 79 | $column = $column ?: $this->getAttribute()->getKey(); |
| 80 | 80 | |
| 81 | - $builder = $this->db->table($table)->where($column, $value); |
|
| 81 | + $builder = $this->db->table($table)->where($column, $value); |
|
| 82 | 82 | |
| 83 | - if ($ignore) { |
|
| 84 | - $builder->where($this->idColumn . ' !=', $ignore); |
|
| 85 | - } |
|
| 86 | - if ('' !== $this->deletedAtColumn) { |
|
| 87 | - $builder->where($this->deletedAtColumn . ' IS NULL'); |
|
| 88 | - } |
|
| 83 | + if ($ignore) { |
|
| 84 | + $builder->where($this->idColumn . ' !=', $ignore); |
|
| 85 | + } |
|
| 86 | + if ('' !== $this->deletedAtColumn) { |
|
| 87 | + $builder->where($this->deletedAtColumn . ' IS NULL'); |
|
| 88 | + } |
|
| 89 | 89 | |
| 90 | 90 | return $builder->count() === 0; |
| 91 | 91 | } |
@@ -53,7 +53,7 @@ |
||
| 53 | 53 | */ |
| 54 | 54 | public function ignoreModel(Model $entity, ?string $idColumn = null): self |
| 55 | 55 | { |
| 56 | - $this->idColumn = $idColumn ?? $entity->getKeyName(); |
|
| 56 | + $this->idColumn = $idColumn ?? $entity->getKeyName(); |
|
| 57 | 57 | $this->params['ignore'] = $entity->{$this->idColumn}; |
| 58 | 58 | |
| 59 | 59 | return $this; |
@@ -61,34 +61,34 @@ |
||
| 61 | 61 | return true; // notifie de la reussite de l'operation |
| 62 | 62 | } |
| 63 | 63 | |
| 64 | - /** |
|
| 64 | + /** |
|
| 65 | 65 | * Remplace les valeurs dans le fichiers .env |
| 66 | - * |
|
| 67 | - * Si une valeur n'existe pas, elle est ajoutée au fichier |
|
| 66 | + * |
|
| 67 | + * Si une valeur n'existe pas, elle est ajoutée au fichier |
|
| 68 | 68 | */ |
| 69 | - public function replace(array $data, bool $reload = true): bool |
|
| 70 | - { |
|
| 71 | - $oldFileContents = (string) file_get_contents($this->path); |
|
| 72 | - |
|
| 73 | - foreach ($data as $key => $value) { |
|
| 74 | - $replacementKey = "\n{$key} = {$value}"; |
|
| 75 | - if (strpos($oldFileContents, $key) === false) { |
|
| 76 | - if (file_put_contents($this->path, $replacementKey, FILE_APPEND) === false) { |
|
| 77 | - return false; |
|
| 78 | - } |
|
| 79 | - unset($data[$key]); |
|
| 80 | - } |
|
| 81 | - } |
|
| 82 | - |
|
| 83 | - if ($data === []) { |
|
| 84 | - if ($reload) { |
|
| 85 | - return $this->load(); |
|
| 86 | - } |
|
| 87 | - return true; |
|
| 88 | - } |
|
| 89 | - |
|
| 90 | - return $this->update($data, $reload); |
|
| 91 | - } |
|
| 69 | + public function replace(array $data, bool $reload = true): bool |
|
| 70 | + { |
|
| 71 | + $oldFileContents = (string) file_get_contents($this->path); |
|
| 72 | + |
|
| 73 | + foreach ($data as $key => $value) { |
|
| 74 | + $replacementKey = "\n{$key} = {$value}"; |
|
| 75 | + if (strpos($oldFileContents, $key) === false) { |
|
| 76 | + if (file_put_contents($this->path, $replacementKey, FILE_APPEND) === false) { |
|
| 77 | + return false; |
|
| 78 | + } |
|
| 79 | + unset($data[$key]); |
|
| 80 | + } |
|
| 81 | + } |
|
| 82 | + |
|
| 83 | + if ($data === []) { |
|
| 84 | + if ($reload) { |
|
| 85 | + return $this->load(); |
|
| 86 | + } |
|
| 87 | + return true; |
|
| 88 | + } |
|
| 89 | + |
|
| 90 | + return $this->update($data, $reload); |
|
| 91 | + } |
|
| 92 | 92 | |
| 93 | 93 | /** |
| 94 | 94 | * Modifie les valeurs dans le fichiers .env |
@@ -71,7 +71,7 @@ discard block |
||
| 71 | 71 | $oldFileContents = (string) file_get_contents($this->path); |
| 72 | 72 | |
| 73 | 73 | foreach ($data as $key => $value) { |
| 74 | - $replacementKey = "\n{$key} = {$value}"; |
|
| 74 | + $replacementKey = "\n{$key} = {$value}"; |
|
| 75 | 75 | if (strpos($oldFileContents, $key) === false) { |
| 76 | 76 | if (file_put_contents($this->path, $replacementKey, FILE_APPEND) === false) { |
| 77 | 77 | return false; |
@@ -101,7 +101,7 @@ discard block |
||
| 101 | 101 | } |
| 102 | 102 | } |
| 103 | 103 | |
| 104 | - if (! count($data)) { |
|
| 104 | + if (!count($data)) { |
|
| 105 | 105 | return false; |
| 106 | 106 | } |
| 107 | 107 | |
@@ -138,18 +138,18 @@ discard block |
||
| 138 | 138 | public function parse(): ?array |
| 139 | 139 | { |
| 140 | 140 | // Nous ne voulons pas imposer la présence d'un fichier .env, ils devraient être facultatifs. |
| 141 | - if (! is_file($this->path)) { |
|
| 141 | + if (!is_file($this->path)) { |
|
| 142 | 142 | return null; |
| 143 | 143 | } |
| 144 | 144 | |
| 145 | 145 | // Assurez-vous que le fichier est lisible |
| 146 | - if (! is_readable($this->path)) { |
|
| 146 | + if (!is_readable($this->path)) { |
|
| 147 | 147 | throw new InvalidArgumentException("The .env file is not readable: {$this->path}"); |
| 148 | 148 | } |
| 149 | 149 | |
| 150 | 150 | $vars = []; |
| 151 | 151 | |
| 152 | - $lines = file($this->path, FILE_IGNORE_NEW_LINES | FILE_SKIP_EMPTY_LINES); |
|
| 152 | + $lines = file($this->path, FILE_IGNORE_NEW_LINES|FILE_SKIP_EMPTY_LINES); |
|
| 153 | 153 | |
| 154 | 154 | foreach ($lines as $line) { |
| 155 | 155 | // C'est un commentaire? |
@@ -174,7 +174,7 @@ discard block |
||
| 174 | 174 | */ |
| 175 | 175 | protected function setVariable(string $name, string $value = '') |
| 176 | 176 | { |
| 177 | - if (! getenv($name, true)) { |
|
| 177 | + if (!getenv($name, true)) { |
|
| 178 | 178 | putenv("{$name}={$value}"); |
| 179 | 179 | } |
| 180 | 180 | if (empty($_ENV[$name])) { |
@@ -223,7 +223,7 @@ discard block |
||
| 223 | 223 | */ |
| 224 | 224 | protected function sanitizeValue(string $value): string |
| 225 | 225 | { |
| 226 | - if (! $value) { |
|
| 226 | + if (!$value) { |
|
| 227 | 227 | return $value; |
| 228 | 228 | } |
| 229 | 229 | |
@@ -279,7 +279,7 @@ discard block |
||
| 279 | 279 | |
| 280 | 280 | $value = preg_replace_callback( |
| 281 | 281 | '/\${([a-zA-Z0-9_]+)}/', |
| 282 | - static function ($matchedPatterns) use ($loader) { |
|
| 282 | + static function($matchedPatterns) use ($loader) { |
|
| 283 | 283 | $nestedVariable = $loader->getVariable($matchedPatterns[1]); |
| 284 | 284 | |
| 285 | 285 | if (null === $nestedVariable) { |
@@ -125,7 +125,7 @@ discard block |
||
| 125 | 125 | // Enregistrer les variables actuelles |
| 126 | 126 | $renderVars = $this->renderVars; |
| 127 | 127 | |
| 128 | - $output = (function (): string { |
|
| 128 | + $output = (function(): string { |
|
| 129 | 129 | extract($this->tempData); |
| 130 | 130 | ob_start(); |
| 131 | 131 | include $this->renderVars['file']; |
@@ -146,7 +146,7 @@ discard block |
||
| 146 | 146 | |
| 147 | 147 | $this->logPerformance($this->renderVars['start'], microtime(true), $this->renderVars['view']); |
| 148 | 148 | |
| 149 | - if (($this->debug && (! isset($options['debug']) || $options['debug'] === true))) { |
|
| 149 | + if (($this->debug && (!isset($options['debug']) || $options['debug'] === true))) { |
|
| 150 | 150 | // Nettoyer nos noms de chemins pour les rendre un peu plus propres |
| 151 | 151 | $this->renderVars['file'] = clean_path($this->renderVars['file']); |
| 152 | 152 | $this->renderVars['file'] = ++$this->viewsCount . ' ' . $this->renderVars['file']; |
@@ -178,7 +178,7 @@ discard block |
||
| 178 | 178 | $saveData ??= $this->saveData; |
| 179 | 179 | $this->prepareTemplateData($saveData); |
| 180 | 180 | |
| 181 | - $output = (function (string $view): string { |
|
| 181 | + $output = (function(string $view): string { |
|
| 182 | 182 | extract($this->tempData); |
| 183 | 183 | ob_start(); |
| 184 | 184 | eval('?>' . $view); |
@@ -310,7 +310,7 @@ discard block |
||
| 310 | 310 | $section = array_pop($this->sectionStack); |
| 311 | 311 | |
| 312 | 312 | // Assurez-vous qu'un tableau existe afin que nous puissions stocker plusieurs entrées pour cela. |
| 313 | - if (! array_key_exists($section, $this->sections)) { |
|
| 313 | + if (!array_key_exists($section, $this->sections)) { |
|
| 314 | 314 | $this->sections[$section] = []; |
| 315 | 315 | } |
| 316 | 316 | |
@@ -346,7 +346,7 @@ discard block |
||
| 346 | 346 | */ |
| 347 | 347 | public function show(string $sectionName, bool $preserve = false) |
| 348 | 348 | { |
| 349 | - if (! isset($this->sections[$sectionName])) { |
|
| 349 | + if (!isset($this->sections[$sectionName])) { |
|
| 350 | 350 | echo ''; |
| 351 | 351 | |
| 352 | 352 | return; |
@@ -420,7 +420,7 @@ discard block |
||
| 420 | 420 | * |
| 421 | 421 | * @param mixed $saveData |
| 422 | 422 | */ |
| 423 | - public function include(string $view, ?array $data = [], ?array $options = null, $saveData = true): string |
|
| 423 | + public function include(string $view, ?array $data = [], ?array $options = null, $saveData = true) : string |
|
| 424 | 424 | { |
| 425 | 425 | return $this->insert($view, $data, $options, $saveData); |
| 426 | 426 | } |
@@ -431,7 +431,7 @@ discard block |
||
| 431 | 431 | public function addLibCss(string ...$src): self |
| 432 | 432 | { |
| 433 | 433 | foreach ($src as $var) { |
| 434 | - if (! in_array($var, $this->_lib_styles, true)) { |
|
| 434 | + if (!in_array($var, $this->_lib_styles, true)) { |
|
| 435 | 435 | $this->_lib_styles[] = $var; |
| 436 | 436 | } |
| 437 | 437 | } |
@@ -445,7 +445,7 @@ discard block |
||
| 445 | 445 | public function addCss(string ...$src): self |
| 446 | 446 | { |
| 447 | 447 | foreach ($src as $var) { |
| 448 | - if (! in_array($var, $this->_styles, true)) { |
|
| 448 | + if (!in_array($var, $this->_styles, true)) { |
|
| 449 | 449 | $this->_styles[] = $var; |
| 450 | 450 | } |
| 451 | 451 | } |
@@ -474,10 +474,10 @@ discard block |
||
| 474 | 474 | ); |
| 475 | 475 | } |
| 476 | 476 | |
| 477 | - if (! empty($lib_styles)) { |
|
| 477 | + if (!empty($lib_styles)) { |
|
| 478 | 478 | lib_styles(array_unique($lib_styles)); |
| 479 | 479 | } |
| 480 | - if (! empty($styles)) { |
|
| 480 | + if (!empty($styles)) { |
|
| 481 | 481 | styles(array_unique($styles)); |
| 482 | 482 | } |
| 483 | 483 | |
@@ -490,7 +490,7 @@ discard block |
||
| 490 | 490 | public function addLibJs(string ...$src): self |
| 491 | 491 | { |
| 492 | 492 | foreach ($src as $var) { |
| 493 | - if (! in_array($var, $this->_lib_scripts, true)) { |
|
| 493 | + if (!in_array($var, $this->_lib_scripts, true)) { |
|
| 494 | 494 | $this->_lib_scripts[] = $var; |
| 495 | 495 | } |
| 496 | 496 | } |
@@ -504,7 +504,7 @@ discard block |
||
| 504 | 504 | public function addJs(string ...$src): self |
| 505 | 505 | { |
| 506 | 506 | foreach ($src as $var) { |
| 507 | - if (! in_array($var, $this->_scripts, true)) { |
|
| 507 | + if (!in_array($var, $this->_scripts, true)) { |
|
| 508 | 508 | $this->_scripts[] = $var; |
| 509 | 509 | } |
| 510 | 510 | } |
@@ -533,10 +533,10 @@ discard block |
||
| 533 | 533 | ); |
| 534 | 534 | } |
| 535 | 535 | |
| 536 | - if (! empty($lib_scripts)) { |
|
| 536 | + if (!empty($lib_scripts)) { |
|
| 537 | 537 | lib_scripts(array_unique($lib_scripts)); |
| 538 | 538 | } |
| 539 | - if (! empty($scripts)) { |
|
| 539 | + if (!empty($scripts)) { |
|
| 540 | 540 | scripts(array_unique($scripts)); |
| 541 | 541 | } |
| 542 | 542 | |