@@ -68,7 +68,7 @@ discard block |
||
| 68 | 68 | /** |
| 69 | 69 | * Add a hook |
| 70 | 70 | * |
| 71 | - * @param mixed $callback The callback function to call |
|
| 71 | + * @param callable $callback The callback function to call |
|
| 72 | 72 | * @param string $hook The name of the hook to add |
| 73 | 73 | * @param string $name The name of the command to hook |
| 74 | 74 | * ('*' for all) |
@@ -82,12 +82,18 @@ discard block |
||
| 82 | 82 | return $this; |
| 83 | 83 | } |
| 84 | 84 | |
| 85 | + /** |
|
| 86 | + * @param \Consolidation\AnnotatedCommand\Parser\CommandInfo $commandInfo |
|
| 87 | + */ |
|
| 85 | 88 | public function recordHookOptions($commandInfo, $name) |
| 86 | 89 | { |
| 87 | 90 | $this->hookOptions[$name][] = $commandInfo; |
| 88 | 91 | return $this; |
| 89 | 92 | } |
| 90 | 93 | |
| 94 | + /** |
|
| 95 | + * @param \Consolidation\AnnotatedCommand\AnnotatedCommand $command |
|
| 96 | + */ |
|
| 91 | 97 | public static function getNames($command, $callback) |
| 92 | 98 | { |
| 93 | 99 | return array_filter( |
@@ -324,6 +330,9 @@ discard block |
||
| 324 | 330 | return $this; |
| 325 | 331 | } |
| 326 | 332 | |
| 333 | + /** |
|
| 334 | + * @param Command $command |
|
| 335 | + */ |
|
| 327 | 336 | public function getHookOptionsForCommand($command) |
| 328 | 337 | { |
| 329 | 338 | $names = $this->addWildcardHooksToNames($command->getNames(), $command->getAnnotationData()); |