Skip to content

Commit

Permalink
Merge branch 'php8'
Browse files Browse the repository at this point in the history
  • Loading branch information
InFog committed Jan 2, 2021
2 parents 06d948c + a3a3063 commit cf1d4fe
Show file tree
Hide file tree
Showing 5 changed files with 1,598 additions and 8 deletions.
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
.test_fs
build/
vendor/
composer.lock
14 changes: 9 additions & 5 deletions PHPCtags.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

class PHPCtags
{
const VERSION = '0.8.1';
const VERSION = '0.9.0';

private $mFile;

Expand Down Expand Up @@ -323,14 +323,16 @@ private function render($structure)
if (in_array('s', $this->mOptions['fields']) && !empty($struct['scope'])) {
// $scope, $type, $name are current scope variables
$scope = array_pop($struct['scope']);
list($type, $name) = each($scope);
$type = key($scope);
$name = current($scope);
switch ($type) {
case 'class':
// n_* stuffs are namespace related scope variables
// current > class > namespace
$n_scope = array_pop($struct['scope']);
if(!empty($n_scope)) {
list($n_type, $n_name) = each($n_scope);
$n_type = key($n_scope);
$n_name = current($n_scope);
$s_str = 'class:' . $n_name . '\\' . $name;
} else {
$s_str = 'class:' . $name;
Expand All @@ -340,10 +342,12 @@ private function render($structure)
// c_* stuffs are class related scope variables
// current > method > class > namespace
$c_scope = array_pop($struct['scope']);
list($c_type, $c_name) = each($c_scope);
$c_type = key($c_scope);
$c_name = current($c_scope);
$n_scope = array_pop($struct['scope']);
if(!empty($n_scope)) {
list($n_type, $n_name) = each($n_scope);
$n_type = key($n_scope);
$n_name = current($n_scope);
$s_str = 'method:' . $n_name . '\\' . $c_name . '::' . $name;
} else {
$s_str = 'method:' . $c_name . '::' . $name;
Expand Down
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"type": "library",
"require": {
"php": ">=7.0",
"nikic/php-parser": "^4.5"
"nikic/php-parser": "^4.10"
},
"require-dev": {
"phpunit/phpunit": "^6.5"
Expand Down
Loading

0 comments on commit cf1d4fe

Please sign in to comment.