Passed
Push — 7.x ( 3ebc9f...4982c4 )
by Adrien
08:52
created

SplFloatUnstrictTest::test()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 6
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 1
Metric Value
cc 1
eloc 3
c 1
b 0
f 1
nc 1
nop 0
dl 0
loc 6
rs 10
1
<?php
2
3
/**
4
 * Part of SplTypes package.
5
 *
6
 * (c) Adrien Loyant <[email protected]>
7
 *
8
 * For the full copyright and license information, please view the LICENSE
9
 * file that was distributed with this source code.
10
 */
11
12
declare(strict_types=0);
13
14
namespace Ducks\Component\SplTypes\Tests\phpunit;
15
16
use Ducks\Component\SplTypes\SplFloat as DuckFloat;
17
use PHPUnit\Framework\TestCase;
18
19
class SplFloatUnstrictTest extends TestCase
20
{
21
    /**
22
     * Unit test.
23
     *
24
     * @return void
25
     *
26
     * @psalm-suppress InvalidScalarArgument
27
     */
28
    public function test(): void
29
    {
30
        // @phpstan-ignore-next-line
31
        $instance = new DuckFloat('10.1');
0 ignored issues
show
Bug introduced by
'10.1' of type string is incompatible with the type double expected by parameter $initial_value of Ducks\Component\SplTypes\SplFloat::__construct(). ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-type  annotation

31
        $instance = new DuckFloat(/** @scrutinizer ignore-type */ '10.1');
Loading history...
32
        $this->assertSame(10.1, $instance());
33
        unset($instance);
34
    }
35
}
36