Skip to content
This repository has been archived by the owner on May 15, 2021. It is now read-only.

Commit

Permalink
:octocat: \Closure -> callable
Browse files Browse the repository at this point in the history
  • Loading branch information
codemasher committed Jan 21, 2018
1 parent c15335e commit ccbea32
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions src/Enumerable.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,6 @@

namespace chillerlan\Traits;

use Closure;

/**
* @link http://api.prototypejs.org/language/Enumerable/
*/
Expand Down Expand Up @@ -117,12 +115,12 @@ public function __inspect():string {
/**
* @link http://api.prototypejs.org/language/Enumerable/prototype/findAll/
*
* @param \Closure $callback
* @param callable $callback
*
* @return array
* @throws \chillerlan\Traits\TraitException
*/
public function __findAll(Closure $callback):array{
public function __findAll(callable $callback):array{

if(!is_callable($callback)){
throw new TraitException('invalid callback');
Expand All @@ -144,12 +142,12 @@ public function __findAll(Closure $callback):array{
/**
* @link http://api.prototypejs.org/language/Enumerable/prototype/reject/
*
* @param \Closure $callback
* @param callable $callback
*
* @return array
* @throws \chillerlan\Traits\TraitException
*/
public function __reject(Closure $callback):array{
public function __reject(callable $callback):array{

if(!is_callable($callback)){
throw new TraitException('invalid callback');
Expand Down

0 comments on commit ccbea32

Please sign in to comment.