1
0
mirror of https://github.com/danog/PHP-Parser.git synced 2024-12-04 18:28:25 +01:00
PHP-Parser/test/code/parser/stmt/class/modifier.test-fail
Nikita Popov 3b7d8e8b5d Enable basic error recovery
Adding only a single recovery rule for now.

The API is now:
 * throwOnError parser option must be disabled.
 * List of Errors is available through $parser->getErrors(). This
   method is available either way.
 * If no recovery is possible $parser->parse() will return null.
   (Obviously only if throwOnError is disabled).
2015-04-30 17:41:57 +02:00

50 lines
1.2 KiB
Plaintext

Invalid modifier combination
-----
<?php class A { public public $a; }
-----
Multiple access type modifiers are not allowed on line 1
-----
<?php class A { public protected $a; }
-----
Multiple access type modifiers are not allowed on line 1
-----
<?php class A { abstract abstract a(); }
-----
Multiple abstract modifiers are not allowed on line 1
-----
<?php class A { static static $a; }
-----
Multiple static modifiers are not allowed on line 1
-----
<?php class A { final final a() {} }
-----
Multiple final modifiers are not allowed on line 1
-----
<?php class A { abstract final a(); }
-----
Cannot use the final modifier on an abstract class member on line 1
-----
<?php abstract final class A { }
// Type in the partial parse could conceivably be any of 0, 16 or 32
-----
Syntax error, unexpected T_FINAL, expecting T_CLASS from 1:16 to 1:20
array(
0: Stmt_Class(
type: 32
name: A
extends: null
implements: array(
)
stmts: array(
)
)
)
-----
<?php class A { abstract $a; }
-----
Properties cannot be declared abstract on line 1
-----
<?php class A { final $a; }
-----
Properties cannot be declared final on line 1