dépôts
/
lhc
/
web
/
wiklou.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
mediawiki.action.edit: Add TODO referencing T6714
[lhc/web/wiklou.git]
/
maintenance
/
findDeprecated.php
diff --git
a/maintenance/findDeprecated.php
b/maintenance/findDeprecated.php
index
bc1b34a
..
94b7fb4
100644
(file)
--- a/
maintenance/findDeprecated.php
+++ b/
maintenance/findDeprecated.php
@@
-71,6
+71,9
@@
class DeprecatedInterfaceFinder extends FileAwareNodeVisitor {
* indicating that it is a hard-deprecated interface.
*/
public function isHardDeprecated( PhpParser\Node $node ) {
* indicating that it is a hard-deprecated interface.
*/
public function isHardDeprecated( PhpParser\Node $node ) {
+ if ( !$node->stmts ) {
+ return false;
+ }
foreach ( $node->stmts as $stmt ) {
if (
$stmt instanceof PhpParser\Node\Expr\FuncCall
foreach ( $node->stmts as $stmt ) {
if (
$stmt instanceof PhpParser\Node\Expr\FuncCall
@@
-142,7
+145,7
@@
class FindDeprecated extends Maintenance {
$files = $this->getFiles();
$chunkSize = ceil( count( $files ) / 72 );
$files = $this->getFiles();
$chunkSize = ceil( count( $files ) / 72 );
- $parser =
new PhpParser\Parser( new PhpParser\Lexer\Emulative
);
+ $parser =
( new PhpParser\ParserFactory )->create( PhpParser\ParserFactory::PREFER_PHP7
);
$traverser = new PhpParser\NodeTraverser;
$finder = new DeprecatedInterfaceFinder;
$traverser->addVisitor( $finder );
$traverser = new PhpParser\NodeTraverser;
$finder = new DeprecatedInterfaceFinder;
$traverser->addVisitor( $finder );