Skip to content

Commit

Permalink
Merge pull request #119 from localheinz/fix/side-effects
Browse files Browse the repository at this point in the history
Fix: Method invocations on methods of ObjectProphecy might have side effects
  • Loading branch information
localheinz committed Feb 5, 2020
2 parents 3d73704 + 192ca31 commit ecd367a
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 2 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Expand Up @@ -15,6 +15,7 @@ For a full diff see [`0.6.0...0.6.1`][0.6.0...0.6.1].
### Changed

* Marked classes as `final` ([#118]), by [@localheinz]
* Modified return value of `ObjectPropecyMethodReflection::hasSideEffects()` as invoking methods on an instance of `Prophecy\Prophecy\ObjectProphecy` might have side effects ([#119]), by [@localheinz]

## [`0.6.0`][0.6.0]

Expand Down Expand Up @@ -105,6 +106,7 @@ For a full diff see [`afd6fd9...0.1`][afd6fd9...0.1].
[#92]: https://github.com/Jan0707/phpstan-prophecy/pull/92
[#94]: https://github.com/Jan0707/phpstan-prophecy/pull/94
[#118]: https://github.com/Jan0707/phpstan-prophecy/pull/118
[#119]: https://github.com/Jan0707/phpstan-prophecy/pull/119

[@localheinz]: https://github.com/localheinz
[@PedroTroller]: https://github.com/PedroTroller
2 changes: 1 addition & 1 deletion src/Reflection/ObjectProphecyMethodReflection.php
Expand Up @@ -100,7 +100,7 @@ public function getThrowType(): ?Type\Type

public function hasSideEffects(): TrinaryLogic
{
return TrinaryLogic::createNo();
return TrinaryLogic::createMaybe();
}

public function getDocComment(): ?string
Expand Down
Expand Up @@ -64,7 +64,7 @@ public function testDefaults(): void
];

self::assertEquals($variants, $reflection->getVariants());
self::assertTrue($reflection->hasSideEffects()->equals(TrinaryLogic::createNo()));
self::assertTrue($reflection->hasSideEffects()->equals(TrinaryLogic::createMaybe()));
self::assertTrue($reflection->isDeprecated()->equals(TrinaryLogic::createNo()));
self::assertTrue($reflection->isInternal()->equals(TrinaryLogic::createNo()));
self::assertFalse($reflection->isPrivate());
Expand Down

0 comments on commit ecd367a

Please sign in to comment.