Passed
Push — master ( 041328...8c7a21 )
by IT
03:09
created

SubdirUniqDirectoryNamer::directoryName()   A

Complexity

Conditions 2
Paths 2

Size

Total Lines 7
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 2
eloc 3
nc 2
nop 2
dl 0
loc 7
rs 9.4285
c 0
b 0
f 0
1
<?php
2
3
namespace AppBundle\Services;
4
5
use App\Exception\MethodNotFoundException;
0 ignored issues
show
Bug introduced by
The type App\Exception\MethodNotFoundException was not found. Maybe you did not declare it correctly or list all dependencies?

The issue could also be caused by a filter entry in the build configuration. If the path has been excluded in your configuration, e.g. excluded_paths: ["lib/*"], you can move it to the dependency path list as follows:

filter:
    dependency_paths: ["lib/*"]

For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths

Loading history...
6
use Doctrine\Common\Util\Inflector;
7
use Symfony\Component\Validator\Exception\NoSuchMetadataException;
8
use Vich\UploaderBundle\Mapping\PropertyMapping;
9
use Vich\UploaderBundle\Naming\DirectoryNamerInterface;
10
11
12
class SubdirUniqDirectoryNamer implements DirectoryNamerInterface
13
{
14
    /**
15
     * {@inheritdoc}
16
     */
17
    public function directoryName($object, PropertyMapping $mapping)
18
    {
19
        if (method_exists(!$object, 'getId')) {
20
            throw new MethodNotFoundException();
21
        }
22
23
        return $object->getId();
24
    }
25
}
26