Skip to content

Commit 332bfd1

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 7a26aad commit 332bfd1

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
@@ -30,10 +30,12 @@ parameters:
3030
- '#Access to an undefined property CodeIgniter\\Database\\Forge::\$dropConstraintStr#'
3131
- '#Access to an undefined property CodeIgniter\\Database\\BaseConnection::\$mysqli|\$schema#'
3232
- '#Access to an undefined property CodeIgniter\\Database\\ConnectionInterface::(\$DBDriver|\$connID|\$likeEscapeStr|\$likeEscapeChar|\$escapeChar|\$protectIdentifiers|\$schema)#'
33+
- '#Access to an undefined property CodeIgniter\\HTTP\\Request::\$uri#'
3334
- '#Access to protected property CodeIgniter\\Database\\BaseConnection::(\$DBDebug|\$DBPrefix|\$swapPre|\$charset|\$DBCollat|\$database)#'
3435
- '#Call to an undefined method CodeIgniter\\Database\\BaseConnection::_(disable|enable)ForeignKeyChecks\(\)#'
3536
- '#Call to an undefined method CodeIgniter\\Database\\BaseConnection::supportsForeignKeys\(\)#'
3637
- '#Call to an undefined method CodeIgniter\\Database\\ConnectionInterface::(tableExists|protectIdentifiers|setAliasedTables|escapeIdentifiers|affectedRows|addTableAlias|getIndexData)\(\)#'
38+
- '#Call to an undefined method CodeIgniter\\HTTP\\Request::(getPath|getSegments|getMethod|setLocale|getPost)\(\)#'
3739
- '#Call to an undefined method CodeIgniter\\Router\\RouteCollectionInterface::(getDefaultNamespace|isFiltered|getFilterForRoute|getRoutesOptions)\(\)#'
3840
- '#Cannot access property [\$a-z_]+ on ((bool\|)?object\|resource)#'
3941
- '#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 = null, 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
}
@@ -581,6 +581,7 @@ protected function getRequestObject()
581581
return;
582582
}
583583

584+
// @phpstan-ignore-next-line
584585
if (is_cli() && ENVIRONMENT !== 'testing')
585586
{
586587
// @codeCoverageIgnoreStart
@@ -841,6 +842,7 @@ protected function determinePath()
841842
return $this->path;
842843
}
843844

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

0 commit comments

Comments
 (0)