Completed
Branch v1.x-dev (59bcf7)
by Benjamin
05:08
created

AbstractTeamCreationTrait   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 12
Duplicated Lines 0 %

Test Coverage

Coverage 0%

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 3
eloc 2
c 1
b 0
f 0
dl 0
loc 12
ccs 0
cts 5
cp 0
rs 10

3 Methods

Rating   Name   Duplication   Size   Complexity  
A getTeamCreationResolver() 0 2 1
A getTeamCreationForm() 0 3 1
A getTeamCreationOptions() 0 2 1
1
<?php
2
3
namespace Obblm\Core\Helper\Rule\Traits;
4
5
use Obblm\Core\Form\Team\BaseTeamOptionsType;
6
use Symfony\Component\Form\Extension\Core\Type\CheckboxType;
7
use Symfony\Component\Form\Extension\Core\Type\NumberType;
8
9
trait AbstractTeamCreationTrait
10
{
11
    abstract public function getMaxTeamCost(): int;
12
    public function getTeamCreationOptions(): array
13
    {
14
    }
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...
15
    public function getTeamCreationForm(): string
16
    {
17
        return BaseTeamOptionsType::class;
18
    }
19
    public function getTeamCreationResolver(): array
20
    {
21
    }
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...
22
}
23