Skip to content

Commit 031be75

Browse files
committed
cs-fix
1 parent 8acd0ce commit 031be75

10 files changed

Lines changed: 30 additions & 53 deletions

File tree

phpstan-baseline.php

Lines changed: 20 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,12 @@
3131
'count' => 1,
3232
'path' => __DIR__ . '/src/Cli/Console/Command.php',
3333
];
34+
$ignoreErrors[] = [
35+
// identifier: arguments.count
36+
'message' => '#^Method Ahc\\\\Cli\\\\IO\\\\Interactor\\:\\:choice\\(\\) invoked with 4 parameters, 1\\-2 required\\.$#',
37+
'count' => 1,
38+
'path' => __DIR__ . '/src/Cli/Console/Command.php',
39+
];
3440
$ignoreErrors[] = [
3541
// identifier: property.notFound
3642
'message' => '#^Access to an undefined property Ahc\\\\Cli\\\\Output\\\\Writer\\:\\:\\$bold\\.$#',
@@ -98,50 +104,20 @@
98104
'path' => __DIR__ . '/src/Facades/Route.php',
99105
];
100106
$ignoreErrors[] = [
101-
// identifier: return.unusedType
102-
'message' => '#^Function img\\(\\) never returns void so it can be removed from the return type\\.$#',
103-
'count' => 1,
104-
'path' => __DIR__ . '/src/Helpers/assets.php',
105-
];
106-
$ignoreErrors[] = [
107-
// identifier: return.unusedType
108-
'message' => '#^Function less_styles\\(\\) never returns void so it can be removed from the return type\\.$#',
109-
'count' => 1,
110-
'path' => __DIR__ . '/src/Helpers/assets.php',
111-
];
112-
$ignoreErrors[] = [
113-
// identifier: return.unusedType
114-
'message' => '#^Function lib_scripts\\(\\) never returns void so it can be removed from the return type\\.$#',
115-
'count' => 1,
116-
'path' => __DIR__ . '/src/Helpers/assets.php',
117-
];
118-
$ignoreErrors[] = [
119-
// identifier: return.unusedType
120-
'message' => '#^Function lib_styles\\(\\) never returns void so it can be removed from the return type\\.$#',
121-
'count' => 1,
122-
'path' => __DIR__ . '/src/Helpers/assets.php',
123-
];
124-
$ignoreErrors[] = [
125-
// identifier: return.unusedType
126-
'message' => '#^Function scripts\\(\\) never returns void so it can be removed from the return type\\.$#',
107+
// identifier: booleanNot.alwaysFalse
108+
'message' => '#^Negated boolean expression is always false\\.$#',
127109
'count' => 1,
128110
'path' => __DIR__ . '/src/Helpers/assets.php',
129111
];
130112
$ignoreErrors[] = [
131-
// identifier: return.unusedType
132-
'message' => '#^Function styles\\(\\) never returns void so it can be removed from the return type\\.$#',
113+
// identifier: method.nonObject
114+
'message' => '#^Cannot call method regenerate\\(\\) on array\\|bool\\|float\\|int\\|object\\|string\\.$#',
133115
'count' => 1,
134-
'path' => __DIR__ . '/src/Helpers/assets.php',
135-
];
136-
$ignoreErrors[] = [
137-
// identifier: booleanNot.alwaysFalse
138-
'message' => '#^Negated boolean expression is always false\\.$#',
139-
'count' => 1,
140-
'path' => __DIR__ . '/src/Helpers/assets.php',
116+
'path' => __DIR__ . '/src/Helpers/common.php',
141117
];
142118
$ignoreErrors[] = [
143-
// identifier: return.unusedType
144-
'message' => '#^Function logger\\(\\) never returns void so it can be removed from the return type\\.$#',
119+
// identifier: method.nonObject
120+
'message' => '#^Cannot call method token\\(\\) on array\\|bool\\|float\\|int\\|object\\|string\\.$#',
145121
'count' => 1,
146122
'path' => __DIR__ . '/src/Helpers/common.php',
147123
];
@@ -703,6 +679,12 @@
703679
'count' => 1,
704680
'path' => __DIR__ . '/src/Middlewares/BaseMiddleware.php',
705681
];
682+
$ignoreErrors[] = [
683+
// identifier: method.nonObject
684+
'message' => '#^Cannot call method setPreviousUrl\\(\\) on array\\|bool\\|float\\|int\\|object\\|string\\.$#',
685+
'count' => 1,
686+
'path' => __DIR__ . '/src/Router/Dispatcher.php',
687+
];
706688
$ignoreErrors[] = [
707689
// identifier: assign.propertyType
708690
'message' => '#^Property BlitzPHP\\\\Router\\\\Dispatcher\\:\\:\\$request \\(BlitzPHP\\\\Http\\\\Request\\) does not accept Psr\\\\Http\\\\Message\\\\ServerRequestInterface\\.$#',
@@ -712,7 +694,7 @@
712694
$ignoreErrors[] = [
713695
// identifier: assign.propertyType
714696
'message' => '#^Property BlitzPHP\\\\Router\\\\Dispatcher\\:\\:\\$response \\(BlitzPHP\\\\Http\\\\Response\\) does not accept Psr\\\\Http\\\\Message\\\\ResponseInterface\\.$#',
715-
'count' => 4,
697+
'count' => 3,
716698
'path' => __DIR__ . '/src/Router/Dispatcher.php',
717699
];
718700
$ignoreErrors[] = [

src/Cli/Commands/Routes/Routes.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@
1212
namespace BlitzPHP\Cli\Commands\Routes;
1313

1414
use BlitzPHP\Cli\Console\Command;
15-
use BlitzPHP\Container\Services;
1615
use BlitzPHP\Router\DefinedRouteCollector;
1716
use BlitzPHP\Router\Router;
1817
use BlitzPHP\Utilities\Helpers;

src/Cli/Commands/Utilities/Namespaces.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@
1313

1414
use Ahc\Cli\Output\Color;
1515
use BlitzPHP\Cli\Console\Command;
16-
use BlitzPHP\Container\Services;
1716

1817
/**
1918
* Répertorie les namespace dans Config\autoload.php avec le chemin d'accès du serveur complet.

src/Controllers/ApplicationController.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ protected function view(string $view, ?array $data = [], ?array $options = []):
6363
}
6464
}
6565

66-
/** @var \BlitzPHP\View\View */
66+
/** @var View */
6767
$viewer = service('viewer');
6868

6969
$viewer->setData($data)->options($options);

src/Helpers/common.php

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -204,7 +204,7 @@ function command(string $command)
204204
*/
205205
function config(array|string|null $key = null, $default = null)
206206
{
207-
/** @var Config */
207+
/** @var Config */
208208
$config = service('config');
209209

210210
if (null === $key) {
@@ -245,7 +245,7 @@ function config(array|string|null $key = null, $default = null)
245245
*/
246246
function logger($level = null, ?string $message = null, array $context = [])
247247
{
248-
/** @var Logger */
248+
/** @var Logger */
249249
$logger = service('logger');
250250

251251
if (empty($level) || $message === null) {
@@ -268,11 +268,11 @@ function logger($level = null, ?string $message = null, array $context = [])
268268
*
269269
* @param mixed|null $value
270270
*
271-
* @return Cache|bool|mixed
271+
* @return bool|Cache|mixed
272272
*/
273273
function cache(?string $key = null, $value = null)
274274
{
275-
/** @var Cache */
275+
/** @var Cache */
276276
$cache = service('cache');
277277

278278
if ($key === null) {
@@ -301,7 +301,7 @@ function cache(?string $key = null, $value = null)
301301
*/
302302
function cookie(?string $name = null, array|string|null $value = null, int $minutes = 0, array $options = [])
303303
{
304-
/** @var CookieManagerInterface */
304+
/** @var CookieManagerInterface */
305305
$cookie = service('cookie');
306306

307307
if (null === $name) {
@@ -328,7 +328,7 @@ function cookie(?string $name = null, array|string|null $value = null, int $minu
328328
*/
329329
function session(?string $val = null)
330330
{
331-
/** @var Store */
331+
/** @var Store */
332332
$session = service('session');
333333

334334
// Vous retournez un seul element ?

src/Helpers/filesystem.php

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,6 @@
99
* the LICENSE file that was distributed with this source code.
1010
*/
1111

12-
use BlitzPHP\Container\Services;
13-
1412
if (! function_exists('directory_map')) {
1513
/**
1614
* Créer une carte de répertoire

src/Loader/FileLocator.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ public static function helper(array|string $filenames)
3535
{
3636
static $loaded = [];
3737

38-
/** @var LocatorInterface */
38+
/** @var LocatorInterface */
3939
$loader = service('locator');
4040

4141
if (! is_array($filenames)) {

src/Publisher/Publisher.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@ final public static function discover(string $directory = 'Publishers', string $
9999

100100
self::$discovered[$key] = [];
101101

102-
/** @var \BlitzPHP\Contracts\Autoloader\LocatorInterface */
102+
/** @var \BlitzPHP\Contracts\Autoloader\LocatorInterface */
103103
$locator = service('locator');
104104

105105
$files = $namespace === ''

src/Router/RouteCollection.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@
1111

1212
namespace BlitzPHP\Router;
1313

14-
use BlitzPHP\Container\Services;
1514
use BlitzPHP\Contracts\Autoloader\LocatorInterface;
1615
use BlitzPHP\Contracts\Router\RouteCollectionInterface;
1716
use BlitzPHP\Enums\Method;

src/Security/CheckPhpIni.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,7 @@ private static function outputForWeb(array $output, array $thead, array $tbody):
112112
113113
return '<pre>' . $table->generate($tbody) . '</pre>'; */
114114

115-
return '';
115+
return '';
116116
}
117117

118118
/**

0 commit comments

Comments
 (0)