Completed
Pull Request — master (#14)
by Andreas
02:51
created

GeolocationRendererFactory::__invoke()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 10
Code Lines 4

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 10
rs 9.4285
c 0
b 0
f 0
cc 1
eloc 4
nc 1
nop 3
1
<?php
2
/**
3
 * Copyright Andreas Heigl<[email protected]>
4
 * 
5
 * Permission is hereby granted, free of charge, to any person obtaining a copy
6
 * of this software and associated documentation files (the "Software"), to deal
7
 * in the Software without restriction, including without limitation the rights
8
 * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
 * copies of the Software, and to permit persons to whom the Software is
10
 * furnished to do so, subject to the following conditions:
11
 *
12
 * The above copyright notice and this permission notice shall be included in
13
 * all copies or substantial portions of the Software.
14
 * 
15
 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
 * LIBILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
21
 * THE SOFTWARE.
22
 *
23
 * @author    Andreas Heigl<[email protected]>
24
 * @copyright Andreas Heigl
25
 * @license   http://www.opesource.org/licenses/mit-license.php MIT-License
26
 * @version   0.0
27
 * @since     05.08.14
28
 * @link      https://github.com/heiglandreas/OrgHeiglGeolocation
29
 */
30
31
namespace Org_Heigl\Geolocation\Service;
32
33
use Interop\Container\ContainerInterface;
34
use Org_Heigl\Geolocation\Renderer\Geolocation\GeolocationRenderer;
35
use Zend\ServiceManager\Factory\FactoryInterface;
36
use Zend\ServiceManager\ServiceLocatorInterface;
37
38
class GeolocationRendererFactory implements FactoryInterface
39
{
40
    /**
41
     * Create service
42
     *
43
     * @param ServiceLocatorInterface  $serviceLocator
0 ignored issues
show
Bug introduced by
There is no parameter named $serviceLocator. Was it maybe removed?

This check looks for PHPDoc comments describing methods or function parameters that do not exist on the corresponding method or function.

Consider the following example. The parameter $italy is not defined by the method finale(...).

/**
 * @param array $germany
 * @param array $island
 * @param array $italy
 */
function finale($germany, $island) {
    return "2:1";
}

The most likely cause is that the parameter was removed, but the annotation was not.

Loading history...
44
     *
45
     * @return \OrgHeiglGeolocation\Renderer\GeolocationRenderer
46
     */
47
    public function __invoke(ContainerInterface $container, $requestedName, array $options = null)
48
    {
49
        $renderer = new GeolocationRenderer();
50
        $renderer->setHttpRouter($container->get('HttpRouter'));
51
52
//        $options = $serviceLocator->get('OrgHeiglGeolocation\Options\ModuleOptions');
0 ignored issues
show
Unused Code Comprehensibility introduced by
64% of this comment could be valid code. Did you maybe forget this after debugging?

Sometimes obsolete code just ends up commented out instead of removed. In this case it is better to remove the code once you have checked you do not need it.

The code might also have been commented out for debugging purposes. In this case it is vital that someone uncomments it again or your project may behave in very unexpected ways in production.

This check looks for comments that seem to be mostly valid code and reports them.

Loading history...
53
//        $renderer->setDefaultOptions($options->getRendererOptions($rendererAlias))
54
55
        return $renderer;
56
    }
57
}