Skip to content

Commit

Permalink
Reverting my previous phpstan changes and changing the request check …
Browse files Browse the repository at this point in the history
…to fall inline with the type needed in the request property.
  • Loading branch information
dcaswel committed Jan 13, 2021
1 parent bf3e011 commit 8da7f28
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
2 changes: 2 additions & 0 deletions phpstan.neon.dist
Original file line number Diff line number Diff line change
Expand Up @@ -32,10 +32,12 @@ parameters:
- '#Access to an undefined property CodeIgniter\\Database\\Forge::\$dropConstraintStr#'
- '#Access to an undefined property CodeIgniter\\Database\\BaseConnection::\$mysqli|\$schema#'
- '#Access to an undefined property CodeIgniter\\Database\\ConnectionInterface::(\$DBDriver|\$connID|\$likeEscapeStr|\$likeEscapeChar|\$escapeChar|\$protectIdentifiers|\$schema)#'
- '#Access to an undefined property CodeIgniter\\HTTP\\Request::\$uri#'
- '#Access to protected property CodeIgniter\\Database\\BaseConnection::(\$DBDebug|\$DBPrefix|\$swapPre|\$charset|\$DBCollat|\$database)#'
- '#Call to an undefined method CodeIgniter\\Database\\BaseConnection::_(disable|enable)ForeignKeyChecks\(\)#'
- '#Call to an undefined method CodeIgniter\\Database\\BaseConnection::supportsForeignKeys\(\)#'
- '#Call to an undefined method CodeIgniter\\Database\\ConnectionInterface::(tableExists|protectIdentifiers|setAliasedTables|escapeIdentifiers|affectedRows|addTableAlias|getIndexData)\(\)#'
- '#Call to an undefined method CodeIgniter\\HTTP\\Request::(getPath|getSegments|getMethod|setLocale|getPost)\(\)#'
- '#Call to an undefined method CodeIgniter\\Router\\RouteCollectionInterface::(getDefaultNamespace|isFiltered|getFilterForRoute|getRoutesOptions)\(\)#'
- '#Cannot access property [\$a-z_]+ on ((bool\|)?object\|resource)#'
- '#Cannot call method [a-zA-Z_]+\(\) on ((bool\|)?object\|resource)#'
Expand Down
4 changes: 3 additions & 1 deletion system/CodeIgniter.php
Original file line number Diff line number Diff line change
Expand Up @@ -408,7 +408,7 @@ protected function handleRequest(?RouteCollectionInterface $routes, Cache $cache
return $returnResponse ? $possibleResponse : $possibleResponse->pretend($this->useSafeOutput)->send();
}

if ($possibleResponse instanceof RequestInterface)
if ($possibleResponse instanceof Request)
{
$this->request = $possibleResponse;
}
Expand Down Expand Up @@ -586,6 +586,7 @@ protected function getRequestObject()
return;
}

// @phpstan-ignore-next-line
if (is_cli() && ENVIRONMENT !== 'testing')
{
// @codeCoverageIgnoreStart
Expand Down Expand Up @@ -840,6 +841,7 @@ protected function determinePath()
return $this->path;
}

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

Expand Down

0 comments on commit 8da7f28

Please sign in to comment.