Completed
Branch master (3b8125)
by
unknown
01:32
created

MethodSetterInterfaceManager::getPreparedName()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4

Duplication

Lines 4
Ratio 100 %

Importance

Changes 0
Metric Value
dl 4
loc 4
rs 10
c 0
b 0
f 0
cc 1
nc 1
nop 0
1
<?php
2
3
namespace HelloWordPl\SimpleEntityGeneratorBundle\Lib\Items;
4
5
use HelloWordPl\SimpleEntityGeneratorBundle\Lib\Interfaces\SetterMethodInterface;
6
7
/**
8
 * Setter Method for Interface Manager
9
 *
10
 * @author Sławomir Kania <[email protected]>
11
 */
12 View Code Duplication
class MethodSetterInterfaceManager extends MethodManager implements SetterMethodInterface
0 ignored issues
show
Duplication introduced by
This class 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...
13
{
14
15
    /**
16
     * Return prepared method name from property eg. getNameOrSurname
17
     *
18
     * @return string
19
     */
20
    public function getPreparedName()
21
    {
22
        return sprintf("set%s", parent::getPreparedName());
23
    }
24
25
    /**
26
     * If type is callable object or in namespace then can render type hinting in setter
27
     *
28
     * @return boolean
29
     */
30
    public function canAddTypeHinting()
31
    {
32
        return $this->getProperty()->isObjectType();
33
    }
34
35
    /**
36
     * Return set of tags used in template
37
     *
38
     * @return array
39
     */
40
    public function getTemplateTags()
41
    {
42
        return [
43
            self::TAG_COMMENT,
44
            self::TAG_PROPERTY_TYPE,
45
            self::TAG_TYPE_HINTING,
46
            self::TAG_METHOD_NAME,
47
            self::TAG_PROPERTY_NAME,
48
            self::TAG_OPTIONAL_PART,
49
        ];
50
    }
51
}
52