diff --git a/.php-cs-fixer.dist.php b/.php-cs-fixer.dist.php index 37093e287e13..9f89d3159fe1 100644 --- a/.php-cs-fixer.dist.php +++ b/.php-cs-fixer.dist.php @@ -14,7 +14,6 @@ use CodeIgniter\CodingStandard\CodeIgniter4; use Nexus\CsConfig\Factory; use Nexus\CsConfig\Fixer\Comment\NoCodeSeparatorCommentFixer; -use Nexus\CsConfig\Fixer\Comment\SpaceAfterCommentStartFixer; use Nexus\CsConfig\FixerGenerator; use PhpCsFixer\Finder; @@ -39,7 +38,21 @@ __DIR__ . '/spark', ]); -$overrides = []; +$overrides = [ + 'phpdoc_separation' => [ + 'groups' => [ + ['immutable', 'psalm-immutable'], + ['param', 'phpstan-param', 'psalm-param'], + ['phpstan-pure', 'psalm-pure'], + ['readonly', 'psalm-readonly'], + ['return', 'phpstan-return', 'psalm-return'], + ['template', 'phpstan-template', 'psalm-template'], + ['template-covariant', 'phpstan-template-covariant', 'psalm-template-covariant'], + ['phpstan-type', 'psalm-type'], + ['var', 'phpstan-var', 'psalm-var'], + ], + ], +]; $options = [ 'cacheFile' => 'build/.php-cs-fixer.cache', @@ -47,7 +60,6 @@ 'customFixers' => FixerGenerator::create('vendor/nexusphp/cs-config/src/Fixer', 'Nexus\\CsConfig\\Fixer'), 'customRules' => [ NoCodeSeparatorCommentFixer::name() => true, - SpaceAfterCommentStartFixer::name() => true, ], ]; diff --git a/.php-cs-fixer.no-header.php b/.php-cs-fixer.no-header.php index e795b5a75577..435747582f92 100644 --- a/.php-cs-fixer.no-header.php +++ b/.php-cs-fixer.no-header.php @@ -14,7 +14,6 @@ use CodeIgniter\CodingStandard\CodeIgniter4; use Nexus\CsConfig\Factory; use Nexus\CsConfig\Fixer\Comment\NoCodeSeparatorCommentFixer; -use Nexus\CsConfig\Fixer\Comment\SpaceAfterCommentStartFixer; use Nexus\CsConfig\FixerGenerator; use PhpCsFixer\Finder; @@ -31,7 +30,21 @@ __DIR__ . '/admin/starter/builds', ]); -$overrides = []; +$overrides = [ + 'phpdoc_separation' => [ + 'groups' => [ + ['immutable', 'psalm-immutable'], + ['param', 'phpstan-param', 'psalm-param'], + ['phpstan-pure', 'psalm-pure'], + ['readonly', 'psalm-readonly'], + ['return', 'phpstan-return', 'psalm-return'], + ['template', 'phpstan-template', 'psalm-template'], + ['template-covariant', 'phpstan-template-covariant', 'psalm-template-covariant'], + ['phpstan-type', 'psalm-type'], + ['var', 'phpstan-var', 'psalm-var'], + ], + ], +]; $options = [ 'cacheFile' => 'build/.php-cs-fixer.no-header.cache', @@ -39,7 +52,6 @@ 'customFixers' => FixerGenerator::create('vendor/nexusphp/cs-config/src/Fixer', 'Nexus\\CsConfig\\Fixer'), 'customRules' => [ NoCodeSeparatorCommentFixer::name() => true, - SpaceAfterCommentStartFixer::name() => true, ], ]; diff --git a/.php-cs-fixer.user-guide.php b/.php-cs-fixer.user-guide.php index 8081d73698ca..c0c45261a04b 100644 --- a/.php-cs-fixer.user-guide.php +++ b/.php-cs-fixer.user-guide.php @@ -14,7 +14,6 @@ use CodeIgniter\CodingStandard\CodeIgniter4; use Nexus\CsConfig\Factory; use Nexus\CsConfig\Fixer\Comment\NoCodeSeparatorCommentFixer; -use Nexus\CsConfig\Fixer\Comment\SpaceAfterCommentStartFixer; use Nexus\CsConfig\FixerGenerator; use PhpCsFixer\Finder; @@ -34,6 +33,19 @@ 'php_unit_internal_class' => false, 'no_unused_imports' => false, 'class_attributes_separation' => false, + 'phpdoc_separation' => [ + 'groups' => [ + ['immutable', 'psalm-immutable'], + ['param', 'phpstan-param', 'psalm-param'], + ['phpstan-pure', 'psalm-pure'], + ['readonly', 'psalm-readonly'], + ['return', 'phpstan-return', 'psalm-return'], + ['template', 'phpstan-template', 'psalm-template'], + ['template-covariant', 'phpstan-template-covariant', 'psalm-template-covariant'], + ['phpstan-type', 'psalm-type'], + ['var', 'phpstan-var', 'psalm-var'], + ], + ], ]; $options = [ @@ -42,7 +54,6 @@ 'customFixers' => FixerGenerator::create('vendor/nexusphp/cs-config/src/Fixer', 'Nexus\\CsConfig\\Fixer'), 'customRules' => [ NoCodeSeparatorCommentFixer::name() => true, - SpaceAfterCommentStartFixer::name() => true, ], ]; diff --git a/admin/framework/composer.json b/admin/framework/composer.json index b2a1d6d0e69b..5fcc156529fe 100644 --- a/admin/framework/composer.json +++ b/admin/framework/composer.json @@ -17,7 +17,7 @@ "require-dev": { "codeigniter/coding-standard": "^1.1", "fakerphp/faker": "^1.9", - "friendsofphp/php-cs-fixer": "3.6.*", + "friendsofphp/php-cs-fixer": "~3.11.0", "mikey179/vfsstream": "^1.6", "nexusphp/cs-config": "^3.3", "phpunit/phpunit": "^9.1", diff --git a/app/Config/App.php b/app/Config/App.php index 1a5e562ddd30..79e5741b4c9c 100644 --- a/app/Config/App.php +++ b/app/Config/App.php @@ -437,6 +437,7 @@ class App extends BaseConfig * Defaults to `Lax` as recommended in this link: * * @see https://portswigger.net/web-security/csrf/samesite-cookies + * * @deprecated `Config\Cookie` $samesite property is used. * * @var string diff --git a/composer.json b/composer.json index 01a5af11b1b6..85ee69b8c437 100644 --- a/composer.json +++ b/composer.json @@ -17,7 +17,7 @@ "require-dev": { "codeigniter/coding-standard": "^1.1", "fakerphp/faker": "^1.9", - "friendsofphp/php-cs-fixer": "3.6.*", + "friendsofphp/php-cs-fixer": "~3.11.0", "mikey179/vfsstream": "^1.6", "nexusphp/cs-config": "^3.3", "nexusphp/tachycardia": "^1.0", diff --git a/system/CodeIgniter.php b/system/CodeIgniter.php index d4cc2944d7f7..7497dc4d409b 100644 --- a/system/CodeIgniter.php +++ b/system/CodeIgniter.php @@ -945,11 +945,9 @@ protected function display404errors(PageNotFoundException $e) $this->response->setStatusCode($e->getCode()); if (ENVIRONMENT !== 'testing') { - // @codeCoverageIgnoreStart if (ob_get_level() > 0) { - ob_end_flush(); + ob_end_flush(); // @codeCoverageIgnore } - // @codeCoverageIgnoreEnd } // When testing, one is for phpunit, another is for test case. elseif (ob_get_level() > 2) { diff --git a/system/Config/BaseService.php b/system/Config/BaseService.php index 5213f426bca7..07738a74e38a 100644 --- a/system/Config/BaseService.php +++ b/system/Config/BaseService.php @@ -92,43 +92,43 @@ * @see http://blog.ircmaxell.com/2015/11/simple-easy-risk-and-change.html * @see http://www.infoq.com/presentations/Simple-Made-Easy * - * @method static CacheInterface cache(Cache $config = null, $getShared = true) - * @method static CLIRequest clirequest(App $config = null, $getShared = true) - * @method static CodeIgniter codeigniter(App $config = null, $getShared = true) - * @method static Commands commands($getShared = true) - * @method static void createRequest(App $config, bool $isCli = false) - * @method static ContentSecurityPolicy csp(CSPConfig $config = null, $getShared = true) - * @method static CURLRequest curlrequest($options = [], ResponseInterface $response = null, App $config = null, $getShared = true) - * @method static Email email($config = null, $getShared = true) - * @method static EncrypterInterface encrypter(Encryption $config = null, $getShared = false) - * @method static Exceptions exceptions(ConfigExceptions $config = null, IncomingRequest $request = null, Response $response = null, $getShared = true) - * @method static Filters filters(ConfigFilters $config = null, $getShared = true) - * @method static Format format(ConfigFormat $config = null, $getShared = true) - * @method static Honeypot honeypot(ConfigHoneyPot $config = null, $getShared = true) - * @method static BaseHandler image($handler = null, Images $config = null, $getShared = true) - * @method static IncomingRequest incomingrequest(?App $config = null, bool $getShared = true) - * @method static Iterator iterator($getShared = true) - * @method static Language language($locale = null, $getShared = true) - * @method static Logger logger($getShared = true) - * @method static MigrationRunner migrations(Migrations $config = null, ConnectionInterface $db = null, $getShared = true) - * @method static Negotiate negotiator(RequestInterface $request = null, $getShared = true) - * @method static Pager pager(ConfigPager $config = null, RendererInterface $view = null, $getShared = true) - * @method static Parser parser($viewPath = null, ConfigView $config = null, $getShared = true) - * @method static RedirectResponse redirectresponse(App $config = null, $getShared = true) - * @method static View renderer($viewPath = null, ConfigView $config = null, $getShared = true) + * @method static CacheInterface cache(Cache $config = null, $getShared = true) + * @method static CLIRequest clirequest(App $config = null, $getShared = true) + * @method static CodeIgniter codeigniter(App $config = null, $getShared = true) + * @method static Commands commands($getShared = true) + * @method static void createRequest(App $config, bool $isCli = false) + * @method static ContentSecurityPolicy csp(CSPConfig $config = null, $getShared = true) + * @method static CURLRequest curlrequest($options = [], ResponseInterface $response = null, App $config = null, $getShared = true) + * @method static Email email($config = null, $getShared = true) + * @method static EncrypterInterface encrypter(Encryption $config = null, $getShared = false) + * @method static Exceptions exceptions(ConfigExceptions $config = null, IncomingRequest $request = null, Response $response = null, $getShared = true) + * @method static Filters filters(ConfigFilters $config = null, $getShared = true) + * @method static Format format(ConfigFormat $config = null, $getShared = true) + * @method static Honeypot honeypot(ConfigHoneyPot $config = null, $getShared = true) + * @method static BaseHandler image($handler = null, Images $config = null, $getShared = true) + * @method static IncomingRequest incomingrequest(?App $config = null, bool $getShared = true) + * @method static Iterator iterator($getShared = true) + * @method static Language language($locale = null, $getShared = true) + * @method static Logger logger($getShared = true) + * @method static MigrationRunner migrations(Migrations $config = null, ConnectionInterface $db = null, $getShared = true) + * @method static Negotiate negotiator(RequestInterface $request = null, $getShared = true) + * @method static Pager pager(ConfigPager $config = null, RendererInterface $view = null, $getShared = true) + * @method static Parser parser($viewPath = null, ConfigView $config = null, $getShared = true) + * @method static RedirectResponse redirectresponse(App $config = null, $getShared = true) + * @method static View renderer($viewPath = null, ConfigView $config = null, $getShared = true) * @method static IncomingRequest|CLIRequest request(App $config = null, $getShared = true) - * @method static Response response(App $config = null, $getShared = true) - * @method static Router router(RouteCollectionInterface $routes = null, Request $request = null, $getShared = true) - * @method static RouteCollection routes($getShared = true) - * @method static Security security(App $config = null, $getShared = true) - * @method static Session session(App $config = null, $getShared = true) - * @method static Throttler throttler($getShared = true) - * @method static Timer timer($getShared = true) - * @method static Toolbar toolbar(ConfigToolbar $config = null, $getShared = true) - * @method static Typography typography($getShared = true) - * @method static URI uri($uri = null, $getShared = true) - * @method static Validation validation(ConfigValidation $config = null, $getShared = true) - * @method static Cell viewcell($getShared = true) + * @method static Response response(App $config = null, $getShared = true) + * @method static Router router(RouteCollectionInterface $routes = null, Request $request = null, $getShared = true) + * @method static RouteCollection routes($getShared = true) + * @method static Security security(App $config = null, $getShared = true) + * @method static Session session(App $config = null, $getShared = true) + * @method static Throttler throttler($getShared = true) + * @method static Timer timer($getShared = true) + * @method static Toolbar toolbar(ConfigToolbar $config = null, $getShared = true) + * @method static Typography typography($getShared = true) + * @method static URI uri($uri = null, $getShared = true) + * @method static Validation validation(ConfigValidation $config = null, $getShared = true) + * @method static Cell viewcell($getShared = true) */ class BaseService { diff --git a/system/Database/BaseBuilder.php b/system/Database/BaseBuilder.php index 39e832d13d76..8d9bd87076a3 100644 --- a/system/Database/BaseBuilder.php +++ b/system/Database/BaseBuilder.php @@ -1928,6 +1928,7 @@ public function insert($set = null, ?bool $escape = null) * @internal This is a temporary solution. * * @see https://github.com/codeigniter4/CodeIgniter4/pull/5376 + * * @TODO Fix a root cause, and this method should be removed. */ protected function removeAlias(string $from): string diff --git a/system/Database/SQLSRV/Forge.php b/system/Database/SQLSRV/Forge.php index bb802149edaf..99df429089ef 100755 --- a/system/Database/SQLSRV/Forge.php +++ b/system/Database/SQLSRV/Forge.php @@ -125,7 +125,6 @@ protected function _createTableAttributes(array $attributes): string */ protected function _alterTable(string $alterType, string $table, $field) { - // Handle DROP here if ($alterType === 'DROP') { // check if fields are part of any indexes diff --git a/system/Entity/Entity.php b/system/Entity/Entity.php index 89ddd2afaac5..e5820d075cff 100644 --- a/system/Entity/Entity.php +++ b/system/Entity/Entity.php @@ -471,6 +471,7 @@ public function __set(string $key, $value = null) * $p = $this->getMyProperty() * * @throws Exception + * * @params string $key class property * * @return array|bool|float|int|object|string|null diff --git a/system/HTTP/Response.php b/system/HTTP/Response.php index bcaffa49fbe8..c0f3a2e8120a 100644 --- a/system/HTTP/Response.php +++ b/system/HTTP/Response.php @@ -222,6 +222,7 @@ public function getStatusCode(): int * * @see http://tools.ietf.org/html/rfc7231#section-6 * @see http://www.iana.org/assignments/http-status-codes/http-status-codes.xhtml + * * @deprecated Use getReasonPhrase() * * @codeCoverageIgnore diff --git a/system/HTTP/ResponseInterface.php b/system/HTTP/ResponseInterface.php index 9cf729bb841e..7c824c7818e6 100644 --- a/system/HTTP/ResponseInterface.php +++ b/system/HTTP/ResponseInterface.php @@ -141,6 +141,7 @@ public function setStatusCode(int $code, string $reason = ''); * * @see http://tools.ietf.org/html/rfc7231#section-6 * @see http://www.iana.org/assignments/http-status-codes/http-status-codes.xhtml + * * @deprecated Use getReasonPhrase() */ public function getReason(): string; diff --git a/system/I18n/Time.php b/system/I18n/Time.php index dd26979af13d..62129245d67c 100644 --- a/system/I18n/Time.php +++ b/system/I18n/Time.php @@ -285,6 +285,7 @@ public static function createFromInstance(DateTimeInterface $dateTime, ?string $ * @return Time * * @deprecated Use createFromInstance() instead + * * @codeCoverageIgnore */ public static function instance(DateTime $dateTime, ?string $locale = null) diff --git a/system/Router/Router.php b/system/Router/Router.php index 43b899fb56be..60aa403fa0e9 100644 --- a/system/Router/Router.php +++ b/system/Router/Router.php @@ -459,7 +459,7 @@ protected function checkRoutes(string $uri): bool return true; } - [$controller, ] = explode('::', $handler); + [$controller] = explode('::', $handler); // Checks `/` in controller name if (strpos($controller, '/') !== false) { diff --git a/tests/AutoReview/ComposerJsonTest.php b/tests/AutoReview/ComposerJsonTest.php index 27044861b72f..39763b079eca 100644 --- a/tests/AutoReview/ComposerJsonTest.php +++ b/tests/AutoReview/ComposerJsonTest.php @@ -20,6 +20,7 @@ * @internal * * @coversNothing + * * @group auto-review */ final class ComposerJsonTest extends TestCase diff --git a/tests/system/API/ResponseTraitTest.php b/tests/system/API/ResponseTraitTest.php index d463f0bd4d03..0222fd0c0058 100644 --- a/tests/system/API/ResponseTraitTest.php +++ b/tests/system/API/ResponseTraitTest.php @@ -43,19 +43,19 @@ protected function makeController(array $userConfig = [], string $uri = 'http:// $config = new App(); foreach ([ - 'baseURL' => 'http://example.com/', - 'uriProtocol' => 'REQUEST_URI', - 'defaultLocale' => 'en', - 'negotiateLocale' => false, + 'baseURL' => 'http://example.com/', + 'uriProtocol' => 'REQUEST_URI', + 'defaultLocale' => 'en', + 'negotiateLocale' => false, 'supportedLocales' => ['en'], - 'CSPEnabled' => false, - 'cookiePrefix' => '', - 'cookieDomain' => '', - 'cookiePath' => '/', - 'cookieSecure' => false, - 'cookieHTTPOnly' => false, - 'proxyIPs' => [], - 'cookieSameSite' => 'Lax', + 'CSPEnabled' => false, + 'cookiePrefix' => '', + 'cookieDomain' => '', + 'cookiePath' => '/', + 'cookieSecure' => false, + 'cookieHTTPOnly' => false, + 'proxyIPs' => [], + 'cookieSameSite' => 'Lax', ] as $key => $value) { $config->{$key} = $value; } @@ -79,7 +79,7 @@ protected function makeController(array $userConfig = [], string $uri = 'http:// } // Create the controller class finally. - $controller = new class ($this->request, $this->response, $this->formatter) { + return new class ($this->request, $this->response, $this->formatter) { use ResponseTrait; protected $request; @@ -98,8 +98,6 @@ public function resetFormatter() $this->formatter = null; } }; - - return $controller; } public function testNoFormatterJSON() @@ -518,19 +516,19 @@ public function testFormatByRequestNegotiateIfFormatIsNotJsonOrXML() $config = new App(); foreach ([ - 'baseURL' => 'http://example.com/', - 'uriProtocol' => 'REQUEST_URI', - 'defaultLocale' => 'en', - 'negotiateLocale' => false, + 'baseURL' => 'http://example.com/', + 'uriProtocol' => 'REQUEST_URI', + 'defaultLocale' => 'en', + 'negotiateLocale' => false, 'supportedLocales' => ['en'], - 'CSPEnabled' => false, - 'cookiePrefix' => '', - 'cookieDomain' => '', - 'cookiePath' => '/', - 'cookieSecure' => false, - 'cookieHTTPOnly' => false, - 'proxyIPs' => [], - 'cookieSameSite' => 'Lax', + 'CSPEnabled' => false, + 'cookiePrefix' => '', + 'cookieDomain' => '', + 'cookiePath' => '/', + 'cookieSecure' => false, + 'cookieHTTPOnly' => false, + 'proxyIPs' => [], + 'cookieSameSite' => 'Lax', ] as $key => $value) { $config->{$key} = $value; } diff --git a/tests/system/CodeIgniterTest.php b/tests/system/CodeIgniterTest.php index d1b6793e4e89..e0841ddf747b 100644 --- a/tests/system/CodeIgniterTest.php +++ b/tests/system/CodeIgniterTest.php @@ -177,7 +177,7 @@ public function testControllersCanReturnResponseObject() $routes = Services::routes(); $routes->add('pages/(:segment)', static function ($segment) { $response = Services::response(); - $string = "You want to see 'about' page."; + $string = "You want to see 'about' page."; return $response->setBody($string); }); @@ -583,7 +583,7 @@ public function testPageCacheSendSecureHeaders() CodeIgniter::cache(3600); $response = Services::response(); - $string = 'This is a test page. Elapsed time: {elapsed_time}'; + $string = 'This is a test page. Elapsed time: {elapsed_time}'; return $response->setBody($string); }); diff --git a/tests/system/Commands/GenerateKeyTest.php b/tests/system/Commands/GenerateKeyTest.php index e4f05fddad95..4ba9e8e0ffba 100644 --- a/tests/system/Commands/GenerateKeyTest.php +++ b/tests/system/Commands/GenerateKeyTest.php @@ -86,6 +86,7 @@ public function testGenerateKeyShowsEncodedKey() /** * @runInSeparateProcess + * * @preserveGlobalState disabled */ public function testGenerateKeyCreatesNewKey() diff --git a/tests/system/CommonFunctionsSendTest.php b/tests/system/CommonFunctionsSendTest.php index 594a0faab4db..03e675cfbfa5 100644 --- a/tests/system/CommonFunctionsSendTest.php +++ b/tests/system/CommonFunctionsSendTest.php @@ -32,6 +32,7 @@ protected function setUp(): void * See https://github.com/codeigniter4/CodeIgniter4/issues/1393 * * @runInSeparateProcess + * * @preserveGlobalState disabled */ public function testRedirectResponseCookiesSent() diff --git a/tests/system/CommonFunctionsTest.php b/tests/system/CommonFunctionsTest.php index 5c2b6efa7f83..a50069d3745b 100644 --- a/tests/system/CommonFunctionsTest.php +++ b/tests/system/CommonFunctionsTest.php @@ -179,6 +179,7 @@ public function testEscapeBadContext() /** * @runInSeparateProcess + * * @preserveGlobalState disabled */ public function testSessionInstance() @@ -190,6 +191,7 @@ public function testSessionInstance() /** * @runInSeparateProcess + * * @preserveGlobalState disabled */ public function testSessionVariable() @@ -203,6 +205,7 @@ public function testSessionVariable() /** * @runInSeparateProcess + * * @preserveGlobalState disabled */ public function testSessionVariableNotThere() @@ -286,6 +289,7 @@ public function testModelExistsAbsoluteClassname() /** * @runInSeparateProcess + * * @preserveGlobalState disabled */ public function testOldInput() @@ -321,6 +325,7 @@ public function testOldInput() /** * @runInSeparateProcess + * * @preserveGlobalState disabled */ public function testOldInputSerializeData() @@ -354,7 +359,9 @@ public function testOldInputSerializeData() /** * @see https://github.com/codeigniter4/CodeIgniter4/issues/1492 + * * @runInSeparateProcess + * * @preserveGlobalState disabled */ public function testOldInputArray() @@ -468,6 +475,7 @@ public function testRedirectResponseCookies1() /** * @runInSeparateProcess + * * @preserveGlobalState disabled */ public function testTrace() @@ -491,6 +499,7 @@ public function testViewNotSaveData() /** * @runInSeparateProcess + * * @preserveGlobalState disabled */ public function testForceHttpsNullRequestAndResponse() @@ -571,6 +580,7 @@ public function testDWithCSP() /** * @runInSeparateProcess + * * @preserveGlobalState disabled */ public function testTraceWithCSP() diff --git a/tests/system/Config/BaseConfigTest.php b/tests/system/Config/BaseConfigTest.php index d1de7532cb39..9434e0a2c557 100644 --- a/tests/system/Config/BaseConfigTest.php +++ b/tests/system/Config/BaseConfigTest.php @@ -80,6 +80,7 @@ public function testUseDefaultValueTypeStringValue() /** * @runInSeparateProcess + * * @preserveGlobalState disabled */ public function testServerValues() @@ -176,6 +177,7 @@ public function testSetsDefaultValues() /** * @runInSeparateProcess + * * @preserveGlobalState disabled */ public function testSetsDefaultValuesEncryptionUsingHex2Bin() @@ -191,6 +193,7 @@ public function testSetsDefaultValuesEncryptionUsingHex2Bin() /** * @runInSeparateProcess + * * @preserveGlobalState disabled */ public function testSetDefaultValuesEncryptionUsingBase64() diff --git a/tests/system/Config/ConfigTest.php b/tests/system/Config/ConfigTest.php index e5d382527edb..af996652a92c 100644 --- a/tests/system/Config/ConfigTest.php +++ b/tests/system/Config/ConfigTest.php @@ -55,6 +55,7 @@ public function testCreateNonConfig() /** * @runInSeparateProcess + * * @preserveGlobalState disabled */ public function testInjection() diff --git a/tests/system/Config/DotEnvTest.php b/tests/system/Config/DotEnvTest.php index aa718bd6dea6..0b9dcc984e5a 100644 --- a/tests/system/Config/DotEnvTest.php +++ b/tests/system/Config/DotEnvTest.php @@ -67,6 +67,7 @@ public function testLoadsVars() /** * @runInSeparateProcess + * * @preserveGlobalState disabled */ public function testLoadsHex2Bin() @@ -81,6 +82,7 @@ public function testLoadsHex2Bin() /** * @runInSeparateProcess + * * @preserveGlobalState disabled */ public function testLoadsBase64() diff --git a/tests/system/Config/ServicesTest.php b/tests/system/Config/ServicesTest.php index 96ce95089389..8f375d398484 100644 --- a/tests/system/Config/ServicesTest.php +++ b/tests/system/Config/ServicesTest.php @@ -238,6 +238,7 @@ public function testNewViewcell() /** * @runInSeparateProcess + * * @preserveGlobalState disabled */ public function testNewSession() @@ -248,6 +249,7 @@ public function testNewSession() /** * @runInSeparateProcess + * * @preserveGlobalState disabled */ public function testNewSessionWithNullConfig() @@ -258,6 +260,7 @@ public function testNewSessionWithNullConfig() /** * @runInSeparateProcess + * * @preserveGlobalState disabled */ public function testCallStatic() @@ -272,6 +275,7 @@ public function testCallStatic() /** * @runInSeparateProcess + * * @preserveGlobalState disabled */ public function testCallStaticDirectly() @@ -283,6 +287,7 @@ public function testCallStaticDirectly() /** * @runInSeparateProcess + * * @preserveGlobalState disabled */ public function testMockInjection() @@ -305,6 +310,7 @@ public function testMockInjection() /** * @runInSeparateProcess + * * @preserveGlobalState disabled */ public function testReset() @@ -324,6 +330,7 @@ public function testReset() /** * @runInSeparateProcess + * * @preserveGlobalState disabled */ public function testResetSingle() diff --git a/tests/system/ControllerTest.php b/tests/system/ControllerTest.php index cc77c7507b15..b78f2c69cd2e 100644 --- a/tests/system/ControllerTest.php +++ b/tests/system/ControllerTest.php @@ -75,7 +75,7 @@ public function testConstructorHTTPS() $original = $_SERVER; $_SERVER = ['HTTPS' => 'on']; // make sure we can instantiate one - $this->controller = new class () extends Controller { + $this->controller = new class () extends Controller { protected $forceHTTPS = 1; }; $this->controller->initController($this->request, $this->response, $this->logger); @@ -182,7 +182,7 @@ public function testValidateData() public function testHelpers() { - $this->controller = new class () extends Controller { + $this->controller = new class () extends Controller { protected $helpers = [ 'cookie', 'text', diff --git a/tests/system/Database/BaseConnectionTest.php b/tests/system/Database/BaseConnectionTest.php index 3c1be631d73e..33f70bbe7521 100644 --- a/tests/system/Database/BaseConnectionTest.php +++ b/tests/system/Database/BaseConnectionTest.php @@ -106,7 +106,7 @@ public function testCanConnectToFailoverWhenNoConnectionAvailable() $options = $this->options; $options['failover'] = [$this->failoverOptions]; - $db = new class ($options) extends MockConnection { + $db = new class ($options) extends MockConnection { protected $returnValues = [ 'connect' => [false, 345], ]; diff --git a/tests/system/Database/Migrations/MigrationTest.php b/tests/system/Database/Migrations/MigrationTest.php index 1c1561044be0..54d7bb9e3b4c 100644 --- a/tests/system/Database/Migrations/MigrationTest.php +++ b/tests/system/Database/Migrations/MigrationTest.php @@ -29,7 +29,7 @@ protected function setUp(): void public function testDBGroup() { - $migration = new class () extends Migration { + $migration = new class () extends Migration { protected $DBGroup = 'tests'; public function up() diff --git a/tests/system/Entity/EntityTest.php b/tests/system/Entity/EntityTest.php index 2838aa02269e..dabd24af73d5 100644 --- a/tests/system/Entity/EntityTest.php +++ b/tests/system/Entity/EntityTest.php @@ -596,7 +596,7 @@ public function testCastAsJSONSyntaxError() $this->expectExceptionMessage('Syntax error, malformed JSON'); (Closure::bind(static function (string $value) { - $entity = new Entity(); + $entity = new Entity(); $entity->casts['dummy'] = 'json[array]'; return $entity->castAs($value, 'dummy'); @@ -610,7 +610,7 @@ public function testCastAsJSONAnotherErrorDepth() $string = '{' . str_repeat('"test":{', 513) . '"test":"value"' . str_repeat('}', 513) . '}'; (Closure::bind(static function (string $value) { - $entity = new Entity(); + $entity = new Entity(); $entity->casts['dummy'] = 'json[array]'; return $entity->castAs($value, 'dummy'); @@ -624,7 +624,7 @@ public function testCastAsJSONControlCharCheck() $string = "{\n\t\"property1\": \"The quick brown fox\njumps over the lazy dog\",\n\t\"property2\":\"value2\"\n}"; (Closure::bind(static function (string $value) { - $entity = new Entity(); + $entity = new Entity(); $entity->casts['dummy'] = 'json[array]'; return $entity->castAs($value, 'dummy'); @@ -638,7 +638,7 @@ public function testCastAsJSONStateMismatch() $string = '[{"name":"jack","product_id":"1234"]'; (Closure::bind(static function (string $value) { - $entity = new Entity(); + $entity = new Entity(); $entity->casts['dummy'] = 'json[array]'; return $entity->castAs($value, 'dummy'); @@ -805,7 +805,7 @@ public function testDataMappingIssetUnsetSwapped() public function testToArraySkipAttributesWithUnderscoreInFirstCharacter() { - $entity = new class () extends Entity { + $entity = new class () extends Entity { protected $attributes = [ '_foo' => null, 'bar' => null, diff --git a/tests/system/Events/EventsTest.php b/tests/system/Events/EventsTest.php index 9b69a219b929..58a8159f3e1c 100644 --- a/tests/system/Events/EventsTest.php +++ b/tests/system/Events/EventsTest.php @@ -43,6 +43,7 @@ protected function tearDown(): void /** * @runInSeparateProcess + * * @preserveGlobalState disabled */ public function testInitialize() diff --git a/tests/system/Files/FileCollectionTest.php b/tests/system/Files/FileCollectionTest.php index 7936cc2e62da..4b4fd9d3f63a 100644 --- a/tests/system/Files/FileCollectionTest.php +++ b/tests/system/Files/FileCollectionTest.php @@ -108,7 +108,7 @@ public function testConstructorAddsFiles() $this->file, ]; - $collection = new class ([$this->file]) extends FileCollection { + $collection = new class ([$this->file]) extends FileCollection { protected $files = [ SUPPORTPATH . 'Files/able/apple.php', ]; diff --git a/tests/system/Filters/HoneypotTest.php b/tests/system/Filters/HoneypotTest.php index 94ec0b61d1ff..c9cff3fa4125 100644 --- a/tests/system/Filters/HoneypotTest.php +++ b/tests/system/Filters/HoneypotTest.php @@ -80,6 +80,7 @@ public function testBeforeClean() /** * @runInSeparateProcess + * * @preserveGlobalState disabled */ public function testAfter() @@ -102,6 +103,7 @@ public function testAfter() /** * @runInSeparateProcess + * * @preserveGlobalState disabled */ public function testAfterNotApplicable() diff --git a/tests/system/HTTP/ContentSecurityPolicyTest.php b/tests/system/HTTP/ContentSecurityPolicyTest.php index 7e41c9a0d4a5..7542ed5a1934 100644 --- a/tests/system/HTTP/ContentSecurityPolicyTest.php +++ b/tests/system/HTTP/ContentSecurityPolicyTest.php @@ -60,6 +60,7 @@ protected function work(string $parm = 'Hello') /** * @runInSeparateProcess + * * @preserveGlobalState disabled */ public function testExistence() @@ -72,6 +73,7 @@ public function testExistence() /** * @runInSeparateProcess + * * @preserveGlobalState disabled */ public function testReportOnly() @@ -85,6 +87,7 @@ public function testReportOnly() /** * @runInSeparateProcess + * * @preserveGlobalState disabled */ public function testDefaults() @@ -104,6 +107,7 @@ public function testDefaults() /** * @runInSeparateProcess + * * @preserveGlobalState disabled */ public function testChildSrc() @@ -121,6 +125,7 @@ public function testChildSrc() /** * @runInSeparateProcess + * * @preserveGlobalState disabled */ public function testConnectSrc() @@ -137,6 +142,7 @@ public function testConnectSrc() /** * @runInSeparateProcess + * * @preserveGlobalState disabled */ public function testFontSrc() @@ -155,6 +161,7 @@ public function testFontSrc() /** * @runInSeparateProcess + * * @preserveGlobalState disabled */ public function testFormAction() @@ -173,6 +180,7 @@ public function testFormAction() /** * @runInSeparateProcess + * * @preserveGlobalState disabled */ public function testFrameAncestor() @@ -190,6 +198,7 @@ public function testFrameAncestor() /** * @runInSeparateProcess + * * @preserveGlobalState disabled */ public function testFrameSrc() @@ -207,6 +216,7 @@ public function testFrameSrc() /** * @runInSeparateProcess + * * @preserveGlobalState disabled */ public function testImageSrc() @@ -224,6 +234,7 @@ public function testImageSrc() /** * @runInSeparateProcess + * * @preserveGlobalState disabled */ public function testMediaSrc() @@ -241,6 +252,7 @@ public function testMediaSrc() /** * @runInSeparateProcess + * * @preserveGlobalState disabled */ public function testManifestSrc() @@ -258,6 +270,7 @@ public function testManifestSrc() /** * @runInSeparateProcess + * * @preserveGlobalState disabled */ public function testPluginType() @@ -275,6 +288,7 @@ public function testPluginType() /** * @runInSeparateProcess + * * @preserveGlobalState disabled */ public function testPluginArray() @@ -290,6 +304,7 @@ public function testPluginArray() /** * @runInSeparateProcess + * * @preserveGlobalState disabled */ public function testObjectSrc() @@ -307,6 +322,7 @@ public function testObjectSrc() /** * @runInSeparateProcess + * * @preserveGlobalState disabled */ public function testScriptSrc() @@ -324,6 +340,7 @@ public function testScriptSrc() /** * @runInSeparateProcess + * * @preserveGlobalState disabled */ public function testStyleSrc() @@ -341,6 +358,7 @@ public function testStyleSrc() /** * @runInSeparateProcess + * * @preserveGlobalState disabled */ public function testBaseURIDefault() @@ -354,6 +372,7 @@ public function testBaseURIDefault() /** * @runInSeparateProcess + * * @preserveGlobalState disabled */ public function testBaseURI() @@ -368,6 +387,7 @@ public function testBaseURI() /** * @runInSeparateProcess + * * @preserveGlobalState disabled */ public function testBaseURIRich() @@ -382,6 +402,7 @@ public function testBaseURIRich() /** * @runInSeparateProcess + * * @preserveGlobalState disabled */ public function testDefaultSrc() @@ -398,6 +419,7 @@ public function testDefaultSrc() /** * @runInSeparateProcess + * * @preserveGlobalState disabled */ public function testReportURI() @@ -413,6 +435,7 @@ public function testReportURI() /** * @runInSeparateProcess + * * @preserveGlobalState disabled */ public function testSandboxFlags() @@ -429,6 +452,7 @@ public function testSandboxFlags() /** * @runInSeparateProcess + * * @preserveGlobalState disabled */ public function testUpgradeInsecureRequests() @@ -443,6 +467,7 @@ public function testUpgradeInsecureRequests() /** * @runInSeparateProcess + * * @preserveGlobalState disabled */ public function testBodyEmpty() @@ -456,6 +481,7 @@ public function testBodyEmpty() /** * @runInSeparateProcess + * * @preserveGlobalState disabled */ public function testBodyScriptNonce() @@ -527,6 +553,7 @@ public function testBodyStyleNonceDisableAutoNonce() /** * @runInSeparateProcess + * * @preserveGlobalState disabled */ public function testBodyStyleNonce() @@ -566,6 +593,7 @@ public function testBodyStyleNonceCustomStyleTag() /** * @runInSeparateProcess + * * @preserveGlobalState disabled */ public function testHeaderWrongCaseNotFound() @@ -579,6 +607,7 @@ public function testHeaderWrongCaseNotFound() /** * @runInSeparateProcess + * * @preserveGlobalState disabled */ public function testHeaderIgnoreCase() @@ -592,6 +621,7 @@ public function testHeaderIgnoreCase() /** * @runInSeparateProcess + * * @preserveGlobalState disabled */ public function testCSPDisabled() @@ -623,6 +653,7 @@ public function testGetStyleNonce() /** * @runInSeparateProcess + * * @preserveGlobalState disabled */ public function testHeaderScriptNonceEmittedOnceGetScriptNonceCalled() diff --git a/tests/system/HTTP/DownloadResponseTest.php b/tests/system/HTTP/DownloadResponseTest.php index eb6df43eecac..f0c9b3024f6d 100644 --- a/tests/system/HTTP/DownloadResponseTest.php +++ b/tests/system/HTTP/DownloadResponseTest.php @@ -299,6 +299,7 @@ public function testPretendOutput() /** * @runInSeparateProcess + * * @preserveGlobalState disabled */ public function testRealOutput() diff --git a/tests/system/HTTP/IncomingRequestTest.php b/tests/system/HTTP/IncomingRequestTest.php index f19f9cf53ee4..f7d50dccff24 100644 --- a/tests/system/HTTP/IncomingRequestTest.php +++ b/tests/system/HTTP/IncomingRequestTest.php @@ -124,6 +124,7 @@ public function testCanGetOldInputArrayWithSESSION() * @see https://github.com/codeigniter4/CodeIgniter4/issues/1492 * * @runInSeparateProcess + * * @preserveGlobalState disabled */ public function testCanGetOldInputArrayWithSessionService() diff --git a/tests/system/HTTP/RedirectResponseTest.php b/tests/system/HTTP/RedirectResponseTest.php index 95cd6003f275..1b8fe62f49d9 100644 --- a/tests/system/HTTP/RedirectResponseTest.php +++ b/tests/system/HTTP/RedirectResponseTest.php @@ -117,6 +117,7 @@ public function testRedirectRelativeConvertsToFullURI() /** * @runInSeparateProcess + * * @preserveGlobalState disabled */ public function testWithInput() @@ -137,6 +138,7 @@ public function testWithInput() /** * @runInSeparateProcess + * * @preserveGlobalState disabled */ public function testWithValidationErrors() @@ -157,6 +159,7 @@ public function testWithValidationErrors() /** * @runInSeparateProcess + * * @preserveGlobalState disabled */ public function testWith() @@ -173,6 +176,7 @@ public function testWith() /** * @runInSeparateProcess + * * @preserveGlobalState disabled */ public function testRedirectBack() @@ -189,6 +193,7 @@ public function testRedirectBack() /** * @runInSeparateProcess + * * @preserveGlobalState disabled */ public function testRedirectBackMissing() @@ -204,6 +209,7 @@ public function testRedirectBackMissing() /** * @runInSeparateProcess + * * @preserveGlobalState disabled * * @see https://github.com/codeigniter4/CodeIgniter4/issues/2119 @@ -245,6 +251,7 @@ public function testWithCookies() /** * @runInSeparateProcess + * * @preserveGlobalState disabled */ public function testWithCookiesWithEmptyCookies() diff --git a/tests/system/HTTP/ResponseSendTest.php b/tests/system/HTTP/ResponseSendTest.php index b67820785eb5..b30587d0493e 100644 --- a/tests/system/HTTP/ResponseSendTest.php +++ b/tests/system/HTTP/ResponseSendTest.php @@ -44,6 +44,7 @@ final class ResponseSendTest extends CIUnitTestCase /** * @runInSeparateProcess + * * @preserveGlobalState disabled */ public function testHeadersMissingDate() @@ -77,6 +78,7 @@ public function testHeadersMissingDate() * it makes sure that sending gives CSP a chance to do its thing. * * @runInSeparateProcess + * * @preserveGlobalState disabled */ public function testHeadersWithCSP() @@ -111,7 +113,9 @@ public function testHeadersWithCSP() * Make sure cookies are set by RedirectResponse this way * * @see https://github.com/codeigniter4/CodeIgniter4/issues/1393 + * * @runInSeparateProcess + * * @preserveGlobalState disabled */ public function testRedirectResponseCookies() diff --git a/tests/system/HTTP/URITest.php b/tests/system/HTTP/URITest.php index 1a51741b8c36..8e6bcb95ede9 100644 --- a/tests/system/HTTP/URITest.php +++ b/tests/system/HTTP/URITest.php @@ -660,6 +660,7 @@ public function testResolveRelativeURI($rel, $expected) /** * @dataProvider defaultResolutions + * * @group single * * @param mixed $rel @@ -789,6 +790,7 @@ public function testGetQueryWithStrings() /** * @see https://github.com/codeigniter4/CodeIgniter4/issues/331 + * * @group single */ public function testNoExtraSlashes() diff --git a/tests/system/Helpers/FormHelperTest.php b/tests/system/Helpers/FormHelperTest.php index 3fdcc582d0fc..a464fbb488d5 100644 --- a/tests/system/Helpers/FormHelperTest.php +++ b/tests/system/Helpers/FormHelperTest.php @@ -836,6 +836,7 @@ public function testSetCheckboxWithValueZero() /** * @runInSeparateProcess + * * @preserveGlobalState disabled */ public function testSetRadioFromSessionOldInput() @@ -856,6 +857,7 @@ public function testSetRadioFromSessionOldInput() /** * @runInSeparateProcess + * * @preserveGlobalState disabled */ public function testSetRadioFromPost() @@ -869,6 +871,7 @@ public function testSetRadioFromPost() /** * @runInSeparateProcess + * * @preserveGlobalState disabled */ public function testSetRadioFromPostWithValueZero() diff --git a/tests/system/I18n/TimeTest.php b/tests/system/I18n/TimeTest.php index e541d17c049e..ff2c04640682 100644 --- a/tests/system/I18n/TimeTest.php +++ b/tests/system/I18n/TimeTest.php @@ -66,7 +66,7 @@ public function testTimeWithTimezone() IntlDateFormatter::SHORT, IntlDateFormatter::SHORT, 'Europe/London', // Default for CodeIgniter - IntlDateFormatter::GREGORIAN, + IntlDateFormatter::GREGORIAN, 'yyyy-MM-dd HH:mm:ss' ); @@ -82,7 +82,7 @@ public function testTimeWithTimezoneAndLocale() IntlDateFormatter::SHORT, IntlDateFormatter::SHORT, 'Europe/London', // Default for CodeIgniter - IntlDateFormatter::GREGORIAN, + IntlDateFormatter::GREGORIAN, 'yyyy-MM-dd HH:mm:ss' ); diff --git a/tests/system/Models/GeneralModelTest.php b/tests/system/Models/GeneralModelTest.php index cf5b890c2718..450d3cc87d60 100644 --- a/tests/system/Models/GeneralModelTest.php +++ b/tests/system/Models/GeneralModelTest.php @@ -102,7 +102,7 @@ public function testSetAllowedFields(): void 'updated_at', ]; - $model = new class () extends Model { + $model = new class () extends Model { protected $allowedFields = [ 'id', 'created_at', diff --git a/tests/system/Models/SaveModelTest.php b/tests/system/Models/SaveModelTest.php index 0ff142375fde..48387dc72968 100644 --- a/tests/system/Models/SaveModelTest.php +++ b/tests/system/Models/SaveModelTest.php @@ -263,7 +263,7 @@ public function testSaveNewEntityWithDate(): void ]; }; - $testModel = new class () extends Model { + $testModel = new class () extends Model { protected $table = 'empty'; protected $allowedFields = [ 'name', diff --git a/tests/system/RESTful/ResourceControllerTest.php b/tests/system/RESTful/ResourceControllerTest.php index d3dc0ea56a94..b65a7ddf38c4 100644 --- a/tests/system/RESTful/ResourceControllerTest.php +++ b/tests/system/RESTful/ResourceControllerTest.php @@ -36,6 +36,7 @@ * return correct responses. * * @runTestsInSeparateProcesses + * * @preserveGlobalState disabled * * @internal diff --git a/tests/system/RESTful/ResourcePresenterTest.php b/tests/system/RESTful/ResourcePresenterTest.php index c44bbba564d1..c36f6340c861 100644 --- a/tests/system/RESTful/ResourcePresenterTest.php +++ b/tests/system/RESTful/ResourcePresenterTest.php @@ -30,6 +30,7 @@ * return correct responses. * * @runTestsInSeparateProcesses + * * @preserveGlobalState disabled * * @internal diff --git a/tests/system/Security/SecurityCSRFSessionRandomizeTokenTest.php b/tests/system/Security/SecurityCSRFSessionRandomizeTokenTest.php index ddf4f6b42ce4..228c386793c5 100644 --- a/tests/system/Security/SecurityCSRFSessionRandomizeTokenTest.php +++ b/tests/system/Security/SecurityCSRFSessionRandomizeTokenTest.php @@ -31,6 +31,7 @@ /** * @runTestsInSeparateProcesses + * * @preserveGlobalState disabled * * @internal diff --git a/tests/system/Security/SecurityCSRFSessionTest.php b/tests/system/Security/SecurityCSRFSessionTest.php index af7f8c21905a..a87db60a19b0 100644 --- a/tests/system/Security/SecurityCSRFSessionTest.php +++ b/tests/system/Security/SecurityCSRFSessionTest.php @@ -30,6 +30,7 @@ /** * @runTestsInSeparateProcesses + * * @preserveGlobalState disabled * * @internal diff --git a/tests/system/Session/SessionTest.php b/tests/system/Session/SessionTest.php index c6cf278a6073..37faed7f2c50 100644 --- a/tests/system/Session/SessionTest.php +++ b/tests/system/Session/SessionTest.php @@ -23,6 +23,7 @@ /** * @runTestsInSeparateProcesses + * * @preserveGlobalState disabled * * @internal diff --git a/tests/system/Test/ControllerTestTraitTest.php b/tests/system/Test/ControllerTestTraitTest.php index c03e5132ce2b..84892479fee9 100644 --- a/tests/system/Test/ControllerTestTraitTest.php +++ b/tests/system/Test/ControllerTestTraitTest.php @@ -23,6 +23,7 @@ * Exercise our Controller class. * * @runTestsInSeparateProcesses + * * @preserveGlobalState disabled * * @internal diff --git a/tests/system/Test/TestCaseEmissionsTest.php b/tests/system/Test/TestCaseEmissionsTest.php index 64f21b121734..edc3d6b34ef4 100644 --- a/tests/system/Test/TestCaseEmissionsTest.php +++ b/tests/system/Test/TestCaseEmissionsTest.php @@ -42,6 +42,7 @@ final class TestCaseEmissionsTest extends CIUnitTestCase /** * @runInSeparateProcess + * * @preserveGlobalState disabled */ public function testHeadersEmitted() @@ -70,6 +71,7 @@ public function testHeadersEmitted() /** * @runInSeparateProcess + * * @preserveGlobalState disabled */ public function testHeadersNotEmitted() diff --git a/tests/system/Validation/ValidationTest.php b/tests/system/Validation/ValidationTest.php index e5443eba1938..09faa1bb2282 100644 --- a/tests/system/Validation/ValidationTest.php +++ b/tests/system/Validation/ValidationTest.php @@ -25,6 +25,7 @@ /** * @internal + * * @no-final */ class ValidationTest extends CIUnitTestCase diff --git a/tests/system/View/ParserTest.php b/tests/system/View/ParserTest.php index ab9c0860b851..3fa36585e7ea 100644 --- a/tests/system/View/ParserTest.php +++ b/tests/system/View/ParserTest.php @@ -267,7 +267,7 @@ public function testParseLoopObjectProperties() public function testParseLoopEntityProperties() { - $power = new class () extends Entity { + $power = new class () extends Entity { public $foo = 'bar'; protected $bar = 'baz'; @@ -297,7 +297,7 @@ public function toArray(bool $onlyChanged = false, bool $cast = true, bool $recu public function testParseLoopEntityObjectProperties() { - $power = new class () extends Entity { + $power = new class () extends Entity { protected $attributes = [ 'foo' => 'bar', 'bar' => 'baz', @@ -738,7 +738,7 @@ public function testParserPluginClosure() public function testParserPluginParams() { $this->parser->addPlugin('growth', static function ($str, array $params) { - $step = $params['step'] ?? 1; + $step = $params['step'] ?? 1; $count = $params['count'] ?? 2; $out = ''; diff --git a/user_guide_src/source/database/query_builder/042.php b/user_guide_src/source/database/query_builder/042.php index 7c9935e4f356..26a4c0316e1f 100644 --- a/user_guide_src/source/database/query_builder/042.php +++ b/user_guide_src/source/database/query_builder/042.php @@ -1,4 +1,5 @@ like('title', 'match'); $builder->orLike('body', $match); +$builder->like('title', 'match'); +$builder->orLike('body', $match); // WHERE `title` LIKE '%match%' ESCAPE '!' OR `body` LIKE '%match%' ESCAPE '!' diff --git a/user_guide_src/source/database/query_builder/063.php b/user_guide_src/source/database/query_builder/063.php index 0b7543273430..ada34b2e65d4 100644 --- a/user_guide_src/source/database/query_builder/063.php +++ b/user_guide_src/source/database/query_builder/063.php @@ -1,4 +1,5 @@ havingLike('title', 'match'); $builder->orHavingLike('body', $match); +$builder->havingLike('title', 'match'); +$builder->orHavingLike('body', $match); // HAVING `title` LIKE '%match%' ESCAPE '!' OR `body` LIKE '%match%' ESCAPE '!' diff --git a/user_guide_src/source/incoming/controllers/004.php b/user_guide_src/source/incoming/controllers/004.php index 65b1c77f8014..9216bab50032 100644 --- a/user_guide_src/source/incoming/controllers/004.php +++ b/user_guide_src/source/incoming/controllers/004.php @@ -8,7 +8,7 @@ public function updateUser(int $userID) { if (! $this->validate([ 'email' => "required|is_unique[users.email,id,{$userID}]", - 'name' => 'required|alpha_numeric_spaces', + 'name' => 'required|alpha_numeric_spaces', ])) { return view('users/update', [ 'errors' => $this->validator->getErrors(), diff --git a/user_guide_src/source/tutorial/create_news_items/002.php b/user_guide_src/source/tutorial/create_news_items/002.php index 66ff5e26776b..d98f9f8b4a44 100644 --- a/user_guide_src/source/tutorial/create_news_items/002.php +++ b/user_guide_src/source/tutorial/create_news_items/002.php @@ -10,7 +10,7 @@ public function create() if ($this->request->getMethod() === 'post' && $this->validate([ 'title' => 'required|min_length[3]|max_length[255]', - 'body' => 'required', + 'body' => 'required', ])) { $model->save([ 'title' => $this->request->getPost('title'), diff --git a/utils/Rector/UnderscoreToCamelCaseVariableNameRector.php b/utils/Rector/UnderscoreToCamelCaseVariableNameRector.php index 530fe18b029e..054eb75a2800 100644 --- a/utils/Rector/UnderscoreToCamelCaseVariableNameRector.php +++ b/utils/Rector/UnderscoreToCamelCaseVariableNameRector.php @@ -55,7 +55,7 @@ public function run($a_b) } } CODE_SAMPLE -, + , <<<'CODE_SAMPLE' final class SomeClass {