-
Notifications
You must be signed in to change notification settings - Fork 653
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Unit test improvements for php-parser 5 #10574
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -603,7 +603,7 @@ public function foo() : void { | |
|
||
class A { | ||
public function foo() : void { | ||
throw new Error("bad", 5); | ||
throw new Error("bad", []); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. php-parser 5.0 only allows passing an array as the second constructor argument. php-parser 4.0 allows both. |
||
} | ||
}', | ||
], | ||
|
@@ -613,7 +613,7 @@ public function foo() : void { | |
|
||
class A { | ||
public function foo() : void { | ||
throw new Error("bad", 5); | ||
throw new Error("bad", []); | ||
} | ||
}', | ||
], | ||
|
@@ -657,7 +657,7 @@ public function foo() : void { | |
|
||
class A { | ||
public function foo() : void { | ||
throw new E("bad", 5); | ||
throw new E("bad", []); | ||
} | ||
}', | ||
], | ||
|
@@ -667,7 +667,7 @@ public function foo() : void { | |
|
||
class A { | ||
public function foo() : void { | ||
throw new E("bad", 5); | ||
throw new E("bad", []); | ||
} | ||
}', | ||
], | ||
|
@@ -707,7 +707,7 @@ public function foo() : void { | |
|
||
class A { | ||
public function foo() : void { | ||
throw new Error("bad", 5); | ||
throw new Error("bad", []); | ||
} | ||
}', | ||
], | ||
|
@@ -717,7 +717,7 @@ public function foo() : void { | |
|
||
class A { | ||
public function foo() : void { | ||
throw new Error("bad", 5); | ||
throw new Error("bad", []); | ||
} | ||
}', | ||
], | ||
|
@@ -755,7 +755,7 @@ public function foo() : void { | |
|
||
class A { | ||
public function foo() : void { | ||
throw new E("bad", 5); | ||
throw new E("bad", []); | ||
} | ||
}', | ||
], | ||
|
@@ -765,7 +765,7 @@ public function foo() : void { | |
|
||
class A { | ||
public function foo() : void { | ||
throw new E("bad", 5); | ||
throw new E("bad", []); | ||
} | ||
}', | ||
], | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -1166,7 +1166,7 @@ class Finally_ extends Node\Stmt | |
* Constructs a finally node. | ||
* | ||
* @param list<Node\Stmt> $stmts Statements | ||
* @param array $attributes Additional attributes | ||
* @param array<string, mixed> $attributes Additional attributes | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. php-parser 5.0 has more specific type requirements on attributes. |
||
*/ | ||
public function __construct(array $stmts = array(), array $attributes = array()) { | ||
parent::__construct($attributes); | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A namespace declarations must be the first thing in the file. php-parser 5.0 enforces this.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is simply invalid PHP code
https://3v4l.org/9HAnR