Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/develop' into 4.6
Browse files Browse the repository at this point in the history
  • Loading branch information
kenjis committed Apr 18, 2024
2 parents f5dda90 + c66cae8 commit 6beeb33
Show file tree
Hide file tree
Showing 16 changed files with 57 additions and 78 deletions.
23 changes: 11 additions & 12 deletions .php-cs-fixer.dist.php
Original file line number Diff line number Diff line change
Expand Up @@ -40,23 +40,22 @@
__DIR__ . '/spark',
]);

$overrides = [];
$overrides = [
// for updating to coding-standard
'modernize_strpos' => true,
];

$options = [
'cacheFile' => 'build/.php-cs-fixer.cache',
'finder' => $finder,
'cacheFile' => 'build/.php-cs-fixer.cache',
'finder' => $finder,
'customFixers' => FixerGenerator::create('vendor/nexusphp/cs-config/src/Fixer', 'Nexus\\CsConfig\\Fixer'),
'customRules' => [
NoCodeSeparatorCommentFixer::name() => true,
],
];

$config = Factory::create(new CodeIgniter4(), $overrides, $options)->forLibrary(
return Factory::create(new CodeIgniter4(), $overrides, $options)->forLibrary(
'CodeIgniter 4 framework',
'CodeIgniter Foundation',
'[email protected]'
);

$config
->registerCustomFixers(FixerGenerator::create('vendor/nexusphp/cs-config/src/Fixer', 'Nexus\\CsConfig\\Fixer'))
->setRules(array_merge($config->getRules(), [
NoCodeSeparatorCommentFixer::name() => true,
]));

return $config;
23 changes: 11 additions & 12 deletions .php-cs-fixer.no-header.php
Original file line number Diff line number Diff line change
Expand Up @@ -29,19 +29,18 @@
__DIR__ . '/admin/starter/builds',
]);

$overrides = [];

$options = [
'cacheFile' => 'build/.php-cs-fixer.no-header.cache',
'finder' => $finder,
$overrides = [
// for updating to coding-standard
'modernize_strpos' => true,
];

$config = Factory::create(new CodeIgniter4(), $overrides, $options)->forProjects();

$config
->registerCustomFixers(FixerGenerator::create('vendor/nexusphp/cs-config/src/Fixer', 'Nexus\\CsConfig\\Fixer'))
->setRules(array_merge($config->getRules(), [
$options = [
'cacheFile' => 'build/.php-cs-fixer.no-header.cache',
'finder' => $finder,
'customFixers' => FixerGenerator::create('vendor/nexusphp/cs-config/src/Fixer', 'Nexus\\CsConfig\\Fixer'),
'customRules' => [
NoCodeSeparatorCommentFixer::name() => true,
]));
],
];

return $config;
return Factory::create(new CodeIgniter4(), $overrides, $options)->forProjects();
20 changes: 9 additions & 11 deletions .php-cs-fixer.tests.php
Original file line number Diff line number Diff line change
Expand Up @@ -35,23 +35,21 @@

$overrides = [
'void_return' => true,
// for updating to coding-standard
'modernize_strpos' => true,
];

$options = [
'cacheFile' => 'build/.php-cs-fixer.tests.cache',
'finder' => $finder,
'cacheFile' => 'build/.php-cs-fixer.tests.cache',
'finder' => $finder,
'customFixers' => FixerGenerator::create('vendor/nexusphp/cs-config/src/Fixer', 'Nexus\\CsConfig\\Fixer'),
'customRules' => [
NoCodeSeparatorCommentFixer::name() => true,
],
];

$config = Factory::create(new CodeIgniter4(), $overrides, $options)->forLibrary(
return Factory::create(new CodeIgniter4(), $overrides, $options)->forLibrary(
'CodeIgniter 4 framework',
'CodeIgniter Foundation',
'[email protected]'
);

$config
->registerCustomFixers(FixerGenerator::create('vendor/nexusphp/cs-config/src/Fixer', 'Nexus\\CsConfig\\Fixer'))
->setRules(array_merge($config->getRules(), [
NoCodeSeparatorCommentFixer::name() => true,
]));

return $config;
20 changes: 9 additions & 11 deletions .php-cs-fixer.user-guide.php
Original file line number Diff line number Diff line change
Expand Up @@ -39,19 +39,17 @@
'import_symbols' => false,
'leading_backslash_in_global_namespace' => true,
],
// for updating to coding-standard
'modernize_strpos' => true,
];

$options = [
'cacheFile' => 'build/.php-cs-fixer.user-guide.cache',
'finder' => $finder,
];

