GitHub Access Token became invalid

It seems like the GitHub access token used for retrieving details about this repository from GitHub became invalid. This might prevent certain types of inspections from being run (in particular, everything related to pull requests).
Please ask an admin of your repository to re-new the access token on this website.

RandomSeed::draw()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 12

Duplication

Lines 12
Ratio 100 %

Importance

Changes 0
Metric Value
dl 12
loc 12
rs 9.8666
c 0
b 0
f 0
cc 1
nc 1
nop 0
1
<?php
2
3
namespace Spatie\PhpUnitWatcher\Screens;
4
5 View Code Duplication
class RandomSeed extends Screen
0 ignored issues
show
Duplication introduced by
This class seems to be duplicated in your project.

Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.

You can also find more detailed suggestions in the “Code” section of your repository.

Loading history...
6
{
7
    public function draw()
8
    {
9
        $this->terminal
10
            ->comment('Random seed usage')
11
            ->write('Type a seed and press Enter to run tests in random order but with a specific seed.')
12
            ->write('Press Enter with an empty pattern to execute all tests in random order.')
13
            ->emptyLine()
14
            ->comment('Start typing to add a random seed')
15
            ->prompt('seed > ');
16
17
        return $this;
18
    }
19
20
    public function registerListeners()
21
    {
22
        $this->terminal->on('data', function ($line) {
23
            $phpunitArguments = '--order-by=random';
24
            if ($line !== '') {
25
                $phpunitArguments .= " --random-order-seed={$line}";
26
            }
27
28
            $phpunitScreen = $this->terminal->getPreviousScreen();
29
30
            $options = $phpunitScreen->options;
0 ignored issues
show
Bug introduced by
The property options does not seem to exist in Spatie\PhpUnitWatcher\Screens\Screen.

An attempt at access to an undefined property has been detected. This may either be a typographical error or the property has been renamed but there are still references to its old name.

If you really want to allow access to undefined properties, you can define magic methods to allow access. See the php core documentation on Overloading.

Loading history...
31
32
            $options['phpunit']['arguments'] = $phpunitArguments;
33
34
            $this->terminal->displayScreen(new Phpunit($options));
35
        });
36
37
        return $this;
38
    }
39
}
40