-
Notifications
You must be signed in to change notification settings - Fork 45
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
* Enum checks * Constant expression validation * Enum case check (AST fix) * Implement methods quick fixes for enums
- Loading branch information
Showing
20 changed files
with
277 additions
and
11 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
13 changes: 13 additions & 0 deletions
13
tests/org.eclipse.php.core.tests/workspace/errors/php81/enum01.pdtt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
--TEST-- | ||
New in initializers | ||
--FILE-- | ||
<?php | ||
enum Foo { | ||
case A; | ||
case X =1; | ||
private $el; | ||
} | ||
?> | ||
--EXPECT-- | ||
[line=4, start=32, end=33] Case Foo of non-backed enum X must not have a value | ||
[line=5, start=47, end=50] Enum may not include properties |
14 changes: 14 additions & 0 deletions
14
tests/org.eclipse.php.core.tests/workspace/errors/php81/enum02.pdtt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
--TEST-- | ||
New in initializers | ||
--FILE-- | ||
<?php | ||
enum Foo : int{ | ||
case A; | ||
case X = 1; | ||
private $el; | ||
} | ||
?> | ||
--EXPECT-- | ||
[line=3, start=28, end=29] Case Foo of backed enum A must have a value | ||
[line=5, start=53, end=56] Enum may not include properties | ||
|
10 changes: 10 additions & 0 deletions
10
tests/org.eclipse.php.core.tests/workspace/errors/php81/enum03.pdtt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
--TEST-- | ||
New in initializers | ||
--FILE-- | ||
<?php | ||
class MyClass { | ||
case X; | ||
} | ||
?> | ||
--EXPECT-- | ||
[line=3, start=28, end=29] Enum case can only be used in enums |
14 changes: 14 additions & 0 deletions
14
tests/org.eclipse.php.core.tests/workspace/errors/php81/enum04.pdtt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
--TEST-- | ||
New in initializers | ||
--FILE-- | ||
<?php | ||
interface FooInterface | ||
{ | ||
public function bar(); | ||
} | ||
|
||
enum Test implements FooInterface { | ||
} | ||
?> | ||
--EXPECT-- | ||
[line=7, start=63, end=67] The type Test must implement the inherited abstract method FooInterface::bar() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
56 changes: 56 additions & 0 deletions
56
.../org.eclipse.php.ui.tests/workspace/generation/unimplement_methods_php81/implement01.pdtt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
--TEST-- | ||
Test method generation | ||
--FILE-- | ||
<?php | ||
|
||
namespace Foo; | ||
|
||
use Something\Test; | ||
|
||
enum |Service| implements \ArrayAccess { | ||
} | ||
--EXPECT-- | ||
<?php | ||
|
||
namespace Foo; | ||
|
||
use Something\Test; | ||
|
||
enum Service implements \ArrayAccess { | ||
/** | ||
* {@inheritDoc} | ||
* @see ArrayAccess::offsetExists() | ||
*/ | ||
public function offsetExists($offset) { | ||
// TODO Auto-generated method stub | ||
|
||
} | ||
|
||
/** | ||
* {@inheritDoc} | ||
* @see ArrayAccess::offsetGet() | ||
*/ | ||
public function offsetGet($offset) { | ||
// TODO Auto-generated method stub | ||
|
||
} | ||
|
||
/** | ||
* {@inheritDoc} | ||
* @see ArrayAccess::offsetSet() | ||
*/ | ||
public function offsetSet($offset, $value) { | ||
// TODO Auto-generated method stub | ||
|
||
} | ||
|
||
/** | ||
* {@inheritDoc} | ||
* @see ArrayAccess::offsetUnset() | ||
*/ | ||
public function offsetUnset($offset) { | ||
// TODO Auto-generated method stub | ||
|
||
} | ||
|
||
} |
Oops, something went wrong.