@@ -1312,7 +1312,7 @@ public function setCustomErrorLevel(string $issue_key, string $error_level): voi
13121312 private function loadFileExtensions (SimpleXMLElement $ extensions ): void
13131313 {
13141314 foreach ($ extensions as $ extension ) {
1315- $ extension_name = preg_replace ('/^\.?/ ' , '' , (string )$ extension ['name ' ]);
1315+ $ extension_name = preg_replace ('/^\.?/ ' , '' , (string )$ extension ['name ' ], 1 );
13161316 $ this ->file_extensions [] = $ extension_name ;
13171317
13181318 if (isset ($ extension ['scanner ' ])) {
@@ -1506,7 +1506,7 @@ private function getPluginClassForPath(Codebase $codebase, string $path, string
15061506 public function shortenFileName (string $ to ): string
15071507 {
15081508 if (!is_file ($ to )) {
1509- return preg_replace ('/^ ' . preg_quote ($ this ->base_dir , '/ ' ) . '/ ' , '' , $ to );
1509+ return preg_replace ('/^ ' . preg_quote ($ this ->base_dir , '/ ' ) . '/ ' , '' , $ to, 1 );
15101510 }
15111511
15121512 $ from = $ this ->base_dir ;
@@ -1678,7 +1678,7 @@ public static function getParentIssueType(string $issue_type): ?string
16781678 }
16791679
16801680 if (strpos ($ issue_type , 'Possibly ' ) === 0 ) {
1681- $ stripped_issue_type = preg_replace ('/^Possibly(False|Null)?/ ' , '' , $ issue_type );
1681+ $ stripped_issue_type = preg_replace ('/^Possibly(False|Null)?/ ' , '' , $ issue_type, 1 );
16821682
16831683 if (strpos ($ stripped_issue_type , 'Invalid ' ) === false && strpos ($ stripped_issue_type , 'Un ' ) !== 0 ) {
16841684 $ stripped_issue_type = 'Invalid ' . $ stripped_issue_type ;
@@ -1692,7 +1692,7 @@ public static function getParentIssueType(string $issue_type): ?string
16921692 }
16931693
16941694 if (preg_match ('/^(False|Null)[A-Z]/ ' , $ issue_type ) && !strpos ($ issue_type , 'Reference ' )) {
1695- return preg_replace ('/^(False|Null)/ ' , 'Invalid ' , $ issue_type );
1695+ return preg_replace ('/^(False|Null)/ ' , 'Invalid ' , $ issue_type, 1 );
16961696 }
16971697
16981698 if ($ issue_type === 'UndefinedInterfaceMethod ' ) {
0 commit comments