This project does not seem to handle request data directly as such no vulnerable execution paths were found.
include
, or for example
via PHP's auto-loading mechanism.
These results are based on our legacy PHP analysis, consider migrating to our new PHP analysis engine instead. Learn more
1 | <?php |
||
2 | |||
3 | namespace spec\Prophecy\Doubler\ClassPatch; |
||
4 | |||
5 | use PhpSpec\ObjectBehavior; |
||
6 | use Prophecy\Argument; |
||
7 | use Prophecy\Doubler\Generator\Node\ClassNode; |
||
8 | use Prophecy\Doubler\Generator\Node\MethodNode; |
||
9 | |||
10 | class MagicCallPatchSpec extends ObjectBehavior |
||
11 | { |
||
12 | function it_is_a_patch() |
||
13 | { |
||
14 | $this->shouldBeAnInstanceOf('Prophecy\Doubler\ClassPatch\ClassPatchInterface'); |
||
15 | } |
||
16 | |||
17 | function it_supports_anything(ClassNode $node) |
||
18 | { |
||
19 | $this->supports($node)->shouldReturn(true); |
||
20 | } |
||
21 | |||
22 | View Code Duplication | function it_discovers_api_using_phpdoc(ClassNode $node) |
|
0 ignored issues
–
show
|
|||
23 | { |
||
24 | $node->getParentClass()->willReturn('spec\Prophecy\Doubler\ClassPatch\MagicalApi'); |
||
25 | $node->getInterfaces()->willReturn(array()); |
||
26 | |||
27 | $node->addMethod(new MethodNode('undefinedMethod'))->shouldBeCalled(); |
||
28 | |||
29 | $this->apply($node); |
||
30 | } |
||
31 | |||
32 | View Code Duplication | function it_ignores_existing_methods(ClassNode $node) |
|
0 ignored issues
–
show
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...
|
|||
33 | { |
||
34 | $node->getParentClass()->willReturn('spec\Prophecy\Doubler\ClassPatch\MagicalApiExtended'); |
||
35 | $node->getInterfaces()->willReturn(array()); |
||
36 | |||
37 | $node->addMethod(new MethodNode('undefinedMethod'))->shouldBeCalled(); |
||
38 | $node->addMethod(new MethodNode('definedMethod'))->shouldNotBeCalled(); |
||
39 | |||
40 | $this->apply($node); |
||
41 | } |
||
42 | |||
43 | View Code Duplication | function it_ignores_empty_methods_from_phpdoc(ClassNode $node) |
|
0 ignored issues
–
show
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...
|
|||
44 | { |
||
45 | $node->getParentClass()->willReturn('spec\Prophecy\Doubler\ClassPatch\MagicalApiInvalidMethodDefinition'); |
||
46 | $node->getInterfaces()->willReturn(array()); |
||
47 | |||
48 | $node->addMethod(new MethodNode(''))->shouldNotBeCalled(); |
||
49 | |||
50 | $this->apply($node); |
||
51 | } |
||
52 | |||
53 | View Code Duplication | function it_discovers_api_using_phpdoc_from_implemented_interfaces(ClassNode $node) |
|
0 ignored issues
–
show
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...
|
|||
54 | { |
||
55 | $node->getParentClass()->willReturn('spec\Prophecy\Doubler\ClassPatch\MagicalApiImplemented'); |
||
56 | $node->getInterfaces()->willReturn(array()); |
||
57 | |||
58 | $node->addMethod(new MethodNode('implementedMethod'))->shouldBeCalled(); |
||
59 | |||
60 | $this->apply($node); |
||
61 | } |
||
62 | |||
63 | View Code Duplication | function it_discovers_api_using_phpdoc_from_own_interfaces(ClassNode $node) |
|
0 ignored issues
–
show
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...
|
|||
64 | { |
||
65 | $node->getParentClass()->willReturn('stdClass'); |
||
66 | $node->getInterfaces()->willReturn(array('spec\Prophecy\Doubler\ClassPatch\MagicalApiImplemented')); |
||
67 | |||
68 | $node->addMethod(new MethodNode('implementedMethod'))->shouldBeCalled(); |
||
69 | |||
70 | $this->apply($node); |
||
71 | } |
||
72 | |||
73 | View Code Duplication | function it_discovers_api_using_phpdoc_from_extended_parent_interfaces(ClassNode $node) |
|
0 ignored issues
–
show
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...
|
|||
74 | { |
||
75 | $node->getParentClass()->willReturn('spec\Prophecy\Doubler\ClassPatch\MagicalApiImplementedExtended'); |
||
76 | $node->getInterfaces()->willReturn(array()); |
||
77 | |||
78 | $node->addMethod(new MethodNode('implementedMethod'))->shouldBeCalled(); |
||
79 | |||
80 | $this->apply($node); |
||
81 | } |
||
82 | |||
83 | function it_has_50_priority() |
||
84 | { |
||
85 | $this->getPriority()->shouldReturn(50); |
||
86 | } |
||
87 | } |
||
88 | |||
89 | /** |
||
90 | * @method void undefinedMethod() |
||
91 | */ |
||
92 | class MagicalApi |
||
93 | { |
||
94 | /** |
||
95 | * @return void |
||
96 | */ |
||
97 | public function definedMethod() |
||
98 | { |
||
99 | |||
100 | } |
||
101 | } |
||
102 | |||
103 | /** |
||
104 | * @method |
||
105 | */ |
||
106 | class MagicalApiInvalidMethodDefinition |
||
107 | { |
||
108 | } |
||
109 | |||
110 | /** |
||
111 | * @method void definedMethod() |
||
112 | */ |
||
113 | class MagicalApiExtended extends MagicalApi |
||
114 | { |
||
115 | |||
116 | } |
||
117 | |||
118 | /** |
||
119 | */ |
||
120 | class MagicalApiImplemented implements MagicalApiInterface |
||
121 | { |
||
122 | |||
123 | } |
||
124 | |||
125 | /** |
||
126 | */ |
||
127 | class MagicalApiImplementedExtended extends MagicalApiImplemented |
||
128 | { |
||
129 | } |
||
130 | |||
131 | /** |
||
132 | * @method void implementedMethod() |
||
133 | */ |
||
134 | interface MagicalApiInterface |
||
135 | { |
||
136 | |||
137 | } |
||
138 |
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.