Completed
Push — master ( df8184...e3b994 )
by Aydin
02:31
created

examples/input-text.php (2 issues)

Upgrade to new PHP Analysis Engine

These results are based on our legacy PHP analysis, consider migrating to our new PHP analysis engine instead. Learn more

1
<?php
2
3
use PhpSchool\CliMenu\CliMenu;
4
use PhpSchool\CliMenu\Builder\CliMenuBuilder;
5
6
require_once(__DIR__ . '/../vendor/autoload.php');
7
8
$itemCallable = function (CliMenu $menu) {
9
    $result = $menu->askText()
10
        ->setPlaceholderText('Enter something here')
11
        ->ask();
12
13
    var_dump($result->fetch());
0 ignored issues
show
Security Debugging Code introduced by
var_dump($result->fetch()); looks like debug code. Are you sure you do not want to remove it? This might expose sensitive data.
Loading history...
14
};
15
16
$menu = (new CliMenuBuilder)
17
    ->setTitle('Basic CLI Menu')
18
    ->addItem('Enter text', $itemCallable)
19
    ->addItem('Second Item', $itemCallable)
20
    ->addItem('Third Item', $itemCallable)
21
    ->addLineBreak('-')
22
    ->setMarginAuto('-')
0 ignored issues
show
The call to CliMenuBuilder::setMarginAuto() has too many arguments starting with '-'.

This check compares calls to functions or methods with their respective definitions. If the call has more arguments than are defined, it raises an issue.

If a function is defined several times with a different number of parameters, the check may pick up the wrong definition and report false positives. One codebase where this has been known to happen is Wordpress.

In this case you can add the @ignore PhpDoc annotation to the duplicate definition and it will be ignored.

Loading history...
23
    ->build();
24
25
$menu->open();
26