Skip to content

Commit

Permalink
Merge pull request #1183 from PHPCompatibility/PHP-8.0/newinterfaces-…
Browse files Browse the repository at this point in the history
…add-stringable

PHP 8.0: NewInterfaces: add new Stringable interface to the sniff
  • Loading branch information
wimg committed Aug 9, 2020
2 parents 93dc5bd + 1f53195 commit 66fe96f
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 1 deletion.
5 changes: 5 additions & 0 deletions PHPCompatibility/Sniffs/Interfaces/NewInterfacesSniff.php
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,11 @@ class NewInterfacesSniff extends AbstractNewFeatureSniff
'5.6' => false,
'7.0' => true,
),

'Stringable' => array(
'7.4' => false,
'8.0' => true,
),
);

/**
Expand Down
5 changes: 4 additions & 1 deletion PHPCompatibility/Tests/Interfaces/NewInterfacesUnitTest.inc
Original file line number Diff line number Diff line change
Expand Up @@ -106,4 +106,7 @@ try {
// Namespaced, should be ignored.
try {
} catch (\My\Except\Throwable $e) {
}
}

// PHP 8.0 new interfaces.
function StringableTypeHint( Stringable $a ) {}
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,7 @@ public function dataNewInterface()
array('SessionIdInterface', '5.5.0', array(89), '5.6', '5.5'),
array('Throwable', '5.6', array(37, 52, 62, 93, 98, 103), '7.0'),
array('SessionUpdateTimestampHandlerInterface', '5.6', array(90), '7.0'),
array('Stringable', '7.4', array(112), '8.0'),
);
}

Expand Down

0 comments on commit 66fe96f

Please sign in to comment.