File tree Expand file tree Collapse file tree 5 files changed +21
-0
lines changed Expand file tree Collapse file tree 5 files changed +21
-0
lines changed Original file line number Diff line number Diff line change @@ -15,7 +15,9 @@ public function hasChildren(): bool
1515 {
1616 /** @var RecursiveGraphIterator|RecursiveMutableGraphIterator $this */
1717 if (($ current = $ this ->current ()) === false ) {
18+ // @codeCoverageIgnoreStart
1819 return false ;
20+ // @codeCoverageIgnoreEnd
1921 }
2022
2123 return is_object ($ current ) || is_array ($ current );
@@ -25,7 +27,9 @@ public function getChildren(): ?self
2527 {
2628 /** @var RecursiveGraphIterator|RecursiveMutableGraphIterator $this */
2729 if (($ current = $ this ->current ()) === false ) {
30+ // @codeCoverageIgnoreStart
2831 return null ;
32+ // @codeCoverageIgnoreEnd
2933 }
3034
3135 $ key = current ($ this ->Keys );
@@ -39,6 +43,8 @@ public function getChildren(): ?self
3943 return new self ($ current );
4044 }
4145
46+ // @codeCoverageIgnoreStart
4247 return null ;
48+ // @codeCoverageIgnoreEnd
4349 }
4450}
Original file line number Diff line number Diff line change @@ -47,7 +47,9 @@ protected function doConstruct(&$graph): void
4747 }
4848
4949 if ($ graph instanceof Traversable) {
50+ // @codeCoverageIgnoreStart
5051 throw new LogicException ('Traversable objects are not supported ' );
52+ // @codeCoverageIgnoreEnd
5153 }
5254
5355 $ this ->Graph = $ graph ;
@@ -81,7 +83,9 @@ public function current()
8183 public function key ()
8284 {
8385 if (($ key = current ($ this ->Keys )) === false ) {
86+ // @codeCoverageIgnoreStart
8487 return null ;
88+ // @codeCoverageIgnoreEnd
8589 }
8690 return $ key ;
8791 }
Original file line number Diff line number Diff line change @@ -67,7 +67,9 @@ public function getChildren(): ?self
6767
6868 return
6969 $ children === null
70+ // @codeCoverageIgnoreStart
7071 ? null
72+ // @codeCoverageIgnoreEnd
7173 : new self ($ children , $ this ->Callback );
7274 }
7375}
Original file line number Diff line number Diff line change @@ -23,7 +23,9 @@ class RecursiveMutableGraphIterator extends MutableGraphIterator implements \Rec
2323 public function maybeConvertToArray ()
2424 {
2525 if (($ current = $ this ->current ()) === false ) {
26+ // @codeCoverageIgnoreStart
2627 return $ this ;
28+ // @codeCoverageIgnoreEnd
2729 }
2830
2931 if (is_object ($ current ) && $ this ->hasChildren ()) {
Original file line number Diff line number Diff line change @@ -42,4 +42,11 @@ public function testReplaceCallbackArray(): void
4242 $ this ->expectExceptionMessage ('Call to preg_replace_callback_array() failed with PREG_BACKTRACK_LIMIT_ERROR ' );
4343 Pcre::replaceCallbackArray (['/(?:\D+|<\d+>)*[!?]/ ' => fn () => '' ], 'foobar foobar foobar ' );
4444 }
45+
46+ public function testSplit (): void
47+ {
48+ $ this ->expectException (PcreErrorException::class);
49+ $ this ->expectExceptionMessage ('Call to preg_split() failed with PREG_BACKTRACK_LIMIT_ERROR ' );
50+ Pcre::split ('/(?:\D+|<\d+>)*[!?]/ ' , 'foobar foobar foobar ' );
51+ }
4552}
You can’t perform that action at this time.
0 commit comments