Skip to content

Commit ddd4ccc

Browse files
committed
FIX: updated the regexp to detect class_implements
1 parent 2b152d8 commit ddd4ccc

File tree

2 files changed

+7
-0
lines changed

2 files changed

+7
-0
lines changed

generator/src/DocPage.php

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -123,6 +123,11 @@ public function detectFalsyFunction(): bool
123123
return true;
124124
}
125125

126+
//used to detect class_implements
127+
if (preg_match("/&false; when the given class doesn't exist/m", $file)) {
128+
return true;
129+
}
130+
126131
return false;
127132
}
128133

generator/tests/DocPageTest.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ public function testDetectFalsyFunction()
1818
$arrayReplace = new DocPage(__DIR__ . '/../doc/doc-en/en/reference/array/functions/array-replace.xml');
1919
$mktime = new DocPage(__DIR__ . '/../doc/doc-en/en/reference/datetime/functions/mktime.xml');
2020
$date = new DocPage(__DIR__ . '/../doc/doc-en/en/reference/datetime/functions/date.xml');
21+
$classImplement = new DocPage(__DIR__ . '/../doc/doc-en/en/reference/spl/functions/class-implements.xml');
2122

2223
$this->assertTrue($pregMatch->detectFalsyFunction());
2324
$this->assertFalse($implode->detectFalsyFunction());
@@ -29,6 +30,7 @@ public function testDetectFalsyFunction()
2930
$this->assertFalse($arrayReplace->detectFalsyFunction());
3031
$this->assertTrue($mktime->detectFalsyFunction());
3132
$this->assertTrue($date->detectFalsyFunction());
33+
$this->assertTrue($classImplement->detectFalsyFunction());
3234
}
3335

3436
public function testDetectNullsyFunction()

0 commit comments

Comments
 (0)