| Conditions | 4 |
| Paths | 1 |
| Total Lines | 33 |
| Code Lines | 25 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | #!/usr/bin/php |
||
| 14 | public function setup(): Cmd { |
||
| 15 | return Cmd::root() |
||
| 16 | ->addOption('v|verbose', [ |
||
| 17 | 'description' => 'Flag to enable verbose output' |
||
| 18 | ]) |
||
| 19 | ->addOption('name:', [ |
||
| 20 | 'description' => 'Name option. This option requires a value.', |
||
| 21 | 'isa' => 'string', |
||
| 22 | 'default' => 'World' |
||
| 23 | ]) |
||
| 24 | ->setCallable(static function (Cmd $cmd) { |
||
| 25 | |||
| 26 | $name = $cmd->optionResult->get('name'); |
||
|
|
|||
| 27 | |||
| 28 | self::eol(); |
||
| 29 | self::echo(sprintf('Hello %s', $name), Color::FOREGROUND_COLOR_YELLOW); |
||
| 30 | self::eol(); |
||
| 31 | |||
| 32 | if($cmd->optionResult->has('verbose')) { |
||
| 33 | $keys = array_keys($cmd->optionResult->keys); |
||
| 34 | self::eol(); |
||
| 35 | self::echo('--- VERBOSE OUTPUT ---' . APP::EOL, Color::FOREGROUND_COLOR_GREEN); |
||
| 36 | self::eol(); |
||
| 37 | self::echo(' All current options...' . APP::EOL, Color::FOREGROUND_COLOR_GREEN); |
||
| 38 | foreach($keys as $k) { |
||
| 39 | self::echo(' ' . $k . ': ' . $cmd->optionResult->get($k) . APP::EOL, Color::FOREGROUND_COLOR_GREEN); |
||
| 40 | } |
||
| 41 | self::eol(); |
||
| 42 | |||
| 43 | self::echo(' All current arguments...' . APP::EOL, Color::FOREGROUND_COLOR_GREEN); |
||
| 44 | $args = $cmd->arguments; |
||
| 45 | foreach($args as $a) { |
||
| 46 | self::echo(' ' . $a . APP::EOL, Color::FOREGROUND_COLOR_GREEN); |
||
| 47 | } |
||
| 56 |
This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.
This is most likely a typographical error or the method has been renamed.