Skip to content

Commit 8da7f28

Browse files
committed
Reverting my previous phpstan changes and changing the request check to fall inline with the type needed in the request property.
1 parent bf3e011 commit 8da7f28

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

phpstan.neon.dist

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,10 +32,12 @@ parameters:
3232
- '#Access to an undefined property CodeIgniter\\Database\\Forge::\$dropConstraintStr#'
3333
- '#Access to an undefined property CodeIgniter\\Database\\BaseConnection::\$mysqli|\$schema#'
3434
- '#Access to an undefined property CodeIgniter\\Database\\ConnectionInterface::(\$DBDriver|\$connID|\$likeEscapeStr|\$likeEscapeChar|\$escapeChar|\$protectIdentifiers|\$schema)#'
35+
- '#Access to an undefined property CodeIgniter\\HTTP\\Request::\$uri#'
3536
- '#Access to protected property CodeIgniter\\Database\\BaseConnection::(\$DBDebug|\$DBPrefix|\$swapPre|\$charset|\$DBCollat|\$database)#'
3637
- '#Call to an undefined method CodeIgniter\\Database\\BaseConnection::_(disable|enable)ForeignKeyChecks\(\)#'
3738
- '#Call to an undefined method CodeIgniter\\Database\\BaseConnection::supportsForeignKeys\(\)#'
3839
- '#Call to an undefined method CodeIgniter\\Database\\ConnectionInterface::(tableExists|protectIdentifiers|setAliasedTables|escapeIdentifiers|affectedRows|addTableAlias|getIndexData)\(\)#'
40+
- '#Call to an undefined method CodeIgniter\\HTTP\\Request::(getPath|getSegments|getMethod|setLocale|getPost)\(\)#'
3941
- '#Call to an undefined method CodeIgniter\\Router\\RouteCollectionInterface::(getDefaultNamespace|isFiltered|getFilterForRoute|getRoutesOptions)\(\)#'
4042
- '#Cannot access property [\$a-z_]+ on ((bool\|)?object\|resource)#'
4143
- '#Cannot call method [a-zA-Z_]+\(\) on ((bool\|)?object\|resource)#'

system/CodeIgniter.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -408,7 +408,7 @@ protected function handleRequest(?RouteCollectionInterface $routes, Cache $cache
408408
return $returnResponse ? $possibleResponse : $possibleResponse->pretend($this->useSafeOutput)->send();
409409
}
410410

411-
if ($possibleResponse instanceof RequestInterface)
411+
if ($possibleResponse instanceof Request)
412412
{
413413
$this->request = $possibleResponse;
414414
}
@@ -586,6 +586,7 @@ protected function getRequestObject()
586586
return;
587587
}
588588

589+
// @phpstan-ignore-next-line
589590
if (is_cli() && ENVIRONMENT !== 'testing')
590591
{
591592
// @codeCoverageIgnoreStart
@@ -840,6 +841,7 @@ protected function determinePath()
840841
return $this->path;
841842
}
842843

844+
// @phpstan-ignore-next-line
843845
return (is_cli() && ! (ENVIRONMENT === 'testing')) ? $this->request->getPath() : $this->request->uri->getPath();
844846
}
845847

0 commit comments

Comments
 (0)