mirror of
https://github.com/nikic/PHP-Parser.git
synced 2025-07-24 07:41:35 +02:00
Synchronized error messages with native php error messages
This commit is contained in:
@@ -22,8 +22,8 @@ Multiple final modifiers are not allowed on line 1
|
||||
-----
|
||||
<?php class A { abstract final a(); }
|
||||
-----
|
||||
Cannot use the final and abstract modifier at the same time on line 1
|
||||
Cannot use the final modifier on an abstract class member on line 1
|
||||
-----
|
||||
<?php abstract final class A { }
|
||||
-----
|
||||
Syntax error, unexpected T_FINAL, expecting T_CLASS on line 1
|
||||
Syntax error, unexpected T_FINAL, expecting T_CLASS on line 1
|
||||
|
@@ -2,11 +2,11 @@ Invalid class name
|
||||
-----
|
||||
<?php class self {}
|
||||
-----
|
||||
Cannot use "self" as class name as it is reserved on line 1
|
||||
Cannot use 'self' as class name as it is reserved on line 1
|
||||
-----
|
||||
<?php class parent {}
|
||||
-----
|
||||
Cannot use "parent" as class name as it is reserved on line 1
|
||||
Cannot use 'parent' as class name as it is reserved on line 1
|
||||
-----
|
||||
<?php class static {}
|
||||
-----
|
||||
@@ -14,11 +14,11 @@ Syntax error, unexpected T_STATIC, expecting T_STRING on line 1
|
||||
-----
|
||||
<?php class A extends self {}
|
||||
-----
|
||||
Cannot use "self" as class name as it is reserved on line 1
|
||||
Cannot use 'self' as class name as it is reserved on line 1
|
||||
-----
|
||||
<?php class A extends parent {}
|
||||
-----
|
||||
Cannot use "parent" as class name as it is reserved on line 1
|
||||
Cannot use 'parent' as class name as it is reserved on line 1
|
||||
-----
|
||||
<?php class A extends static {}
|
||||
-----
|
||||
@@ -26,11 +26,11 @@ Syntax error, unexpected T_STATIC, expecting T_STRING or T_NAMESPACE or T_NS_SEP
|
||||
-----
|
||||
<?php class A implements self {}
|
||||
-----
|
||||
Cannot use "self" as interface name as it is reserved on line 1
|
||||
Cannot use 'self' as interface name as it is reserved on line 1
|
||||
-----
|
||||
<?php class A implements parent {}
|
||||
-----
|
||||
Cannot use "parent" as interface name as it is reserved on line 1
|
||||
Cannot use 'parent' as interface name as it is reserved on line 1
|
||||
-----
|
||||
<?php class A implements static {}
|
||||
-----
|
||||
@@ -38,11 +38,11 @@ Syntax error, unexpected T_STATIC, expecting T_STRING or T_NAMESPACE or T_NS_SEP
|
||||
-----
|
||||
<?php interface self {}
|
||||
-----
|
||||
Cannot use "self" as interface name as it is reserved on line 1
|
||||
Cannot use 'self' as class name as it is reserved on line 1
|
||||
-----
|
||||
<?php interface parent {}
|
||||
-----
|
||||
Cannot use "parent" as interface name as it is reserved on line 1
|
||||
Cannot use 'parent' as class name as it is reserved on line 1
|
||||
-----
|
||||
<?php interface static {}
|
||||
-----
|
||||
@@ -50,12 +50,12 @@ Syntax error, unexpected T_STATIC, expecting T_STRING on line 1
|
||||
-----
|
||||
<?php interface A extends self {}
|
||||
-----
|
||||
Cannot use "self" as interface name as it is reserved on line 1
|
||||
Cannot use 'self' as interface name as it is reserved on line 1
|
||||
-----
|
||||
<?php interface A extends parent {}
|
||||
-----
|
||||
Cannot use "parent" as interface name as it is reserved on line 1
|
||||
Cannot use 'parent' as interface name as it is reserved on line 1
|
||||
-----
|
||||
<?php interface A extends static {}
|
||||
-----
|
||||
Syntax error, unexpected T_STATIC, expecting T_STRING or T_NAMESPACE or T_NS_SEPARATOR on line 1
|
||||
Syntax error, unexpected T_STATIC, expecting T_STRING or T_NAMESPACE or T_NS_SEPARATOR on line 1
|
||||
|
@@ -2,12 +2,24 @@ Some special methods cannot be static
|
||||
-----
|
||||
<?php class A { static function __construct() {} }
|
||||
-----
|
||||
"__construct" method cannot be static on line 1
|
||||
Constructor __construct() cannot be static on line 1
|
||||
-----
|
||||
<?php class A { static function __destruct() {} }
|
||||
-----
|
||||
"__destruct" method cannot be static on line 1
|
||||
Destructor __destruct() cannot be static on line 1
|
||||
-----
|
||||
<?php class A { static function __clone() {} }
|
||||
-----
|
||||
"__clone" method cannot be static on line 1
|
||||
Clone method __clone() cannot be static on line 1
|
||||
-----
|
||||
<?php class A { static function __CONSTRUCT() {} }
|
||||
-----
|
||||
Constructor __CONSTRUCT() cannot be static on line 1
|
||||
-----
|
||||
<?php class A { static function __Destruct() {} }
|
||||
-----
|
||||
Destructor __Destruct() cannot be static on line 1
|
||||
-----
|
||||
<?php class A { static function __cLoNe() {} }
|
||||
-----
|
||||
Clone method __cLoNe() cannot be static on line 1
|
||||
|
@@ -3,4 +3,4 @@ Invalid __halt_compiler() syntax
|
||||
<?php
|
||||
__halt_compiler()
|
||||
-----
|
||||
__halt_compiler must be followed by "();" on line 2
|
||||
__HALT_COMPILER must be followed by "();" on line 2
|
||||
|
@@ -5,4 +5,4 @@ if (true) {
|
||||
__halt_compiler();
|
||||
}
|
||||
-----
|
||||
__halt_compiler() can only be used from the outermost scope on line 3
|
||||
__HALT_COMPILER() can only be used from the outermost scope on line 3
|
||||
|
@@ -2,11 +2,11 @@ Invalid namespace names
|
||||
-----
|
||||
<?php namespace self;
|
||||
-----
|
||||
Cannot use "self" as namespace name as it is reserved on line 1
|
||||
Cannot use 'self' as namespace name on line 1
|
||||
-----
|
||||
<?php namespace parent;
|
||||
-----
|
||||
Cannot use "parent" as namespace name as it is reserved on line 1
|
||||
Cannot use 'parent' as namespace name on line 1
|
||||
-----
|
||||
<?php namespace static;
|
||||
-----
|
||||
@@ -14,12 +14,12 @@ Syntax error, unexpected T_STATIC, expecting T_STRING or T_NS_SEPARATOR or '{' o
|
||||
-----
|
||||
<?php use A as self;
|
||||
-----
|
||||
Cannot use "A" as "self" because "self" is a special class name on line 1
|
||||
Cannot use A as self because 'self' is a special class name on line 1
|
||||
-----
|
||||
<?php use B as parent;
|
||||
-----
|
||||
Cannot use "B" as "parent" because "parent" is a special class name on line 1
|
||||
Cannot use B as parent because 'parent' is a special class name on line 1
|
||||
-----
|
||||
<?php use C as static;
|
||||
-----
|
||||
Syntax error, unexpected T_STATIC, expecting T_STRING on line 1
|
||||
Syntax error, unexpected T_STATIC, expecting T_STRING on line 1
|
||||
|
Reference in New Issue
Block a user