Skip to content
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

Use strict comparison for onlyExpectedArguments #121

Merged
merged 4 commits into from
Jan 31, 2017
Merged
Changes from 1 commit
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
4 changes: 2 additions & 2 deletions src/AspectMock/Proxy/Verifier.php
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ public function verifyInvokedMultipleTimes($name, $times, $params = null)
if (is_array($params)) {
$equals = 0;
foreach ($calls as $args) {
if ($this->onlyExpectedArguments($params, $args) == $params) $equals++;
if ($this->onlyExpectedArguments($params, $args) === $params) $equals++;

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Inline control structures are not allowed

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

それもとからやん!!

}
if ($equals == $times) return;
$params = ArgumentsFormatter::toString($params);
Expand Down Expand Up @@ -153,7 +153,7 @@ public function verifyNeverInvoked($name, $params = null)
if (empty($calls)) return;
$params = ArgumentsFormatter::toString($params);
foreach ($calls as $args) {
if ($this->onlyExpectedArguments($params, $args) == $params) throw new fail(sprintf($this->neverInvoked, $this->className));
if ($this->onlyExpectedArguments($params, $args) === $params) throw new fail(sprintf($this->neverInvoked, $this->className));

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Inline control structures are not allowed

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

それもとからやん!!

}
return;
}
Expand Down