File tree Expand file tree Collapse file tree 3 files changed +33
-6
lines changed Expand file tree Collapse file tree 3 files changed +33
-6
lines changed Original file line number Diff line number Diff line change 44 push :
55 branches :
66 - master
7+ pull_request :
8+ branches :
9+ - " *"
710
811jobs :
912 fix-style :
Original file line number Diff line number Diff line change 1- <?php declare (strict_types=1 );
1+ <?php
2+ declare (strict_types=1 );
23
34namespace DMS \PHPUnitExtensions \ArraySubset ;
45
56use ArrayAccess ;
67use ArrayIterator ;
78use IteratorAggregate ;
9+ use Traversable ;
10+ use function array_key_exists ;
811
912class ArrayAccessible implements ArrayAccess, IteratorAggregate
1013{
14+ /**
15+ * @var mixed[]
16+ */
1117 private $ array ;
1218
19+ /**
20+ * @param mixed[] $array
21+ */
1322 public function __construct (array $ array = [])
1423 {
1524 $ this ->array = $ array ;
1625 }
1726
18- public function offsetExists ($ offset )
27+ /**
28+ * @param mixed $offset
29+ */
30+ public function offsetExists ($ offset ): bool
1931 {
20- return \ array_key_exists ($ offset , $ this ->array );
32+ return array_key_exists ($ offset , $ this ->array );
2133 }
2234
35+ /**
36+ * @param mixed $offset
37+ *
38+ * @return mixed
39+ */
2340 public function offsetGet ($ offset )
2441 {
2542 return $ this ->array [$ offset ];
2643 }
2744
45+ /**
46+ * @param mixed $offset
47+ * @param mixed $value
48+ */
2849 public function offsetSet ($ offset , $ value ): void
2950 {
30- if (null === $ offset ) {
51+ if ($ offset === null ) {
3152 $ this ->array [] = $ value ;
3253 } else {
3354 $ this ->array [$ offset ] = $ value ;
3455 }
3556 }
3657
58+ /**
59+ * @param mixed $offset
60+ */
3761 public function offsetUnset ($ offset ): void
3862 {
3963 unset($ this ->array [$ offset ]);
4064 }
4165
42- public function getIterator ()
66+ public function getIterator (): Traversable
4367 {
4468 return new ArrayIterator ($ this ->array );
4569 }
Original file line number Diff line number Diff line change 33
44namespace DMS \PHPUnitExtensions \ArraySubset \Tests \Unit \Constraint ;
55
6- use DMS \PHPUnitExtensions \ArraySubset \ArrayAccessible ;
76use ArrayObject ;
87use Countable ;
8+ use DMS \PHPUnitExtensions \ArraySubset \ArrayAccessible ;
99use DMS \PHPUnitExtensions \ArraySubset \Constraint \ArraySubset ;
1010use PHPUnit \Framework \ExpectationFailedException ;
1111use PHPUnit \Framework \SelfDescribing ;
You can’t perform that action at this time.
0 commit comments