Skip to content

Commit

Permalink
replaced call_user_func_array by call_user_func
Browse files Browse the repository at this point in the history
  • Loading branch information
Mike Gladysch committed Mar 31, 2016
1 parent 84d9472 commit 6514d24
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions src/glady/Behind/ClassLoader/ClassLoader.php
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,7 @@ private function getFileNameByRule(array $rule, $className)
$type = $this->getFromArray($rule, 'type');
switch ($type) {
case 'callback':
$fileName = call_user_func_array($rule['fn'], array($className));
$fileName = call_user_func($rule['fn'], $className);
break;

case 'map':
Expand Down Expand Up @@ -393,7 +393,7 @@ private function executeEventCallback($eventName, $eventIndex, array $eventData
{
// execute callback
$eventCallable = $this->events[$eventName][$eventIndex]['callable'];
$return = call_user_func_array($eventCallable, array($this, $eventName, $eventData));
$return = call_user_func($eventCallable, $this, $eventName, $eventData);
// decrease remaining runs
$this->events[$eventName][$eventIndex]['count']--;
if ($this->events[$eventName][$eventIndex]['count'] === 0) {
Expand Down
4 changes: 2 additions & 2 deletions src/glady/Behind/Utils/File/Iterator.php
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ public function forEachFile($callable, $fileNamePattern = null)
foreach ($this->getIterator() as $fileInfo) {
if ($fileInfo->isFile() && $this->fileNameMatches($fileInfo, $fileNamePattern)) {
$file = new File($fileInfo->openFile());
call_user_func_array($callable, array($file));
call_user_func($callable, $file);
$file = null;
$fileInfo = null;
}
Expand All @@ -63,7 +63,7 @@ public function forEachDirectory($callable)
foreach ($this->getIterator() as $fileInfo) {
if ($fileInfo->isDir()) {
$dir = new Directory($fileInfo);
call_user_func_array($callable, array($dir));
call_user_func($callable, $dir);
$dir = null;
$fileInfo = null;
}
Expand Down

0 comments on commit 6514d24

Please sign in to comment.