Failed Conditions
Pull Request — develop (#3179)
by Sergei
130:20 queued 65:17
created

BlobTest::testBinaryResourceConvertsToPHPValue()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 6
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 6
rs 9.4285
c 0
b 0
f 0
cc 1
eloc 3
nc 1
nop 0
1
<?php
2
3
namespace Doctrine\Tests\DBAL\Types;
4
5
use Doctrine\DBAL\Types\Type;
6
use Doctrine\Tests\DBAL\Mocks\MockPlatform;
7
use function base64_encode;
8
use function chr;
9
use function fopen;
10
use function stream_get_contents;
11
12
class BlobTest extends \Doctrine\Tests\DbalTestCase
13
{
14
    /**
15
     * @var \Doctrine\Tests\DBAL\Mocks\MockPlatform
16
     */
17
    protected $platform;
18
19
    /**
20
     * @var \Doctrine\DBAL\Types\BlobType
21
     */
22
    protected $type;
23
24
    /**
25
     * {@inheritdoc}
26
     */
27
    protected function setUp()
28
    {
29
        $this->platform = new MockPlatform();
30
        $this->type = Type::getType('blob');
31
    }
32
33
    public function testBlobNullConvertsToPHPValue()
34
    {
35
        self::assertNull($this->type->convertToPHPValue(null, $this->platform));
0 ignored issues
show
Bug introduced by
Are you sure the usage of $this->type->convertToPH...(null, $this->platform) targeting Doctrine\DBAL\Types\BlobType::convertToPHPValue() seems to always return null.

This check looks for function or method calls that always return null and whose return value is used.

class A
{
    function getObject()
    {
        return null;
    }

}

$a = new A();
if ($a->getObject()) {

The method getObject() can return nothing but null, so it makes no sense to use the return value.

The reason is most likely that a function or method is imcomplete or has been reduced for debug purposes.

Loading history...
36
    }
37
}
38