MediaConverterFactory   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 25
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 2

Test Coverage

Coverage 0%

Importance

Changes 1
Bugs 1 Features 0
Metric Value
wmc 2
c 1
b 1
f 0
lcom 0
cbo 2
dl 0
loc 25
ccs 0
cts 8
cp 0
rs 10

1 Method

Rating   Name   Duplication   Size   Complexity  
A createService() 0 17 2
1
<?php
2
3
namespace Soluble\Media\Converter\Service;
4
5
use Soluble\Media\Converter;
6
use Zend\ServiceManager\FactoryInterface;
7
use Zend\ServiceManager\ServiceLocatorInterface;
8
9
class MediaConverterFactory implements FactoryInterface
0 ignored issues
show
Bug introduced by
There is one abstract method __invoke in this class; you could implement it, or declare this class as abstract.
Loading history...
Deprecated Code introduced by
The interface Zend\ServiceManager\FactoryInterface has been deprecated with message: Use Zend\ServiceManager\Factory\FactoryInterface instead.

This class, trait or interface has been deprecated. The supplier of the file has supplied an explanatory message.

The explanatory message should give you some clue as to whether and when the type will be removed from the class and what other constant to use instead.

Loading history...
10
{
11
    /**
12
     *
13
     * @param \Zend\ServiceManager\ServiceLocatorInterface $serviceLocator
14
     * @return \Soluble\Media\Converter
15
     */
16
    public function createService(ServiceLocatorInterface $serviceLocator)
17
    {
18
19
        /*
20
        $config = $serviceLocator->get('Config');
21
        $config = isset($config['Soluble\Normalist']) ? $config['Soluble\Normalist'] : array();
22
        if (empty($config)) {
23
            throw new \Exception("Cannot locate Soluble\Normalist configuration, please review your configuration.");
24
        }
25
        */
26
27
        $converter = new Converter();
28
        if ($serviceLocator->has('Cache\SolubleMediaConverter')) {
29
            $converter->setCache($serviceLocator->get('Cache\SolubleMediaConverter'));
30
        }
31
        return $converter;
32
    }
33
}
34