Skip to content

Commit eb44074

Browse files
committed
Apply formatting fixes
1 parent ec2dc1b commit eb44074

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

55 files changed

+188
-90
lines changed

system/CodeIgniter.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -949,7 +949,7 @@ protected function display404errors(PageNotFoundException $e)
949949
if (ob_get_level() > 0) {
950950
ob_end_flush();
951951
}
952-
// @codeCoverageIgnoreEnd
952+
// @codeCoverageIgnoreEnd
953953
}
954954
// When testing, one is for phpunit, another is for test case.
955955
elseif (ob_get_level() > 2) {

system/Commands/Utilities/Routes/AutoRouteCollector.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@ public function __construct(string $namespace, string $defaultController, string
3636

3737
/**
3838
* @return array<int, array<int, string>>
39+
*
3940
* @phpstan-return list<list<string>>
4041
*/
4142
public function get(): array

system/Commands/Utilities/Routes/AutoRouterImproved/AutoRouteCollector.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,7 @@ public function __construct(
5454

5555
/**
5656
* @return array<int, array<int, string>>
57+
*
5758
* @phpstan-return list<list<string>>
5859
*/
5960
public function get(): array

system/Commands/Utilities/Routes/AutoRouterImproved/ControllerMethodReader.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@ public function __construct(string $namespace, array $httpMethods)
4141
* @phpstan-param class-string $class
4242
*
4343
* @return array<int, array<string, array|string>>
44+
*
4445
* @phpstan-return list<array<string, string|array>>
4546
*/
4647
public function read(string $class, string $defaultController = 'Home', string $defaultMethod = 'index'): array

system/Commands/Utilities/Routes/ControllerFinder.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@ public function __construct(string $namespace)
3737

3838
/**
3939
* @return string[]
40+
*
4041
* @phpstan-return class-string[]
4142
*/
4243
public function find(): array

system/Commands/Utilities/Routes/ControllerMethodReader.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@ public function __construct(string $namespace)
3636
* @phpstan-param class-string $class
3737
*
3838
* @return array<int, array{route: string, handler: string}>
39+
*
3940
* @phpstan-return list<array{route: string, handler: string}>
4041
*/
4142
public function read(string $class, string $defaultController = 'Home', string $defaultMethod = 'index'): array

system/Config/BaseService.php

Lines changed: 36 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -92,43 +92,43 @@
9292
* @see http://blog.ircmaxell.com/2015/11/simple-easy-risk-and-change.html
9393
* @see http://www.infoq.com/presentations/Simple-Made-Easy
9494
*
95-
* @method static CacheInterface cache(Cache $config = null, $getShared = true)
96-
* @method static CLIRequest clirequest(App $config = null, $getShared = true)
97-
* @method static CodeIgniter codeigniter(App $config = null, $getShared = true)
98-
* @method static Commands commands($getShared = true)
99-
* @method static void createRequest(App $config, bool $isCli = false)
100-
* @method static ContentSecurityPolicy csp(CSPConfig $config = null, $getShared = true)
101-
* @method static CURLRequest curlrequest($options = [], ResponseInterface $response = null, App $config = null, $getShared = true)
102-
* @method static Email email($config = null, $getShared = true)
103-
* @method static EncrypterInterface encrypter(Encryption $config = null, $getShared = false)
104-
* @method static Exceptions exceptions(ConfigExceptions $config = null, IncomingRequest $request = null, Response $response = null, $getShared = true)
105-
* @method static Filters filters(ConfigFilters $config = null, $getShared = true)
106-
* @method static Format format(ConfigFormat $config = null, $getShared = true)
107-
* @method static Honeypot honeypot(ConfigHoneyPot $config = null, $getShared = true)
108-
* @method static BaseHandler image($handler = null, Images $config = null, $getShared = true)
109-
* @method static IncomingRequest incomingrequest(?App $config = null, bool $getShared = true)
110-
* @method static Iterator iterator($getShared = true)
111-
* @method static Language language($locale = null, $getShared = true)
112-
* @method static Logger logger($getShared = true)
113-
* @method static MigrationRunner migrations(Migrations $config = null, ConnectionInterface $db = null, $getShared = true)
114-
* @method static Negotiate negotiator(RequestInterface $request = null, $getShared = true)
115-
* @method static Pager pager(ConfigPager $config = null, RendererInterface $view = null, $getShared = true)
116-
* @method static Parser parser($viewPath = null, ConfigView $config = null, $getShared = true)
117-
* @method static RedirectResponse redirectresponse(App $config = null, $getShared = true)
118-
* @method static View renderer($viewPath = null, ConfigView $config = null, $getShared = true)
95+
* @method static CacheInterface cache(Cache $config = null, $getShared = true)
96+
* @method static CLIRequest clirequest(App $config = null, $getShared = true)
97+
* @method static CodeIgniter codeigniter(App $config = null, $getShared = true)
98+
* @method static Commands commands($getShared = true)
99+
* @method static void createRequest(App $config, bool $isCli = false)
100+
* @method static ContentSecurityPolicy csp(CSPConfig $config = null, $getShared = true)
101+
* @method static CURLRequest curlrequest($options = [], ResponseInterface $response = null, App $config = null, $getShared = true)
102+
* @method static Email email($config = null, $getShared = true)
103+
* @method static EncrypterInterface encrypter(Encryption $config = null, $getShared = false)
104+
* @method static Exceptions exceptions(ConfigExceptions $config = null, IncomingRequest $request = null, Response $response = null, $getShared = true)
105+
* @method static Filters filters(ConfigFilters $config = null, $getShared = true)
106+
* @method static Format format(ConfigFormat $config = null, $getShared = true)
107+
* @method static Honeypot honeypot(ConfigHoneyPot $config = null, $getShared = true)
108+
* @method static BaseHandler image($handler = null, Images $config = null, $getShared = true)
109+
* @method static IncomingRequest incomingrequest(?App $config = null, bool $getShared = true)
110+
* @method static Iterator iterator($getShared = true)
111+
* @method static Language language($locale = null, $getShared = true)
112+
* @method static Logger logger($getShared = true)
113+
* @method static MigrationRunner migrations(Migrations $config = null, ConnectionInterface $db = null, $getShared = true)
114+
* @method static Negotiate negotiator(RequestInterface $request = null, $getShared = true)
115+
* @method static Pager pager(ConfigPager $config = null, RendererInterface $view = null, $getShared = true)
116+
* @method static Parser parser($viewPath = null, ConfigView $config = null, $getShared = true)
117+
* @method static RedirectResponse redirectresponse(App $config = null, $getShared = true)
118+
* @method static View renderer($viewPath = null, ConfigView $config = null, $getShared = true)
119119
* @method static IncomingRequest|CLIRequest request(App $config = null, $getShared = true)
120-
* @method static Response response(App $config = null, $getShared = true)
121-
* @method static Router router(RouteCollectionInterface $routes = null, Request $request = null, $getShared = true)
122-
* @method static RouteCollection routes($getShared = true)
123-
* @method static Security security(App $config = null, $getShared = true)
124-
* @method static Session session(App $config = null, $getShared = true)
125-
* @method static Throttler throttler($getShared = true)
126-
* @method static Timer timer($getShared = true)
127-
* @method static Toolbar toolbar(ConfigToolbar $config = null, $getShared = true)
128-
* @method static Typography typography($getShared = true)
129-
* @method static URI uri($uri = null, $getShared = true)
130-
* @method static Validation validation(ConfigValidation $config = null, $getShared = true)
131-
* @method static Cell viewcell($getShared = true)
120+
* @method static Response response(App $config = null, $getShared = true)
121+
* @method static Router router(RouteCollectionInterface $routes = null, Request $request = null, $getShared = true)
122+
* @method static RouteCollection routes($getShared = true)
123+
* @method static Security security(App $config = null, $getShared = true)
124+
* @method static Session session(App $config = null, $getShared = true)
125+
* @method static Throttler throttler($getShared = true)
126+
* @method static Timer timer($getShared = true)
127+
* @method static Toolbar toolbar(ConfigToolbar $config = null, $getShared = true)
128+
* @method static Typography typography($getShared = true)
129+
* @method static URI uri($uri = null, $getShared = true)
130+
* @method static Validation validation(ConfigValidation $config = null, $getShared = true)
131+
* @method static Cell viewcell($getShared = true)
132132
*/
133133
class BaseService
134134
{

system/Database/BaseBuilder.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1928,6 +1928,7 @@ public function insert($set = null, ?bool $escape = null)
19281928
* @internal This is a temporary solution.
19291929
*
19301930
* @see https://github.com/codeigniter4/CodeIgniter4/pull/5376
1931+
*
19311932
* @TODO Fix a root cause, and this method should be removed.
19321933
*/
19331934
protected function removeAlias(string $from): string

system/Database/BaseConnection.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -995,6 +995,7 @@ public function getConnectDuration(int $decimals = 6): string
995995
* @param bool $fieldExists Supplied $item contains a column name?
996996
*
997997
* @return array|string
998+
*
998999
* @phpstan-return ($item is array ? array : string)
9991000
*/
10001001
public function protectIdentifiers($item, bool $prefixSingle = false, ?bool $protectIdentifiers = null, bool $fieldExists = true)
@@ -1597,6 +1598,7 @@ public function isWriteType($sql): bool
15971598
* Must return an array with keys 'code' and 'message':
15981599
*
15991600
* @return array<string, int|string|null>
1601+
*
16001602
* @phpstan-return array{code: int|string|null, message: string|null}
16011603
*/
16021604
abstract public function error(): array;

system/Database/SQLSRV/Forge.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,6 @@ protected function _createTableAttributes(array $attributes): string
125125
*/
126126
protected function _alterTable(string $alterType, string $table, $field)
127127
{
128-
129128
// Handle DROP here
130129
if ($alterType === 'DROP') {
131130
// check if fields are part of any indexes

system/Database/SQLite3/Table.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ class Table
2828
* All of the fields this table represents.
2929
*
3030
* @var array
31+
*
3132
* @phpstan-var array<string, array<string, bool|int|string|null>>
3233
*/
3334
protected $fields = [];
@@ -305,6 +306,7 @@ protected function copyData()
305306
* @param array|bool $fields
306307
*
307308
* @return mixed
309+
*
308310
* @phpstan-return ($fields is array ? array : mixed)
309311
*/
310312
protected function formatFields($fields)

system/Entity/Entity.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -471,6 +471,7 @@ public function __set(string $key, $value = null)
471471
* $p = $this->getMyProperty()
472472
*
473473
* @throws Exception
474+
*
474475
* @params string $key class property
475476
*
476477
* @return array|bool|float|int|object|string|null

system/I18n/Time.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -285,6 +285,7 @@ public static function createFromInstance(DateTimeInterface $dateTime, ?string $
285285
* @return Time
286286
*
287287
* @deprecated Use createFromInstance() instead
288+
*
288289
* @codeCoverageIgnore
289290
*/
290291
public static function instance(DateTime $dateTime, ?string $locale = null)

system/Router/Router.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -459,7 +459,7 @@ protected function checkRoutes(string $uri): bool
459459
return true;
460460
}
461461

462-
[$controller, ] = explode('::', $handler);
462+
[$controller] = explode('::', $handler);
463463

464464
// Checks `/` in controller name
465465
if (strpos($controller, '/') !== false) {

tests/AutoReview/ComposerJsonTest.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@
2020
* @internal
2121
*
2222
* @coversNothing
23+
*
2324
* @group auto-review
2425
*/
2526
final class ComposerJsonTest extends TestCase

tests/system/API/ResponseTraitTest.php

Lines changed: 25 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -43,19 +43,19 @@ protected function makeController(array $userConfig = [], string $uri = 'http://
4343
$config = new App();
4444

4545
foreach ([
46-
'baseURL' => 'http://example.com/',
47-
'uriProtocol' => 'REQUEST_URI',
48-
'defaultLocale' => 'en',
49-
'negotiateLocale' => false,
46+
'baseURL' => 'http://example.com/',
47+
'uriProtocol' => 'REQUEST_URI',
48+
'defaultLocale' => 'en',
49+
'negotiateLocale' => false,
5050
'supportedLocales' => ['en'],
51-
'CSPEnabled' => false,
52-
'cookiePrefix' => '',
53-
'cookieDomain' => '',
54-
'cookiePath' => '/',
55-
'cookieSecure' => false,
56-
'cookieHTTPOnly' => false,
57-
'proxyIPs' => [],
58-
'cookieSameSite' => 'Lax',
51+
'CSPEnabled' => false,
52+
'cookiePrefix' => '',
53+
'cookieDomain' => '',
54+
'cookiePath' => '/',
55+
'cookieSecure' => false,
56+
'cookieHTTPOnly' => false,
57+
'proxyIPs' => [],
58+
'cookieSameSite' => 'Lax',
5959
] as $key => $value) {
6060
$config->{$key} = $value;
6161
}
@@ -79,7 +79,7 @@ protected function makeController(array $userConfig = [], string $uri = 'http://
7979
}
8080

8181
// Create the controller class finally.
82-
$controller = new class ($this->request, $this->response, $this->formatter) {
82+
return new class ($this->request, $this->response, $this->formatter) {
8383
use ResponseTrait;
8484

8585
protected $request;
@@ -98,8 +98,6 @@ public function resetFormatter()
9898
$this->formatter = null;
9999
}
100100
};
101-
102-
return $controller;
103101
}
104102

105103
public function testNoFormatterJSON()
@@ -518,19 +516,19 @@ public function testFormatByRequestNegotiateIfFormatIsNotJsonOrXML()
518516
$config = new App();
519517

520518
foreach ([
521-
'baseURL' => 'http://example.com/',
522-
'uriProtocol' => 'REQUEST_URI',
523-
'defaultLocale' => 'en',
524-
'negotiateLocale' => false,
519+
'baseURL' => 'http://example.com/',
520+
'uriProtocol' => 'REQUEST_URI',
521+
'defaultLocale' => 'en',
522+
'negotiateLocale' => false,
525523
'supportedLocales' => ['en'],
526-
'CSPEnabled' => false,
527-
'cookiePrefix' => '',
528-
'cookieDomain' => '',
529-
'cookiePath' => '/',
530-
'cookieSecure' => false,
531-
'cookieHTTPOnly' => false,
532-
'proxyIPs' => [],
533-
'cookieSameSite' => 'Lax',
524+
'CSPEnabled' => false,
525+
'cookiePrefix' => '',
526+
'cookieDomain' => '',
527+
'cookiePath' => '/',
528+
'cookieSecure' => false,
529+
'cookieHTTPOnly' => false,
530+
'proxyIPs' => [],
531+
'cookieSameSite' => 'Lax',
534532
] as $key => $value) {
535533
$config->{$key} = $value;
536534
}

tests/system/CodeIgniterTest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -177,7 +177,7 @@ public function testControllersCanReturnResponseObject()
177177
$routes = Services::routes();
178178
$routes->add('pages/(:segment)', static function ($segment) {
179179
$response = Services::response();
180-
$string = "You want to see 'about' page.";
180+
$string = "You want to see 'about' page.";
181181

182182
return $response->setBody($string);
183183
});
@@ -583,7 +583,7 @@ public function testPageCacheSendSecureHeaders()
583583
CodeIgniter::cache(3600);
584584

585585
$response = Services::response();
586-
$string = 'This is a test page. Elapsed time: {elapsed_time}';
586+
$string = 'This is a test page. Elapsed time: {elapsed_time}';
587587

588588
return $response->setBody($string);
589589
});

tests/system/Commands/GenerateKeyTest.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,7 @@ public function testGenerateKeyShowsEncodedKey()
8686

8787
/**
8888
* @runInSeparateProcess
89+
*
8990
* @preserveGlobalState disabled
9091
*/
9192
public function testGenerateKeyCreatesNewKey()

tests/system/CommonFunctionsSendTest.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ protected function setUp(): void
3232
* See https://github.com/codeigniter4/CodeIgniter4/issues/1393
3333
*
3434
* @runInSeparateProcess
35+
*
3536
* @preserveGlobalState disabled
3637
*/
3738
public function testRedirectResponseCookiesSent()

tests/system/CommonFunctionsTest.php

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -179,6 +179,7 @@ public function testEscapeBadContext()
179179

180180
/**
181181
* @runInSeparateProcess
182+
*
182183
* @preserveGlobalState disabled
183184
*/
184185
public function testSessionInstance()
@@ -190,6 +191,7 @@ public function testSessionInstance()
190191

191192
/**
192193
* @runInSeparateProcess
194+
*
193195
* @preserveGlobalState disabled
194196
*/
195197
public function testSessionVariable()
@@ -203,6 +205,7 @@ public function testSessionVariable()
203205

204206
/**
205207
* @runInSeparateProcess
208+
*
206209
* @preserveGlobalState disabled
207210
*/
208211
public function testSessionVariableNotThere()
@@ -286,6 +289,7 @@ public function testModelExistsAbsoluteClassname()
286289

287290
/**
288291
* @runInSeparateProcess
292+
*
289293
* @preserveGlobalState disabled
290294
*/
291295
public function testOldInput()
@@ -321,6 +325,7 @@ public function testOldInput()
321325

322326
/**
323327
* @runInSeparateProcess
328+
*
324329
* @preserveGlobalState disabled
325330
*/
326331
public function testOldInputSerializeData()
@@ -354,7 +359,9 @@ public function testOldInputSerializeData()
354359

355360
/**
356361
* @see https://github.com/codeigniter4/CodeIgniter4/issues/1492
362+
*
357363
* @runInSeparateProcess
364+
*
358365
* @preserveGlobalState disabled
359366
*/
360367
public function testOldInputArray()
@@ -468,6 +475,7 @@ public function testRedirectResponseCookies1()
468475

469476
/**
470477
* @runInSeparateProcess
478+
*
471479
* @preserveGlobalState disabled
472480
*/
473481
public function testTrace()
@@ -491,6 +499,7 @@ public function testViewNotSaveData()
491499

492500
/**
493501
* @runInSeparateProcess
502+
*
494503
* @preserveGlobalState disabled
495504
*/
496505
public function testForceHttpsNullRequestAndResponse()
@@ -571,6 +580,7 @@ public function testDWithCSP()
571580

572581
/**
573582
* @runInSeparateProcess
583+
*
574584
* @preserveGlobalState disabled
575585
*/
576586
public function testTraceWithCSP()

0 commit comments

Comments
 (0)