Skip to content

Commit 2edbb6e

Browse files
committed
Change namespace of ObjectProphecyClosureContainer
See #623 (comment)
1 parent 1553ae4 commit 2edbb6e

File tree

8 files changed

+14
-15
lines changed

8 files changed

+14
-15
lines changed

spec/Prophecy/Argument/ArgumentsWildcardSpec.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ function it_wraps_non_token_arguments_into_ExactValueToken(\stdClass $object)
1515
$id = spl_object_id($object->getWrappedObject());
1616

1717
$objHash = "exact(42), exact(\"zet\"), exact($class#$id Object (\n" .
18-
" 'objectProphecyClosureContainer' => Prophecy\Doubler\ClassPatch\ProphecySubjectPatch\ObjectProphecyClosureContainer#%s Object (\n" .
18+
" 'objectProphecyClosureContainer' => Prophecy\Doubler\ObjectProphecyClosureContainer#%s Object (\n" .
1919
" 'closure' => Closure#%s Object (\n" .
2020
" 0 => Closure#%s Object\n" .
2121
" )\n" .

spec/Prophecy/Argument/Token/ExactValueTokenSpec.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -137,7 +137,7 @@ function it_generates_proper_string_representation_for_object(\stdClass $object)
137137
get_class($object->getWrappedObject()),
138138
spl_object_id($object->getWrappedObject())
139139
) . " Object (\n" .
140-
" 'objectProphecyClosure' => Prophecy\Doubler\ClassPatch\ProphecySubjectPatch\ObjectProphecyClosureContainer#%s Object (\n" .
140+
" 'objectProphecyClosureContainer' => Prophecy\Doubler\ObjectProphecyClosureContainer#%s Object (\n" .
141141
" 'closure' => Closure#%s Object (\n" .
142142
" 0 => Closure#%s Object\n" .
143143
" )\n" .

spec/Prophecy/Argument/Token/IdenticalValueTokenSpec.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -145,7 +145,7 @@ function it_generates_proper_string_representation_for_object($object)
145145
get_class($object->getWrappedObject()),
146146
spl_object_id($object->getWrappedObject())
147147
) . " Object (\n" .
148-
" 'objectProphecyClosureContainer' => Prophecy\Doubler\ClassPatch\ProphecySubjectPatch\ObjectProphecyClosureContainer#%s Object (\n" .
148+
" 'objectProphecyClosureContainer' => Prophecy\Doubler\ObjectProphecyClosureContainer#%s Object (\n" .
149149
" 'closure' => Closure#%s Object (\n" .
150150
" 0 => Closure#%s Object\n" .
151151
" )\n" .

spec/Prophecy/Doubler/ClassPatch/ProphecySubjectPatchSpec.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -33,8 +33,8 @@ function it_forces_class_to_implement_ProphecySubjectInterface(ClassNode $node)
3333
$node->addProperty(
3434
'objectProphecyClosureContainer',
3535
'private',
36-
new PropertyTypeNode('Prophecy\Doubler\ClassPatch\ProphecySubjectPatch\ObjectProphecyClosureContainer')
37-
)->willReturn(Argument::type('Prophecy\Doubler\ClassPatch\ProphecySubjectPatch\ObjectProphecyClosureContainer'));
36+
new PropertyTypeNode('Prophecy\Doubler\ObjectProphecyClosureContainer')
37+
)->willReturn(Argument::type('Prophecy\Doubler\ObjectProphecyClosureContainer'));
3838

3939
$node->getMethods()->willReturn(array());
4040
$node->hasMethod(Argument::any())->willReturn(false);
@@ -56,8 +56,8 @@ function it_forces_all_class_methods_except_constructor_to_proxy_calls_into_prop
5656
$node->addProperty(
5757
'objectProphecyClosureContainer',
5858
'private',
59-
new PropertyTypeNode('Prophecy\Doubler\ClassPatch\ProphecySubjectPatch\ObjectProphecyClosureContainer')
60-
)->willReturn(Argument::type('Prophecy\Doubler\ClassPatch\ProphecySubjectPatch\ObjectProphecyClosureContainer'));
59+
new PropertyTypeNode('Prophecy\Doubler\ObjectProphecyClosureContainer')
60+
)->willReturn(Argument::type('Prophecy\Doubler\ObjectProphecyClosureContainer'));
6161

