From b2f20b33942c2c84bc3b3b169098b448b3e66737 Mon Sep 17 00:00:00 2001 From: Craig Duncan Date: Fri, 7 Apr 2017 09:43:56 +0100 Subject: [PATCH] Avoid warnings in PHP 7.2 from count() --- library/Mockery/Expectation.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/library/Mockery/Expectation.php b/library/Mockery/Expectation.php index bccf82ec..b215890c 100644 --- a/library/Mockery/Expectation.php +++ b/library/Mockery/Expectation.php @@ -310,7 +310,8 @@ public function matchArgs(array $args) if (empty($this->_expectedArgs) && !$this->_noArgsExpectation) { return true; } - if (count($args) !== count($this->_expectedArgs)) { + $expected = is_array($this->_expectedArgs) ? count($this->_expectedArgs) : 0; + if (count($args) !== $expected) { return false; } $argCount = count($args);