Completed
Push — master ( 4ad177...ddee2e )
by Mathias
33s queued 17s
created

StatusChangeFactory::__invoke()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 8
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 3
dl 0
loc 8
rs 10
c 1
b 0
f 0
cc 1
nc 1
nop 3
1
<?php
2
3
/**
4
 * YAWIK
5
 *
6
 * @see       https://github.com/cross-solution/YAWIK for the canonical source repository
7
 * @copyright https://github.com/cross-solution/YAWIK/blob/master/COPYRIGHT
8
 * @license   https://github.com/cross-solution/YAWIK/blob/master/LICENSE
9
 */
10
11
declare(strict_types=1);
12
13
namespace Applications\Mail;
14
15
use Psr\Container\ContainerInterface;
16
17
/**
18
 * Factory for \Applications\Mail\StatusChange
19
 *
20
 * @author Mathias Gelhausen
21
 * TODO: write tests
22
 */
23
class StatusChangeFactory
24
{
25
    public function __invoke(
26
        ContainerInterface $container,
27
        string $requestedName,
28
        ?array $options = null
29
    ): StatusChange {
30
        return new StatusChange(
31
            $container->get('Router'),
32
            $options
0 ignored issues
show
Bug introduced by
It seems like $options can also be of type null; however, parameter $options of Applications\Mail\StatusChange::__construct() does only seem to accept array, maybe add an additional type check? ( Ignorable by Annotation )

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

32
            /** @scrutinizer ignore-type */ $options
Loading history...
33
        );
34
    }
35
}
36