Skip to content

Commit

Permalink
Phpstan: v0.12
Browse files Browse the repository at this point in the history
  • Loading branch information
f3l1x committed Jan 9, 2021
1 parent 5c32d25 commit 73c8edd
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 10 deletions.
13 changes: 6 additions & 7 deletions phpstan.neon
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
includes:
- vendor/phpstan/phpstan-deprecation-rules/rules.neon
- vendor/phpstan/phpstan-nette/extension.neon
- vendor/phpstan/phpstan-nette/rules.neon
- vendor/phpstan/phpstan-strict-rules/rules.neon

parameters:
ignoreErrors:
# Intentional, typehint is defined in phpdoc only
- message: '#^Instanceof between DateTimeInterface and DateTimeInterface will always evaluate to true\.$#'
path: %currentWorkingDirectory%/src/CacheItem.php

- message: '#^Call to function is_int\(\) with int will always evaluate to true\.$#'
path: %currentWorkingDirectory%/src/CacheItem.php

- message: '#^Call to function is_string\(\) with string will always evaluate to true\.$#'
path: %currentWorkingDirectory%/src/CachePool.php
4 changes: 2 additions & 2 deletions src/CacheItem.php
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ public function set($value): self
}

/**
* @param DateTimeInterface|null $expiration
* @param DateTimeInterface|mixed|null $expiration
* @return static
* @phpcsSuppress SlevomatCodingStandard.TypeHints.TypeHintDeclaration.MissingParameterTypeHint
*/
Expand All @@ -78,7 +78,7 @@ public function expiresAt($expiration): self
}

/**
* @param int|DateInterval|null $time
* @param int|DateInterval|mixed|null $time
* @return static
*/
public function expiresAfter($time): self
Expand Down
2 changes: 1 addition & 1 deletion src/CachePool.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ public function __construct(Cache $cache)
$this->internal = $cache;

$this->createItem = Closure::bind(
static function (string $key, $value) {
static function (string $key, $value): CacheItem {
$item = new CacheItem();
$item->key = $key;
$item->value = $value;
Expand Down

0 comments on commit 73c8edd

Please sign in to comment.