File tree Expand file tree Collapse file tree 1 file changed +2
-2
lines changed Expand file tree Collapse file tree 1 file changed +2
-2
lines changed Original file line number Diff line number Diff line change @@ -530,15 +530,15 @@ protected function processCopyright(PHP_CodeSniffer_File $phpcsFile, array $tags
530
530
if (preg_match ('/^.*?([0-9]{4})((.{1})([0-9]{4}))? (.+)$/ ' , $ content , $ matches ) !== 0 )
531
531
{
532
532
// Check earliest-latest year order.
533
- if ($ matches [3 ] !== '' )
533
+ if ($ matches [3 ] !== '' && $ matches [ 3 ] !== null )
534
534
{
535
535
if ($ matches [3 ] !== '- ' )
536
536
{
537
537
$ error = 'A hyphen must be used between the earliest and latest year ' ;
538
538
$ phpcsFile ->addError ($ error , $ tag , 'CopyrightHyphen ' );
539
539
}
540
540
541
- if ($ matches [4 ] !== '' && $ matches [4 ] < $ matches [1 ])
541
+ if ($ matches [4 ] !== '' && $ matches [4 ] !== null && $ matches [ 4 ] < $ matches [1 ])
542
542
{
543
543
$ error = "Invalid year span \"$ matches [1 ]$ matches [3 ]$ matches [4 ]\" found; consider \"$ matches [4 ]- $ matches [1 ]\" instead " ;
544
544
$ phpcsFile ->addWarning ($ error , $ tag , 'InvalidCopyright ' );
You can’t perform that action at this time.
0 commit comments