Passed
Push — master ( 04da79...785494 )
by Tomasz
01:35
created

src/Api/Command/CreateRelationship/Command.php (2 issues)

1
<?php
2
/**
3
 *
4
 * This file is part of the Aggrego.
5
 * (c) Tomasz Kunicki <[email protected]>
6
 *
7
 * For the full copyright and license information, please view the LICENSE
8
 * file that was distributed with this source code.
9
 *
10
 */
11
12
namespace Aggrego\Neo4jIntegration\Api\Command\CreateRelationship;
13
14
use Aggrego\CommandConsumer\Command as CommandConsumer;
15
use Aggrego\CommandConsumer\Name;
16
17
class Command implements CommandConsumer
18
{
19
    public function getName(): Name
20
    {
21
        // TODO: Implement getName() method.
22
    }
0 ignored issues
show
Bug Best Practice introduced by
In this branch, the function will implicitly return null which is incompatible with the type-hinted return Aggrego\CommandConsumer\Name. Consider adding a return statement or allowing null as return value.

For hinted functions/methods where all return statements with the correct type are only reachable via conditions, ?null? gets implicitly returned which may be incompatible with the hinted type. Let?s take a look at an example:

interface ReturnsInt {
    public function returnsIntHinted(): int;
}

class MyClass implements ReturnsInt {
    public function returnsIntHinted(): int
    {
        if (foo()) {
            return 123;
        }
        // here: null is implicitly returned
    }
}
Loading history...
23
24
    public function getPayload(): array
25
    {
26
        // TODO: Implement getPayload() method.
27
    }
0 ignored issues
show
Bug Best Practice introduced by
In this branch, the function will implicitly return null which is incompatible with the type-hinted return array. Consider adding a return statement or allowing null as return value.

For hinted functions/methods where all return statements with the correct type are only reachable via conditions, ?null? gets implicitly returned which may be incompatible with the hinted type. Let?s take a look at an example:

interface ReturnsInt {
    public function returnsIntHinted(): int;
}

class MyClass implements ReturnsInt {
    public function returnsIntHinted(): int
    {
        if (foo()) {
            return 123;
        }
        // here: null is implicitly returned
    }
}
Loading history...
28
}
29