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.
Completed
Push — master ( d91118...82e905 )
by Freek
11s
created

ArrayFlattenTest::it_flattens_an_array()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 7
Code Lines 4

Duplication

Lines 0
Ratio 0 %

Importance

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