Skip to content

Commit

Permalink
Merge pull request #7948 from ddevsr/codeigniter-specified-type
Browse files Browse the repository at this point in the history
docs: PHPStan `Codeigniter` no type specified
  • Loading branch information
kenjis authored Sep 19, 2023
2 parents 00ba7fb + 02ec2d9 commit f0af89d
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 70 deletions.
70 changes: 0 additions & 70 deletions phpstan-baseline.php
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -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,
Expand Down
26 changes: 26 additions & 0 deletions system/CodeIgniter.php
Original file line number Diff line number Diff line change
Expand Up @@ -198,6 +198,8 @@ public function __construct(App $config)

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

/**
* Initializes Kint
*
* @return void
*/
protected function initializeKint()
{
Expand Down Expand Up @@ -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()
Expand All @@ -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()
{
Expand All @@ -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()
{
Expand Down Expand Up @@ -628,6 +640,8 @@ public function setRequest($request)

/**
* Get our Request object, (either IncomingRequest or CLIRequest).
*
* @return void
*/
protected function getRequestObject()
{
Expand All @@ -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()
{
Expand All @@ -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)
{
Expand Down Expand Up @@ -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)
{
Expand Down Expand Up @@ -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)
{
Expand Down Expand Up @@ -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()
{
Expand Down Expand Up @@ -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)
{
Expand Down

0 comments on commit f0af89d

Please sign in to comment.