Completed
Push — master ( 412ce5...411a6d )
by Freek
26s queued 11s
created

Shell::readline()   A

Complexity

Conditions 3
Paths 3

Size

Total Lines 13

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 13
rs 9.8333
c 0
b 0
f 0
cc 3
nc 3
nop 0
1
<?php
2
3
namespace Spatie\WebTinker\Shell;
4
5
use Psy\Shell as PsyShell;
6
7
class Shell extends PsyShell
8
{
9
    protected function readline()
10
    {
11
        if (!empty($this->inputBuffer)) {
0 ignored issues
show
Bug introduced by scil
The property inputBuffer cannot be accessed from this context as it is declared private in class Psy\Shell.

This check looks for access to properties that are not accessible from the current context.

If you need to make a property accessible to another context you can either raise its visibility level or provide an accessible getter in the defining class.

Loading history...
12
            $line = \array_shift($this->inputBuffer);
0 ignored issues
show
Bug introduced by scil
The property inputBuffer cannot be accessed from this context as it is declared private in class Psy\Shell.

This check looks for access to properties that are not accessible from the current context.

If you need to make a property accessible to another context you can either raise its visibility level or provide an accessible getter in the defining class.

Loading history...
13
            if (!$line instanceof SilentInput) {
0 ignored issues
show
Bug introduced by scil
The class Spatie\WebTinker\Shell\SilentInput does not exist. Did you forget a USE statement, or did you not list all dependencies?

This error could be the result of:

1. Missing dependencies

PHP Analyzer uses your composer.json file (if available) to determine the dependencies of your project and to determine all the available classes and functions. It expects the composer.json to be in the root folder of your repository.

Are you sure this class is defined by one of your dependencies, or did you maybe not list a dependency in either the require or require-dev section?

2. Missing use statement

PHP does not complain about undefined classes in ìnstanceof checks. For example, the following PHP code will work perfectly fine:

if ($x instanceof DoesNotExist) {
    // Do something.
}

If you have not tested against this specific condition, such errors might go unnoticed.

Loading history...
14
                $this->output->writeln(\sprintf('<aside>%s %s</aside>', static::REPLAY, OutputFormatter::escape($line)));
0 ignored issues
show
Bug introduced by scil
The property output cannot be accessed from this context as it is declared private in class Psy\Shell.

This check looks for access to properties that are not accessible from the current context.

If you need to make a property accessible to another context you can either raise its visibility level or provide an accessible getter in the defining class.

Loading history...
15
            }
16
17
            return $line;
18
        }
19
20
        return false;
21
    }
22
}
23