Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 9 additions & 9 deletions phpstan-baseline.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
<?php declare(strict_types = 1);

$ignoreErrors = [];
$ignoreErrors[] = [
'message' => '#^Call to an undefined method BlitzPHP\\\\Traits\\\\Mixins\\\\HigherOrderCollectionProxy\\:\\:__invoke\\(\\)\\.$#',
'count' => 1,
'path' => __DIR__ . '/src/Cli/Commands/Utilities/About.php',
];
$ignoreErrors[] = [
'message' => '#^Call to an undefined method Ahc\\\\Cli\\\\Output\\\\Writer\\:\\:errorBold\\(\\)\\.$#',
'count' => 1,
Expand Down Expand Up @@ -28,7 +33,7 @@
];
$ignoreErrors[] = [
'message' => '#^Call to an undefined method Ahc\\\\Cli\\\\Application\\|Ahc\\\\Cli\\\\IO\\\\Interactor\\:\\:write\\(\\)\\.$#',
'count' => 2,
'count' => 1,
'path' => __DIR__ . '/src/Cli/Console/Console.php',
];
$ignoreErrors[] = [
Expand Down Expand Up @@ -552,14 +557,9 @@
'path' => __DIR__ . '/src/Router/Dispatcher.php',
];
$ignoreErrors[] = [
'message' => '#^Call to method getKeyName\\(\\) on an unknown class BlitzPHP\\\\Wolke\\\\Model\\.$#',
'count' => 1,
'path' => __DIR__ . '/src/Validation/Rules/Unique.php',
];
$ignoreErrors[] = [
'message' => '#^Parameter \\$entity of method BlitzPHP\\\\Validation\\\\Rules\\\\Unique\\:\\:ignoreModel\\(\\) has invalid type BlitzPHP\\\\Wolke\\\\Model\\.$#',
'count' => 1,
'path' => __DIR__ . '/src/Validation/Rules/Unique.php',
'message' => '#^Function expect not found\\.$#',
'count' => 3,
'path' => __DIR__ . '/src/Spec/Mock/MockCache.php',
];
$ignoreErrors[] = [
'message' => '#^Call to method directive\\(\\) on an unknown class Jenssegers\\\\Blade\\\\Blade\\.$#',
Expand Down
2 changes: 1 addition & 1 deletion src/Cli/Console/Command.php
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
* @property array $options
* @property array $required
* @property string $service
* @property bool $supress
* @property bool $suppress
* @property string $usage
* @property string $version
*/
Expand Down
13 changes: 11 additions & 2 deletions src/Spec/Mock/MockCache.php
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@ public function set(string $key, mixed $value, null|DateInterval|int $ttl = null
}

$key = $this->_key($key);
$ttl = $ttl instanceof DateInterval ? $ttl->s : $ttl;

$this->cache[$key] = $value;
$this->expirations[$key] = $ttl > 0 ? Date::now()->getTimestamp() + $ttl : null;
Expand Down Expand Up @@ -115,7 +116,11 @@ public function increment(string $key, int $offset = 1)
return false;
}

return $this->set($key, $data + $offset);
if (false !== $this->set($key, $increment = $data + $offset)) {
return $increment;
}

return false;
}

/**
Expand All @@ -133,7 +138,11 @@ public function decrement(string $key, int $offset = 1)
return false;
}

return $this->set($key, $data - $offset);
if (false !== $this->set($key, $decrement = $data - $offset)) {
return $decrement;
}

return false;
}

/**
Expand Down