diff --git a/phpstan-baseline.php b/phpstan-baseline.php index 1516c5d6f7c9..cac41a7dbfdb 100644 --- a/phpstan-baseline.php +++ b/phpstan-baseline.php @@ -226,71 +226,6 @@ 'count' => 6, 'path' => __DIR__ . '/system/CodeIgniter.php', ]; -$ignoreErrors[] = [ - 'message' => '#^Method CodeIgniter\\\\CodeIgniter\\:\\:bootstrapEnvironment\\(\\) has no return type specified\\.$#', - 'count' => 1, - 'path' => __DIR__ . '/system/CodeIgniter.php', -]; -$ignoreErrors[] = [ - 'message' => '#^Method CodeIgniter\\\\CodeIgniter\\:\\:callExit\\(\\) has no return type specified\\.$#', - 'count' => 1, - 'path' => __DIR__ . '/system/CodeIgniter.php', -]; -$ignoreErrors[] = [ - 'message' => '#^Method CodeIgniter\\\\CodeIgniter\\:\\:detectEnvironment\\(\\) has no return type specified\\.$#', - 'count' => 1, - 'path' => __DIR__ . '/system/CodeIgniter.php', -]; -$ignoreErrors[] = [ - 'message' => '#^Method CodeIgniter\\\\CodeIgniter\\:\\:forceSecureAccess\\(\\) has no return type specified\\.$#', - 'count' => 1, - 'path' => __DIR__ . '/system/CodeIgniter.php', -]; -$ignoreErrors[] = [ - 'message' => '#^Method CodeIgniter\\\\CodeIgniter\\:\\:gatherOutput\\(\\) has no return type specified\\.$#', - 'count' => 1, - 'path' => __DIR__ . '/system/CodeIgniter.php', -]; -$ignoreErrors[] = [ - 'message' => '#^Method CodeIgniter\\\\CodeIgniter\\:\\:getRequestObject\\(\\) has no return type specified\\.$#', - 'count' => 1, - 'path' => __DIR__ . '/system/CodeIgniter.php', -]; -$ignoreErrors[] = [ - 'message' => '#^Method CodeIgniter\\\\CodeIgniter\\:\\:getResponseObject\\(\\) has no return type specified\\.$#', - 'count' => 1, - 'path' => __DIR__ . '/system/CodeIgniter.php', -]; -$ignoreErrors[] = [ - 'message' => '#^Method CodeIgniter\\\\CodeIgniter\\:\\:initialize\\(\\) has no return type specified\\.$#', - 'count' => 1, - 'path' => __DIR__ . '/system/CodeIgniter.php', -]; -$ignoreErrors[] = [ - 'message' => '#^Method CodeIgniter\\\\CodeIgniter\\:\\:initializeKint\\(\\) has no return type specified\\.$#', - 'count' => 1, - 'path' => __DIR__ . '/system/CodeIgniter.php', -]; -$ignoreErrors[] = [ - 'message' => '#^Method CodeIgniter\\\\CodeIgniter\\:\\:resolvePlatformExtensions\\(\\) has no return type specified\\.$#', - 'count' => 1, - 'path' => __DIR__ . '/system/CodeIgniter.php', -]; -$ignoreErrors[] = [ - 'message' => '#^Method CodeIgniter\\\\CodeIgniter\\:\\:spoofRequestMethod\\(\\) has no return type specified\\.$#', - 'count' => 1, - 'path' => __DIR__ . '/system/CodeIgniter.php', -]; -$ignoreErrors[] = [ - 'message' => '#^Method CodeIgniter\\\\CodeIgniter\\:\\:startBenchmark\\(\\) has no return type specified\\.$#', - 'count' => 1, - 'path' => __DIR__ . '/system/CodeIgniter.php', -]; -$ignoreErrors[] = [ - 'message' => '#^Method CodeIgniter\\\\CodeIgniter\\:\\:storePreviousURL\\(\\) has no return type specified\\.$#', - 'count' => 1, - 'path' => __DIR__ . '/system/CodeIgniter.php', -]; $ignoreErrors[] = [ 'message' => '#^Only booleans are allowed in an if condition, CodeIgniter\\\\HTTP\\\\ResponseInterface\\|null given\\.$#', 'count' => 1, @@ -3811,11 +3746,6 @@ 'count' => 2, 'path' => __DIR__ . '/system/Test/Mock/MockCache.php', ]; -$ignoreErrors[] = [ - 'message' => '#^Method CodeIgniter\\\\Test\\\\Mock\\\\MockCodeIgniter\\:\\:callExit\\(\\) has no return type specified\\.$#', - 'count' => 1, - 'path' => __DIR__ . '/system/Test/Mock/MockCodeIgniter.php', -]; $ignoreErrors[] = [ 'message' => '#^Cannot access property \\$insert_id on object\\|resource\\|false\\.$#', 'count' => 1, diff --git a/system/CodeIgniter.php b/system/CodeIgniter.php index e017d6b9ccc2..4bde1c042b6d 100644 --- a/system/CodeIgniter.php +++ b/system/CodeIgniter.php @@ -198,6 +198,8 @@ public function __construct(App $config) /** * Handles some basic app and environment setup. + * + * @return void */ public function initialize() { @@ -224,6 +226,8 @@ public function initialize() /** * Checks system for missing required PHP extensions. * + * @return void + * * @throws FrameworkException * * @codeCoverageIgnore @@ -251,6 +255,8 @@ protected function resolvePlatformExtensions() /** * Initializes Kint + * + * @return void */ protected function initializeKint() { @@ -564,6 +570,8 @@ protected function handleRequest(?RouteCollectionInterface $routes, Cache $cache * * @codeCoverageIgnore * + * @return void + * * @deprecated 4.4.0 No longer used. Moved to index.php and spark. */ protected function detectEnvironment() @@ -579,6 +587,8 @@ protected function detectEnvironment() * * If no boot file exists, we shouldn't continue because something * is wrong. At the very least, they should have error reporting setup. + * + * @return void */ protected function bootstrapEnvironment() { @@ -599,6 +609,8 @@ protected function bootstrapEnvironment() * * The timer is used to display total script execution both in the * debug toolbar, and potentially on the displayed page. + * + * @return void */ protected function startBenchmark() { @@ -628,6 +640,8 @@ public function setRequest($request) /** * Get our Request object, (either IncomingRequest or CLIRequest). + * + * @return void */ protected function getRequestObject() { @@ -647,6 +661,8 @@ protected function getRequestObject() /** * Get our Response object, and set some default values, including * the HTTP protocol version and a default successful response. + * + * @return void */ protected function getResponseObject() { @@ -669,6 +685,8 @@ protected function getResponseObject() * * @param int $duration How long the Strict Transport Security * should be enforced for this URL. + * + * @return void */ protected function forceSecureAccess($duration = 31_536_000) { @@ -978,6 +996,8 @@ protected function display404errors(PageNotFoundException $e) * @param ResponseInterface|string|null $returned * * @deprecated $cacheConfig is deprecated. + * + * @return void */ protected function gatherOutput(?Cache $cacheConfig = null, $returned = null) { @@ -1014,6 +1034,8 @@ protected function gatherOutput(?Cache $cacheConfig = null, $returned = null) * This helps provider safer, more reliable previous_url() detection. * * @param string|URI $uri + * + * @return void */ public function storePreviousURL($uri) { @@ -1055,6 +1077,8 @@ public function storePreviousURL($uri) /** * Modifies the Request Object to use a different method if a POST * variable called _method is found. + * + * @return void */ public function spoofRequestMethod() { @@ -1096,6 +1120,8 @@ protected function sendResponse() * @param int $code * * @deprecated 4.4.0 No longer Used. Moved to index.php. + * + * @return void */ protected function callExit($code) {