Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

docs: PHPStan Codeigniter no type specified #7830

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
75 changes: 0 additions & 75 deletions phpstan-baseline.php
Original file line number Diff line number Diff line change
Expand Up @@ -81,76 +81,6 @@
'count' => 1,
'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\\:\\:cache\\(\\) 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' => '#^Property CodeIgniter\\\\CodeIgniter\\:\\:\\$controller type has no signature specified for Closure\\.$#',
'count' => 1,
Expand Down Expand Up @@ -1576,11 +1506,6 @@
'count' => 1,
'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,
Expand Down
29 changes: 29 additions & 0 deletions system/CodeIgniter.php
Original file line number Diff line number Diff line change
Expand Up @@ -176,6 +176,8 @@ public function __construct(App $config)

/**
* Handles some basic app and environment setup.
*
* @return void
*/
public function initialize()
{
Expand Down Expand Up @@ -203,6 +205,8 @@ public function initialize()
/**
* Checks system for missing required PHP extensions.
*
* @return void
*
* @throws FrameworkException
*
* @codeCoverageIgnore
Expand Down Expand Up @@ -230,6 +234,8 @@ protected function resolvePlatformExtensions()

/**
* Initializes Kint
*
* @return void
*/
protected function initializeKint()
{
Expand Down Expand Up @@ -569,6 +575,8 @@ protected function handleRequest(?RouteCollectionInterface $routes, Cache $cache
* testing
* production
*
* @return void
*
* @codeCoverageIgnore
*/
protected function detectEnvironment()
Expand All @@ -584,6 +592,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()
{
Expand All @@ -604,6 +614,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()
{
Expand Down Expand Up @@ -631,6 +643,8 @@ public function setRequest(Request $request)

/**
* Get our Request object, (either IncomingRequest or CLIRequest).
*
* @return void
*/
protected function getRequestObject()
{
Expand All @@ -650,6 +664,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()
{
Expand All @@ -672,6 +688,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)
{
Expand Down Expand Up @@ -722,6 +740,8 @@ public function displayCache(Cache $config)

/**
* Tells the app that the final output should be cached.
*
* @return void
*/
public static function cache(int $time)
{
Expand Down Expand Up @@ -1000,6 +1020,8 @@ protected function display404errors(PageNotFoundException $e)
* @param Cache|null $cacheConfig Deprecated. No longer used.
* @param ResponseInterface|string|null $returned
*
* @return void
*
* @deprecated $cacheConfig is deprecated.
*/
protected function gatherOutput(?Cache $cacheConfig = null, $returned = null)
Expand Down Expand Up @@ -1049,6 +1071,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)
{
Expand Down Expand Up @@ -1090,6 +1114,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()
{
Expand Down Expand Up @@ -1129,6 +1155,9 @@ protected function sendResponse()
* without actually stopping script execution.
*
* @param int $code
*
* @return void
ddevsr marked this conversation as resolved.
Show resolved Hide resolved
* @phpstan-return never
*/
protected function callExit($code)
{
Expand Down