Skip to content

Commit

Permalink
qa: remove callable-string as callable strings are callable as well
Browse files Browse the repository at this point in the history
Signed-off-by: Maximilian Bösing <2189546+boesing@users.noreply.github.com>
  • Loading branch information
boesing committed Mar 2, 2024
1 parent ad197bd commit b0ede8c
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/Pattern/CallbackCache.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,12 +22,12 @@ class CallbackCache extends AbstractStorageCapablePattern
/**
* Call the specified callback or get the result from cache
*
* @param callable|callable-string $callback A valid callback
* @param callable $callback A valid callback
* @param array $args Callback arguments
* @throws Exception\RuntimeException If invalid cached data.
* @throws Throwable
*/
public function call(callable|string $callback, array $args = []): mixed
public function call(callable $callback, array $args = []): mixed
{
$options = $this->getOptions();
$storage = $this->getStorage();
Expand Down Expand Up @@ -103,13 +103,13 @@ public function generateKey(callable $callback, array $args = []): string
* Generate a unique key in base of a key representing the callback part
* and a key representing the arguments part.
*
* @param callable|callable-string $callback A valid callback
* @param callable $callback A valid callback
* @param array $args Callback arguments
* @return non-empty-string
* @throws Exception\RuntimeException If callback not serializable.
* @throws Exception\InvalidArgumentException If invalid callback.
*/
protected function generateCallbackKey(callable|string $callback, array $args): string
protected function generateCallbackKey(callable $callback, array $args): string
{
if (! is_callable($callback, false, $callbackKey)) {
throw new Exception\InvalidArgumentException('Invalid callback');
Expand Down

0 comments on commit b0ede8c

Please sign in to comment.