Completed
Pull Request — master (#143)
by
unknown
02:35
created

ContactUsMapperFactory::__invoke()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 9
Code Lines 5

Duplication

Lines 9
Ratio 100 %

Importance

Changes 0
Metric Value
dl 9
loc 9
rs 9.6666
c 0
b 0
f 0
cc 1
eloc 5
nc 1
nop 1
1
<?php
2
3
namespace ContactUs\Mapper;
4
5
use Interop\Container\ContainerInterface;
6
use ContactUs\Entity\ContactUs;
7
use Zend\Db\Adapter\Adapter;
8
use Zend\Db\ResultSet\HydratingResultSet;
9
use Zend\Hydrator\ArraySerializable;
10
11
/**
12
 * Class ContactUsMapperFactory
13
 *
14
 * @package ContactUs\Mapper
15
 * @author  Djordje Stojiljkovic <[email protected]>
16
 */
17
class ContactUsMapperFactory
18
{
19
    /**
20
     * @param  ContainerInterface $container
21
     *
22
     * @return ContactUsMapper
23
     */
24 View Code Duplication
    public function __invoke(ContainerInterface $container): ContactUsMapper
0 ignored issues
show
Duplication introduced by
This method seems to be duplicated in your project.

Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.

You can also find more detailed suggestions in the “Code” section of your repository.

Loading history...
25
    {
26
        $adapter   = $container->get(Adapter::class);
27
        $resultSet = new HydratingResultSet(
28
            new ArraySerializable(), new ContactUs()
29
        );
30
31
        return new ContactUsMapper($adapter, $resultSet);
32
    }
33
}