Skip to content

Commit 7b2ad9c

Browse files
authored
Merge pull request #6471 from paulbalandan/cs-fixer
Bump `friendsofphp/php-cs-fixer` to `~3.11.0`
2 parents 9cbe0a2 + 4369d20 commit 7b2ad9c

Some content is hidden

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

56 files changed

+227
-102
lines changed

.php-cs-fixer.dist.php

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@
1414
use CodeIgniter\CodingStandard\CodeIgniter4;
1515
use Nexus\CsConfig\Factory;
1616
use Nexus\CsConfig\Fixer\Comment\NoCodeSeparatorCommentFixer;
17-
use Nexus\CsConfig\Fixer\Comment\SpaceAfterCommentStartFixer;
1817
use Nexus\CsConfig\FixerGenerator;
1918
use PhpCsFixer\Finder;
2019

@@ -39,15 +38,28 @@
3938
__DIR__ . '/spark',
4039
]);
4140

42-
$overrides = [];
41+
$overrides = [
42+
'phpdoc_separation' => [
43+
'groups' => [
44+
['immutable', 'psalm-immutable'],
45+
['param', 'phpstan-param', 'psalm-param'],
46+
['phpstan-pure', 'psalm-pure'],
47+
['readonly', 'psalm-readonly'],
48+
['return', 'phpstan-return', 'psalm-return'],
49+
['template', 'phpstan-template', 'psalm-template'],
50+
['template-covariant', 'phpstan-template-covariant', 'psalm-template-covariant'],
51+
['phpstan-type', 'psalm-type'],
52+
['var', 'phpstan-var', 'psalm-var'],
53+
],
54+
],
55+
];
4356

4457
$options = [
4558
'cacheFile' => 'build/.php-cs-fixer.cache',
4659
'finder' => $finder,
4760
'customFixers' => FixerGenerator::create('vendor/nexusphp/cs-config/src/Fixer', 'Nexus\\CsConfig\\Fixer'),
4861
'customRules' => [
4962
NoCodeSeparatorCommentFixer::name() => true,
50-
SpaceAfterCommentStartFixer::name() => true,
5163
],
5264
];
5365

.php-cs-fixer.no-header.php

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@
1414
use CodeIgniter\CodingStandard\CodeIgniter4;
1515
use Nexus\CsConfig\Factory;
1616
use Nexus\CsConfig\Fixer\Comment\NoCodeSeparatorCommentFixer;
17-
use Nexus\CsConfig\Fixer\Comment\SpaceAfterCommentStartFixer;
1817
use Nexus\CsConfig\FixerGenerator;
1918
use PhpCsFixer\Finder;
2019

@@ -31,15 +30,28 @@
3130
__DIR__ . '/admin/starter/builds',
3231
]);
3332

34-
$overrides = [];
33+
$overrides = [
34+
'phpdoc_separation' => [
35+
'groups' => [
36+
['immutable', 'psalm-immutable'],
37+
['param', 'phpstan-param', 'psalm-param'],
38+
['phpstan-pure', 'psalm-pure'],
39+
['readonly', 'psalm-readonly'],
40+
['return', 'phpstan-return', 'psalm-return'],
41+
['template', 'phpstan-template', 'psalm-template'],
42+
['template-covariant', 'phpstan-template-covariant', 'psalm-template-covariant'],
43+
['phpstan-type', 'psalm-type'],
44+
['var', 'phpstan-var', 'psalm-var'],
45+
],
46+
],
47+
];
3548

3649
$options = [
3750
'cacheFile' => 'build/.php-cs-fixer.no-header.cache',
3851
'finder' => $finder,
3952
'customFixers' => FixerGenerator::create('vendor/nexusphp/cs-config/src/Fixer', 'Nexus\\CsConfig\\Fixer'),
4053
'customRules' => [
4154
NoCodeSeparatorCommentFixer::name() => true,
42-
SpaceAfterCommentStartFixer::name() => true,
4355
],
4456
];
4557

.php-cs-fixer.user-guide.php

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@
1414
use CodeIgniter\CodingStandard\CodeIgniter4;
1515
use Nexus\CsConfig\Factory;
1616
use Nexus\CsConfig\Fixer\Comment\NoCodeSeparatorCommentFixer;
17-
use Nexus\CsConfig\Fixer\Comment\SpaceAfterCommentStartFixer;
1817
use Nexus\CsConfig\FixerGenerator;
1918
use PhpCsFixer\Finder;
2019

@@ -34,6 +33,19 @@
3433
'php_unit_internal_class' => false,
3534
'no_unused_imports' => false,
3635
'class_attributes_separation' => false,
36+
'phpdoc_separation' => [
37+
'groups' => [
38+
['immutable', 'psalm-immutable'],
39+
['param', 'phpstan-param', 'psalm-param'],
40+
['phpstan-pure', 'psalm-pure'],
41+
['readonly', 'psalm-readonly'],
42+
['return', 'phpstan-return', 'psalm-return'],
43+
['template', 'phpstan-template', 'psalm-template'],
44+
['template-covariant', 'phpstan-template-covariant', 'psalm-template-covariant'],
45+
['phpstan-type', 'psalm-type'],
46+
['var', 'phpstan-var', 'psalm-var'],
47+
],
48+
],
3749
];
3850

3951
$options = [
@@ -42,7 +54,6 @@
4254
'customFixers' => FixerGenerator::create('vendor/nexusphp/cs-config/src/Fixer', 'Nexus\\CsConfig\\Fixer'),
4355
'customRules' => [
4456
NoCodeSeparatorCommentFixer::name() => true,
45-
SpaceAfterCommentStartFixer::name() => true,
4657
],
4758
];
4859

admin/framework/composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
"require-dev": {
1818
"codeigniter/coding-standard": "^1.1",
1919
"fakerphp/faker": "^1.9",
20-
"friendsofphp/php-cs-fixer": "3.6.*",
20+
"friendsofphp/php-cs-fixer": "~3.11.0",
2121
"mikey179/vfsstream": "^1.6",
2222
"nexusphp/cs-config": "^3.3",
2323
"phpunit/phpunit": "^9.1",

app/Config/App.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -437,6 +437,7 @@ class App extends BaseConfig
437437
* Defaults to `Lax` as recommended in this link:
438438
*
439439
* @see https://portswigger.net/web-security/csrf/samesite-cookies
440+
*
440441
* @deprecated `Config\Cookie` $samesite property is used.
441442
*
442443
* @var string

composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
"require-dev": {
1818
"codeigniter/coding-standard": "^1.1",
1919
"fakerphp/faker": "^1.9",
20-
"friendsofphp/php-cs-fixer": "3.6.*",
20+
"friendsofphp/php-cs-fixer": "~3.11.0",
2121
"mikey179/vfsstream": "^1.6",
2222
"nexusphp/cs-config": "^3.3",
2323
"nexusphp/tachycardia": "^1.0",

system/CodeIgniter.php

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -945,11 +945,9 @@ protected function display404errors(PageNotFoundException $e)
945945
$this->response->setStatusCode($e->getCode());
946946

947947
if (ENVIRONMENT !== 'testing') {
948-
// @codeCoverageIgnoreStart
949948
if (ob_get_level() > 0) {
950-
ob_end_flush();
949+
ob_end_flush(); // @codeCoverageIgnore
951950
}
952-
// @codeCoverageIgnoreEnd
953951
}
954952
// When testing, one is for phpunit, another is for test case.
955953
elseif (ob_get_level() > 2) {

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/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

0 commit comments

Comments
 (0)