Passed
Push — master ( 738022...b95edc )
by Timm
01:55
created

anonymous//examples/cli-app-helloworld.php$0   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 6
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 4
dl 0
loc 6
rs 10
c 1
b 0
f 0
wmc 1

1 Method

Rating   Name   Duplication   Size   Complexity  
A cli-app-helloworld.php$0 ➔ setup() 0 4 1
1
#!/usr/bin/php
2
<?php
3
4
require __DIR__ . '/../vendor/autoload.php';
5
6
use Stefaminator\Cli\App;
7
use Stefaminator\Cli\AppParser;
8
use Stefaminator\Cli\Cmd;
9
10
AppParser::run(
11
    (new class extends App {
12
13
        public function setup(): Cmd {
14
            return Cmd::root()
15
                ->setCallable(static function (Cmd $cmd) {
0 ignored issues
show
Unused Code introduced by
The parameter $cmd is not used and could be removed. ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-unused  annotation

15
                ->setCallable(static function (/** @scrutinizer ignore-unused */ Cmd $cmd) {

This check looks for parameters that have been defined for a function or method, but which are not used in the method body.

Loading history...
16
                    echo 'Hello World' . self::EOL;
17
                });
18
        }
19
20
    })
21
);
22