Skip to content

Commit d1f8b2a

Browse files
committed
Fix: Fix undefined index warnings
1 parent b8f2348 commit d1f8b2a

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

source/Utility/traitCodeParser.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,8 @@ static public function getFirstFoundMultilineComment( $sCode ) {
2424
static public function getMultiLineCommentUnwrapped( $sMultiLineComment ) {
2525
$_sText = '';
2626
preg_match( '/\/\*+?(.*)\*\//Us', $sMultiLineComment, $_aMatches );
27-
foreach( preg_split("/\r\n|\n|\r/", trim( $_aMatches[ 1 ], '\t\n\r\0\x0B' ) ) as $_i => $_sLine ) {
27+
$_sMultiLineComment = isset( $_aMatches[ 1 ] ) ? trim( $_aMatches[ 1 ], '\t\n\r\0\x0B' ) : '';
28+
foreach( preg_split("/\r\n|\n|\r/", $_sMultiLineComment ) as $_i => $_sLine ) {
2829
$_sText .= preg_replace( '/^(\s|\/)+\*+(\s|$)/', '', $_sLine ) . PHP_EOL;
2930
}
3031
return trim( $_sText );

0 commit comments

Comments
 (0)