6262
$node->hasMethod(Argument::any())->willReturn(false);
6363
$node->addMethod(Argument::type('Prophecy\Doubler\Generator\Node\MethodNode'), true)->willReturn(null);

spec/Prophecy/Doubler/Generator/ClassCodeGeneratorSpec.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -347,7 +347,7 @@ function it_generates_proper_code_for_dnf_types(
347347
) {
348348
$class->getParentClass()->willReturn('stdClass');
349349
$class->getInterfaces()->willReturn([]);
350-
$class->getProperties()->willReturn([]);
350+
$class->getPropertyNodes()->willReturn([]);
351351
$class->getMethods()->willReturn(array($method));
352352
$class->isReadOnly()->willReturn(false);
353353

@@ -389,7 +389,7 @@ function it_generates_proper_code_for_intersection_return_types(
389389
) {
390390
$class->getParentClass()->willReturn('stdClass');
391391
$class->getInterfaces()->willReturn([]);
392-
$class->getProperties()->willReturn([]);
392+
$class->getPropertyNodes()->willReturn([]);
393393
$class->getMethods()->willReturn(array($method));
394394
$class->isReadOnly()->willReturn(false);
395395

spec/Prophecy/Util/StringUtilSpec.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ function it_generates_proper_string_representation_for_object(\stdClass $object)
7575
get_class($object->getWrappedObject()),
7676
spl_object_id($object->getWrappedObject())
7777
) . " Object (\n" .
78-
" 'objectProphecyClosureContainer' => Prophecy\Doubler\ClassPatch\ProphecySubjectPatch\ObjectProphecyClosureContainer#%s Object (\n" .
78+
" 'objectProphecyClosureContainer' => Prophecy\Doubler\ObjectProphecyClosureContainer#%s Object (\n" .
7979
" 'closure' => Closure#%s Object (\n" .
8080
" 0 => Closure#%s Object\n" .
8181
" )\n" .

src/Prophecy/Doubler/ClassPatch/ProphecySubjectPatch.php

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,8 @@
1515
use Prophecy\Doubler\Generator\Node\ArgumentTypeNode;
1616
use Prophecy\Doubler\Generator\Node\ClassNode;
1717
use Prophecy\Doubler\Generator\Node\MethodNode;
18-
use Prophecy\Doubler\Generator\Node\ReturnTypeNode;
19-
use Prophecy\Doubler\Generator\Node\Type\ObjectType;
2018
use Prophecy\Doubler\Generator\Node\PropertyTypeNode;
19+
use Prophecy\Doubler\Generator\Node\Type\ObjectType;
2120

2221
/**
2322
* Add Prophecy functionality to the double.
@@ -50,14 +49,14 @@ public function apply(ClassNode $node)
5049
$node->addProperty(
5150
'objectProphecyClosureContainer',
5251
'private',
53-
new PropertyTypeNode('Prophecy\Doubler\ClassPatch\ProphecySubjectPatch\ObjectProphecyClosureContainer')
52+
new PropertyTypeNode('Prophecy\Doubler\ObjectProphecyClosureContainer')
5453
);
5554

5655
foreach ($node->getMethods() as $name => $method) {
5756
if ('__construct' === strtolower($name)) {
5857
$method->setCode(
5958
$method->getCode() .
60-
'$this->objectProphecyClosureContainer = new \Prophecy\Doubler\ClassPatch\ProphecySubjectPatch\ObjectProphecyClosureContainer();'
59+
'$this->objectProphecyClosureContainer = new \Prophecy\Doubler\ObjectProphecyClosureContainer();'
6160
);
6261

6362
continue;

src/Prophecy/Doubler/ClassPatch/ProphecySubjectPatch/ObjectProphecyClosureContainer.php renamed to src/Prophecy/Doubler/ObjectProphecyClosureContainer.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
* file that was distributed with this source code.
1010
*/
1111

12-
namespace Prophecy\Doubler\ClassPatch\ProphecySubjectPatch;
12+
namespace Prophecy\Doubler;
1313

1414
/**
1515
* Container for the closure that can be used and modified in a read-only class.

0 commit comments

Comments
 (0)