Skip to content

Commit

Permalink
PHPSTAN MAX
Browse files Browse the repository at this point in the history
  • Loading branch information
magroski committed Nov 17, 2022
1 parent af96ca4 commit c40258f
Show file tree
Hide file tree
Showing 6 changed files with 36 additions and 4 deletions.
30 changes: 30 additions & 0 deletions phpstan-baseline.neon
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
parameters:
ignoreErrors:
-
message: "#^Parameter \\#1 \\$string of function htmlspecialchars expects string, mixed given\\.$#"
count: 2
path: src/Controller.php

-
message: "#^Constant ENCRYPTION_TYPE not found\\.$#"
count: 1
Expand Down Expand Up @@ -60,6 +65,16 @@ parameters:
count: 1
path: src/Model/Criteria.php

-
message: "#^Method Frogg\\\\Model\\\\Criteria\\:\\:execute\\(\\) should return Phalcon\\\\Mvc\\\\Model\\\\ResultsetInterface but returns mixed\\.$#"
count: 1
path: src/Model/Criteria.php

-
message: "#^Parameter \\#2 \\$arguments of method Frogg\\\\Model\\\\Criteria\\:\\:addCriteria\\(\\) expects array, mixed given\\.$#"
count: 1
path: src/Model/Criteria.php

-
message: "#^Method Frogg\\\\Plugins\\\\Auth\\:\\:beforeExecuteRoute\\(\\) has no return type specified\\.$#"
count: 1
Expand All @@ -69,3 +84,18 @@ parameters:
message: "#^Method Frogg\\\\Services\\\\AbstractDiBuilder\\:\\:__construct\\(\\) has parameter \\$config with no value type specified in iterable type Phalcon\\\\Config\\\\Config\\.$#"
count: 1
path: src/Services/AbstractDiBuilder.php

-
message: "#^Cannot access property \\$results on mixed\\.$#"
count: 1
path: src/Services/GMaps.php

-
message: "#^Cannot access property \\$rows on mixed\\.$#"
count: 3
path: src/Services/GMaps.php

-
message: "#^Parameter \\#1 \\$string of function urlencode expects string, mixed given\\.$#"
count: 2
path: src/Services/GMaps.php
2 changes: 1 addition & 1 deletion phpstan.neon
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
parameters:
parallel:
maximumNumberOfProcesses: 4
level: 8
level: max
paths:
- src/
scanDirectories:
Expand Down
3 changes: 2 additions & 1 deletion src/Controller.php
Original file line number Diff line number Diff line change
Expand Up @@ -302,7 +302,7 @@ public function setJsonResponse($data = []) : ResponseInterface
*
* @param string $route
*
* @return mixed
* @return null|array<string,string>
*/
public function extractRoutePath(string $route)
{
Expand All @@ -323,6 +323,7 @@ private function url(string $routeName, array $params = [], array $query = []) :
throw new \RuntimeException('Container does not exist');
}
$params = array_merge(['for' => $routeName], $params);
/** @var \Phalcon\Mvc\Url $url */
$url = $di->get('url');
$url->setBaseUri('/');

Expand Down
1 change: 1 addition & 0 deletions src/Model.php
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,7 @@ public function tokenId(string $key) : string

public static function getByTokenId(string $token, string $key) : ?ModelInterface
{
/** @var object $data */
$data = WT::decode($token, $key);

return isset($data->id) ? static::findFirstById($data->id) : null;
Expand Down
2 changes: 1 addition & 1 deletion src/Model/Criteria.php
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,7 @@ public function getQuery() : PhalconModel\QueryInterface
}

/**
* @return string[]
* @return mixed[]
*/
public function getActiveCriterias() : array
{
Expand Down
2 changes: 1 addition & 1 deletion src/Model/ResultSet.php
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ public function isNotEmpty() : bool
/**
* Returns an array containing the id of each object in the ResultSet
*
* @return array<int|string>
* @return array<mixed>
* @throws InvalidAttributeException When the object has no 'id' field
*/
public function getIds() : array
Expand Down

0 comments on commit c40258f

Please sign in to comment.