PluginProbe ʕ •ᴥ•ʔ
Kubio AI Page Builder / 2.8.6
Kubio AI Page Builder v2.8.6
2.9.0 2.8.6 2.8.5 2.8.4 2.8.3 2.8.2 2.8.1 trunk 1.0.0 1.0.1 1.1.0 1.2.0 1.2.1 1.2.2 1.2.3 1.3.0 1.3.1 1.3.2 1.4.0 1.4.1 1.4.2 1.4.3 1.5.0 1.6.0 1.6.1 1.6.2 1.6.3 1.6.4 1.7.0 1.7.1 1.7.2 1.7.3 1.8.0 1.8.1 1.8.2 1.9.0 2.0.0 2.1.1 2.1.2 2.1.3 2.2.0 2.2.3 2.2.4 2.2.5 2.3.0 2.3.1 2.3.3 2.3.4 2.4.0 2.4.1 2.4.2 2.4.3 2.4.5 2.5.0 2.5.1 2.5.2 2.5.3 2.6.0 2.6.1 2.6.2 2.6.3 2.6.5 2.6.6 2.6.7 2.7.0 2.7.1 2.7.2 2.7.3 2.8.0
kubio / vendor / sebastian / comparator / src / SplObjectStorageComparator.php
kubio / vendor / sebastian / comparator / src Last commit date
exceptions 1 year ago ArrayComparator.php 1 year ago Comparator.php 1 year ago ComparisonFailure.php 1 year ago DOMNodeComparator.php 1 year ago DateTimeComparator.php 1 year ago DoubleComparator.php 1 year ago ExceptionComparator.php 1 year ago Factory.php 1 year ago MockObjectComparator.php 1 year ago NumericComparator.php 1 year ago ObjectComparator.php 1 year ago ResourceComparator.php 1 year ago ScalarComparator.php 1 year ago SplObjectStorageComparator.php 1 year ago TypeComparator.php 1 year ago
SplObjectStorageComparator.php
72 lines
1 <?php declare(strict_types=1);
2 /*
3 * This file is part of sebastian/comparator.
4 *
5 * (c) Sebastian Bergmann <sebastian@phpunit.de>
6 *
7 * For the full copyright and license information, please view the LICENSE
8 * file that was distributed with this source code.
9 */
10 namespace SebastianBergmann\Comparator;
11
12 use SplObjectStorage;
13
14 /**
15 * Compares \SplObjectStorage instances for equality.
16 */
17 class SplObjectStorageComparator extends Comparator
18 {
19 /**
20 * Returns whether the comparator can compare two values.
21 *
22 * @param mixed $expected The first value to compare
23 * @param mixed $actual The second value to compare
24 *
25 * @return bool
26 */
27 public function accepts($expected, $actual)
28 {
29 return $expected instanceof SplObjectStorage && $actual instanceof SplObjectStorage;
30 }
31
32 /**
33 * Asserts that two values are equal.
34 *
35 * @param mixed $expected First value to compare
36 * @param mixed $actual Second value to compare
37 * @param float $delta Allowed numerical distance between two values to consider them equal
38 * @param bool $canonicalize Arrays are sorted before comparison when set to true
39 * @param bool $ignoreCase Case is ignored when set to true
40 *
41 * @throws ComparisonFailure
42 */
43 public function assertEquals($expected, $actual, $delta = 0.0, $canonicalize = false, $ignoreCase = false)/*: void*/
44 {
45 foreach ($actual as $object) {
46 if (!$expected->contains($object)) {
47 throw new ComparisonFailure(
48 $expected,
49 $actual,
50 $this->exporter->export($expected),
51 $this->exporter->export($actual),
52 false,
53 'Failed asserting that two objects are equal.'
54 );
55 }
56 }
57
58 foreach ($expected as $object) {
59 if (!$actual->contains($object)) {
60 throw new ComparisonFailure(
61 $expected,
62 $actual,
63 $this->exporter->export($expected),
64 $this->exporter->export($actual),
65 false,
66 'Failed asserting that two objects are equal.'
67 );
68 }
69 }
70 }
71 }
72