����JFIF��x�x����'
Server IP : 66.29.137.217 / Your IP : 18.117.229.13 Web Server : LiteSpeed System : Linux premium294.web-hosting.com 4.18.0-513.11.1.lve.el8.x86_64 #1 SMP Thu Jan 18 16:21:02 UTC 2024 x86_64 User : gltevjme ( 1095) PHP Version : 7.0.33 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : ON | Sudo : OFF | Pkexec : OFF Directory : /home/gltevjme/bofirm.gltechlimited.com/vendor/mockery/mockery/library/Mockery/Matcher/ |
Upload File : |
<?php /** * Mockery (https://docs.mockery.io/) * * @copyright https://github.com/mockery/mockery/blob/HEAD/COPYRIGHT.md * @license https://github.com/mockery/mockery/blob/HEAD/LICENSE BSD 3-Clause License * @link https://github.com/mockery/mockery for the canonical source repository */ namespace Mockery\Matcher; class Subset extends MatcherAbstract { private $expected; private $strict = true; /** * @param array $expected Expected subset of data * @param bool $strict Whether to run a strict or loose comparison */ public function __construct(array $expected, $strict = true) { $this->expected = $expected; $this->strict = $strict; } /** * @param array $expected Expected subset of data * * @return Subset */ public static function strict(array $expected) { return new static($expected, true); } /** * @param array $expected Expected subset of data * * @return Subset */ public static function loose(array $expected) { return new static($expected, false); } /** * Check if the actual value matches the expected. * * @param mixed $actual * @return bool */ public function match(&$actual) { if (!is_array($actual)) { return false; } if ($this->strict) { return $actual === array_replace_recursive($actual, $this->expected); } return $actual == array_replace_recursive($actual, $this->expected); } /** * Return a string representation of this Matcher * * @return string */ public function __toString() { return '<Subset' . $this->formatArray($this->expected) . ">"; } /** * Recursively format an array into the string representation for this matcher * * @param array $array * @return string */ protected function formatArray(array $array) { $elements = []; foreach ($array as $k => $v) { $elements[] = $k . '=' . (is_array($v) ? $this->formatArray($v) : (string) $v); } return "[" . implode(", ", $elements) . "]"; } }