-
Notifications
You must be signed in to change notification settings - Fork 19
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #5 from esemve/analysis-8K4GO3
Apply fixes from StyleCI
- Loading branch information
Showing
5 changed files
with
98 additions
and
88 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,52 +1,48 @@ | ||
<?php | ||
|
||
namespace Esemve\Hook\Console; | ||
|
||
use Illuminate\Console\Command; | ||
use Cache; | ||
use Hook; | ||
|
||
class HookListeners extends Command | ||
{ | ||
/** | ||
* The name and signature of the console command. | ||
* | ||
* @var string | ||
*/ | ||
protected $signature = 'hook:list'; | ||
|
||
/** | ||
* The console command description. | ||
* | ||
* @var string | ||
*/ | ||
protected $description = 'List all hook listeners'; | ||
|
||
/** | ||
* Execute the console command. | ||
* | ||
* @return mixed | ||
*/ | ||
public function handle() | ||
{ | ||
|
||
$list = Hook::getListeners(); | ||
$array = []; | ||
|
||
foreach ($list as $hook => $lister) { | ||
foreach ($lister as $key => $element) { | ||
|
||
$array[] = [ | ||
$key, | ||
$hook, | ||
$element['caller']['class'] | ||
]; | ||
} | ||
} | ||
|
||
$headers = ['Sort', 'Hook name', 'Listener class']; | ||
|
||
$this->table($headers, $array); | ||
|
||
} | ||
} | ||
<?php | ||
|
||
namespace Esemve\Hook\Console; | ||
|
||
use Hook; | ||
use Illuminate\Console\Command; | ||
|
||
class HookListeners extends Command | ||
{ | ||
/** | ||
* The name and signature of the console command. | ||
* | ||
* @var string | ||
*/ | ||
protected $signature = 'hook:list'; | ||
|
||
/** | ||
* The console command description. | ||
* | ||
* @var string | ||
*/ | ||
protected $description = 'List all hook listeners'; | ||
|
||
/** | ||
* Execute the console command. | ||
* | ||
* @return mixed | ||
*/ | ||
public function handle() | ||
{ | ||
$list = Hook::getListeners(); | ||
$array = []; | ||
|
||
foreach ($list as $hook => $lister) { | ||
foreach ($lister as $key => $element) { | ||
$array[] = [ | ||
$key, | ||
$hook, | ||
$element['caller']['class'], | ||
]; | ||
} | ||
} | ||
|
||
$headers = ['Sort', 'Hook name', 'Listener class']; | ||
|
||
$this->table($headers, $array); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -10,4 +10,4 @@ protected static function getFacadeAccessor() | |
{ | ||
return 'Hook'; | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters