forked from universal-ctags/ctags
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request universal-ctags#2577 from masatake/php-typed-props
PHP: fill the typeref field for variable kind tags appeared as class properties
- Loading branch information
Showing
4 changed files
with
91 additions
and
29 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
--sort=no | ||
--fields=+{typeref}{inherits} |
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,9 @@ | ||
Person input.php /^class Person$/;" c | ||
age input.php /^ public int $age;$/;" v class:Person typeref:unknown:int | ||
User input.php /^class User extends Person$/;" c inherits:Person | ||
id input.php /^ public int $id;$/;" v class:User typeref:unknown:int | ||
name input.php /^ public ?string $name;$/;" v class:User typeref:unknown:?string | ||
next input.php /^ public self $next;$/;" v class:User typeref:class:User | ||
child input.php /^ public parent $child;$/;" v class:User typeref:class:Person | ||
__construct input.php /^ public function __construct($id, $name) {$/;" f class:User | ||
u input.php /^$u = new User (0, "A");$/;" v |
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,23 @@ | ||
<?php | ||
// Derived from https://www.php.net/manual/en/migration74.new-features.php | ||
class Person | ||
{ | ||
public int $age; | ||
} | ||
|
||
class User extends Person | ||
{ | ||
public int $id; | ||
public ?string $name; | ||
public self $next; | ||
public parent $child; | ||
public function __construct($id, $name) { | ||
$this->id = $id; | ||
$this->name = $name; | ||
$this->next = $this; | ||
$this->child = $this; | ||
} | ||
} | ||
$u = new User (0, "A"); | ||
echo $u->next->name; | ||
?> |
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