Passed
Push — master ( 18431a...b6753b )
by Gabriel
04:44
created

LocaleTest::test_getOption()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 6

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 6
rs 10
c 0
b 0
f 0
cc 1
nc 1
nop 0
1
<?php
2
3
namespace Nip\Locale\Tests;
4
5
use Nip\Locale\Locale;
6
7
/**
8
 * Class LocaleTest
9
 * @package Nip\Locale\Tests
10
 */
11
class LocaleTest extends AbstractTest
12
{
13
    public function test_getOption()
14
    {
15
        $locale = new Locale();
16
        static::assertSame('d/m/Y H:m', $locale->getOption(['time','dateTimeFormat'], 'ro_RO'));
0 ignored issues
show
Documentation introduced by
'ro_RO' is of type string, but the function expects a boolean.

It seems like the type of the argument is not accepted by the function/method which you are calling.

In some cases, in particular if PHP’s automatic type-juggling kicks in this might be fine. In other cases, however this might be a bug.

We suggest to add an explicit type cast like in the following example:

function acceptsInteger($int) { }

$x = '123'; // string "123"

// Instead of
acceptsInteger($x);

// we recommend to use
acceptsInteger((integer) $x);
Loading history...
17
        static::assertSame('H:m', $locale->getOption(['time','timeFormat'], 'ro_RO'));
0 ignored issues
show
Documentation introduced by
'ro_RO' is of type string, but the function expects a boolean.

It seems like the type of the argument is not accepted by the function/method which you are calling.

In some cases, in particular if PHP’s automatic type-juggling kicks in this might be fine. In other cases, however this might be a bug.

We suggest to add an explicit type cast like in the following example:

function acceptsInteger($int) { }

$x = '123'; // string "123"

// Instead of
acceptsInteger($x);

// we recommend to use
acceptsInteger((integer) $x);
Loading history...
18
    }
19
}
20