Skip to content
This repository was archived by the owner on Sep 19, 2023. It is now read-only.

Commit 60bb66e

Browse files
authored
Merge pull request #3 from justcoded/develop
Routes Scanner patch to ignore comments within scan process
2 parents 720c00f + 208b019 commit 60bb66e

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

src/forms/ItemForm.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ public function attributeLabels()
6363
*/
6464
public static function getNamePattern()
6565
{
66-
return '/^[a-z0-9\s\_\-\/]+$/i';
66+
return '/^[a-z0-9\s\_\-\/\*]+$/i';
6767
}
6868

6969
///=======================

src/helpers/ScanHelper.php

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,11 @@ public static function scanControllerActionIds(array $controllers)
6565
$actions = [];
6666
foreach ($controllers as $filename) {
6767
$content = file_get_contents($filename);
68-
68+
$content = preg_replace(
69+
"/(\/\*([^*]|[\r\n]|(\*+([^*\/]|[\r\n])))*\*\/)|(\/\/.*)/i",
70+
'',
71+
$content
72+
);
6973
// ignore abstract classes
7074
if (false !== strpos($content, 'abstract class')) {
7175
continue;

0 commit comments

Comments
 (0)