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.

ArrayFlattenTest::it_flattens_an_array()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 7

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
nc 1
nop 0
dl 0
loc 7
rs 10
c 0
b 0
f 0
1
<?php
2
3
namespace Spatie\Test;
4
5
use function spatie\array_flatten;
6
use PHPUnit\Framework\TestCase;
7
8
class ArrayFlattenTest extends TestCase
9
{
10
    /**
11
     * @test
12
     */
13
    public function it_flattens_an_array()
14
    {
15
        $this->assertEquals(
16
            ['a', 'b'],
17
            array_flatten(['a', ['b']])
18
        );
19
    }
20
21
    /**
22
     * @test
23
     */
24
    public function it_recursively_flattens_an_array()
25
    {
26
        $this->assertEquals(
27
            ['a', 'b', 'c', 'd', 'e'],
28
            array_flatten(['a', ['b', ['c'], 'd'], 'e'])
29
        );
30
    }
31
32
    /**
33
     * @test
34
     */
35 View Code Duplication
    public function it_recursively_flattens_an_array_to_a_certain_level()
0 ignored issues
show
Duplication introduced by
This method 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...
36
    {
37
        $this->assertEquals(
38
            ['a', 'b', ['c'], 'd', 'e'],
39
            array_flatten(['a', ['b', ['c'], 'd'], 'e'], 1)
40
        );
41
    }
42
43
    /**
44
     * @test
45
     */
46 View Code Duplication
    public function it_doesnt_flatten_if_the_amount_of_levels_is_0()
0 ignored issues
show
Duplication introduced by
This method 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...
47
    {
48
        $this->assertEquals(
49
            ['a', ['b', ['c'], 'd'], 'e'],
50
            array_flatten(['a', ['b', ['c'], 'd'], 'e'], 0)
51
        );
52
    }
53
}
54