Skip to content

Fix: Method invocations on methods of ObjectProphecy might have side effects #119

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Feb 5, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
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