CommentFactory::__construct()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 7

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 0
Metric Value
dl 0
loc 7
ccs 0
cts 0
cp 0
rs 10
c 0
b 0
f 0
cc 1
nc 1
nop 4
crap 2
1
<?php
2
3
namespace Skobkin\Bundle\PointToolsBundle\Service\Factory\Blogs;
4
5
use Psr\Log\LoggerInterface;
6
use Skobkin\Bundle\PointToolsBundle\Repository\Blogs\{CommentRepository, PostRepository};
7
use Skobkin\Bundle\PointToolsBundle\Service\Factory\{AbstractFactory, UserFactory};
8
9
class CommentFactory extends AbstractFactory
10
{
11
    /** @var CommentRepository */
12
    private $commentRepository;
13
14
    /** @var PostRepository */
15
    private $postRepository;
16
17
    /** @var UserFactory */
18
    private $userFactory;
19
20
21
    public function __construct(LoggerInterface $logger, CommentRepository $commentRepository, PostRepository $postRepository, UserFactory $userFactory)
22
    {
23
        parent::__construct($logger);
24
        $this->userFactory = $userFactory;
0 ignored issues
show
Documentation Bug introduced by
It seems like $userFactory of type object<Skobkin\Bundle\Po...ce\Factory\UserFactory> is incompatible with the declared type object<UserFactory> of property $userFactory.

Our type inference engine has found an assignment to a property that is incompatible with the declared type of that property.

Either this assignment is in error or the assigned type should be added to the documentation/type hint for that property..

Loading history...
25
        $this->commentRepository = $commentRepository;
0 ignored issues
show
Documentation Bug introduced by
It seems like $commentRepository of type object<Skobkin\Bundle\Po...logs\CommentRepository> is incompatible with the declared type object<CommentRepository> of property $commentRepository.

Our type inference engine has found an assignment to a property that is incompatible with the declared type of that property.

Either this assignment is in error or the assigned type should be added to the documentation/type hint for that property..

Loading history...
26
        $this->postRepository = $postRepository;
0 ignored issues
show
Documentation Bug introduced by
It seems like $postRepository of type object<Skobkin\Bundle\Po...y\Blogs\PostRepository> is incompatible with the declared type object<PostRepository> of property $postRepository.

Our type inference engine has found an assignment to a property that is incompatible with the declared type of that property.

Either this assignment is in error or the assigned type should be added to the documentation/type hint for that property..

Loading history...
27
    }
28
}