blob: f1e405505536247097b126b5a4f3b2e06d02c594 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
|
From b2f20b33942c2c84bc3b3b169098b448b3e66737 Mon Sep 17 00:00:00 2001
From: Craig Duncan <git@duncanc.co.uk>
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);
|