SitemapFactory   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 10
Duplicated Lines 0 %

Test Coverage

Coverage 0%

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 1
eloc 6
dl 0
loc 10
ccs 0
cts 6
cp 0
rs 10
c 1
b 0
f 0

1 Method

Rating   Name   Duplication   Size   Complexity  
A __invoke() 0 8 1
1
<?php
2
3
declare(strict_types=1);
4
5
namespace Application\Handler;
6
7
use Application\Model\News;
8
use Application\Model\Product;
9
use Doctrine\ORM\EntityManager;
10
use Psr\Container\ContainerInterface;
11
12
class SitemapFactory
13
{
14
    public function __invoke(ContainerInterface $container): SitemapHandler
15
    {
16
        $config = $container->get('config');
17
        $entityManager = $container->get(EntityManager::class);
18
        $productRepository = $entityManager->getRepository(Product::class);
19
        $newsRepository = $entityManager->getRepository(News::class);
20
21
        return new SitemapHandler($productRepository, $newsRepository, $config['baseUrl'], $config['sitemapStaticPages']);
22
    }
23
}
24