$config = Factory::create(new CodeIgniter4(), $overrides, $options)->forProjects();

$config
->registerCustomFixers(FixerGenerator::create('vendor/nexusphp/cs-config/src/Fixer', 'Nexus\\CsConfig\\Fixer'))
->setRules(array_merge($config->getRules(), [
'cacheFile' => 'build/.php-cs-fixer.user-guide.cache',
'finder' => $finder,
'customFixers' => FixerGenerator::create('vendor/nexusphp/cs-config/src/Fixer', 'Nexus\\CsConfig\\Fixer'),
'customRules' => [
NoCodeSeparatorCommentFixer::name() => true,
]));
],
];

return $config;
return Factory::create(new CodeIgniter4(), $overrides, $options)->forProjects();
25 changes: 0 additions & 25 deletions phpstan-baseline.php
Original file line number Diff line number Diff line change
Expand Up @@ -3001,11 +3001,6 @@
'count' => 11,
'path' => __DIR__ . '/system/Database/MySQLi/Connection.php',
];
$ignoreErrors[] = [
'message' => '#^Method CodeIgniter\\\\Database\\\\MySQLi\\\\Connection\\:\\:_close\\(\\) should return mixed but return statement is missing\\.$#',
'count' => 1,
'path' => __DIR__ . '/system/Database/MySQLi/Connection.php',
];
$ignoreErrors[] = [
'message' => '#^Only booleans are allowed in &&, int given on the left side\\.$#',
'count' => 1,
Expand Down Expand Up @@ -3391,11 +3386,6 @@
'count' => 2,
'path' => __DIR__ . '/system/Database/Postgre/Connection.php',
];
$ignoreErrors[] = [
'message' => '#^Method CodeIgniter\\\\Database\\\\Postgre\\\\Connection\\:\\:_close\\(\\) should return mixed but return statement is missing\\.$#',
'count' => 1,
'path' => __DIR__ . '/system/Database/Postgre/Connection.php',
];
$ignoreErrors[] = [
'message' => '#^Method CodeIgniter\\\\Database\\\\Postgre\\\\Connection\\:\\:buildDSN\\(\\) has no return type specified\\.$#',
'count' => 1,
Expand Down Expand Up @@ -3756,11 +3746,6 @@
'count' => 1,
'path' => __DIR__ . '/system/Database/SQLSRV/Connection.php',
];
$ignoreErrors[] = [
'message' => '#^Method CodeIgniter\\\\Database\\\\SQLSRV\\\\Connection\\:\\:_close\\(\\) should return mixed but return statement is missing\\.$#',
'count' => 1,
'path' => __DIR__ . '/system/Database/SQLSRV/Connection.php',
];
$ignoreErrors[] = [
'message' => '#^PHPDoc type string of property CodeIgniter\\\\Database\\\\SQLSRV\\\\Connection\\:\\:\\$escapeChar is not the same as PHPDoc type array\\|string of overridden property CodeIgniter\\\\Database\\\\BaseConnection\\<resource,resource\\>\\:\\:\\$escapeChar\\.$#',
'count' => 1,
Expand Down Expand Up @@ -3951,11 +3936,6 @@
'count' => 1,
'path' => __DIR__ . '/system/Database/SQLite3/Connection.php',
];
$ignoreErrors[] = [
'message' => '#^Method CodeIgniter\\\\Database\\\\SQLite3\\\\Connection\\:\\:_close\\(\\) should return mixed but return statement is missing\\.$#',
'count' => 1,
'path' => __DIR__ . '/system/Database/SQLite3/Connection.php',
];
$ignoreErrors[] = [
'message' => '#^Method CodeIgniter\\\\Database\\\\SQLite3\\\\Connection\\:\\:getFieldNames\\(\\) return type has no value type specified in iterable type array\\.$#',
'count' => 1,
Expand Down Expand Up @@ -8661,11 +8641,6 @@
'count' => 1,
'path' => __DIR__ . '/system/Test/Mock/MockConnection.php',
];
$ignoreErrors[] = [
'message' => '#^Method CodeIgniter\\\\Test\\\\Mock\\\\MockConnection\\:\\:_close\\(\\) should return mixed but return statement is missing\\.$#',
'count' => 1,
'path' => __DIR__ . '/system/Test/Mock/MockConnection.php',
];
$ignoreErrors[] = [
'message' => '#^Method CodeIgniter\\\\Test\\\\Mock\\\\MockConnection\\:\\:_fieldData\\(\\) return type has no value type specified in iterable type array\\.$#',
'count' => 1,
Expand Down
2 changes: 1 addition & 1 deletion spark
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
*/

// Refuse to run when called from php-cgi
if (strpos(PHP_SAPI, 'cgi') === 0) {
if (str_starts_with(PHP_SAPI, 'cgi')) {
exit("The cli tool is not supported when running php-cgi. It needs php-cli to function!\n\n");
}

Expand Down
2 changes: 1 addition & 1 deletion system/Database/BaseConnection.php
Original file line number Diff line number Diff line change
Expand Up @@ -479,7 +479,7 @@ public function close()
/**
* Platform dependent way method for closing the connection.
*
* @return mixed
* @return void
*/
abstract protected function _close();

Expand Down
2 changes: 2 additions & 0 deletions system/Database/MySQLi/Connection.php
Original file line number Diff line number Diff line change
Expand Up @@ -246,6 +246,8 @@ public function reconnect()

/**
* Close the database connection.
*
* @return void
*/
protected function _close()
{
Expand Down
2 changes: 2 additions & 0 deletions system/Database/Postgre/Connection.php
Original file line number Diff line number Diff line change
Expand Up @@ -146,6 +146,8 @@ public function reconnect()

/**
* Close the database connection.
*
* @return void
*/
protected function _close()
{
Expand Down
2 changes: 2 additions & 0 deletions system/Database/SQLSRV/Connection.php
Original file line number Diff line number Diff line change
Expand Up @@ -173,6 +173,8 @@ public function reconnect()

/**
* Close the database connection.
*
* @return void
*/
protected function _close()
{
Expand Down
2 changes: 2 additions & 0 deletions system/Database/SQLite3/Connection.php
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,8 @@ public function reconnect()

/**
* Close the database connection.
*
* @return void
*/
protected function _close()
{
Expand Down
2 changes: 2 additions & 0 deletions system/Test/Mock/MockConnection.php
Original file line number Diff line number Diff line change
Expand Up @@ -220,6 +220,8 @@ protected function _foreignKeyData(string $table): array

/**
* Close the connection.
*
* @return void
*/
protected function _close()
{
Expand Down
2 changes: 1 addition & 1 deletion user_guide_src/source/libraries/curlrequest/012.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?php

if (strpos($response->header('content-type'), 'application/json') !== false) {
if (str_contains($response->header('content-type'), 'application/json')) {
$body = json_decode($body);
}
4 changes: 2 additions & 2 deletions user_guide_src/source/outgoing/response.rst
Original file line number Diff line number Diff line change
Expand Up @@ -234,7 +234,7 @@ Built into the HTTP specification are tools help the client (often the web brows
this can lead to a huge performance boost to your application because it will tell the client that they don't need
to contact the server at all since nothing has changed. And you can't get faster than that.

This are handled through the ``Cache-Control`` and ``ETag`` headers. This guide is not the proper place for a thorough
This is handled through the ``Cache-Control`` and ``ETag`` headers. This guide is not the proper place for a thorough
introduction to all of the cache headers power, but you can get a good understanding over at
`Google Developers <https://developers.google.com/web/fundamentals/performance/optimizing-content-efficiency/http-caching>`_.

Expand All @@ -255,7 +255,7 @@ Class Reference
.. note:: In addition to the methods listed here, this class inherits the methods from the
:doc:`Message Class </incoming/message>`.

The methods provided by the parent class that are available are:
The methods inherited from the Message Class are:

* :meth:`CodeIgniter\\HTTP\\Message::body`
* :meth:`CodeIgniter\\HTTP\\Message::setBody`
Expand Down
2 changes: 1 addition & 1 deletion user_guide_src/source/outgoing/table.rst
Original file line number Diff line number Diff line change
Expand Up @@ -210,7 +210,7 @@ Class Reference

Lets you clear the table heading, row data and caption. If
you need to show multiple tables with different data you
should to call this method after each table has been
should call this method after each table has been
generated to clear the previous table information.

Example
Expand Down
2 changes: 1 addition & 1 deletion user_guide_src/source/outgoing/view_parser.rst
Original file line number Diff line number Diff line change
Expand Up @@ -495,7 +495,7 @@ You can also use closures, but these can only be defined in the config file's co

.. literalinclude:: view_parser/015.php

If the callable is on its own, it is treated as a single tag, not a open/close one. It will be replaced by
If the callable is on its own, it is treated as a single tag, not an open/close one. It will be replaced by
the return value from the plugin:

.. literalinclude:: view_parser/016.php
Expand Down

0 comments on commit 6beeb33

Please sign in to comment.