removal of unnecessary file, and composer update

This commit is contained in:
2019-01-09 23:31:31 -06:00
parent a90688deb6
commit e4380f2ffe
604 changed files with 32070 additions and 26824 deletions
+6
View File
@@ -1,6 +1,12 @@
CHANGELOG
---------
### v3.1.3, 2019.01.07
- Fixed a bug that prevented traits to be correctly resolved when used by an
anonymous class
- Fixed a bug that occurred when `$this` keyword was used inside an anonymous class
### v3.1.2, 2018.12.16
* Fixed a bug regarding comma trail in group-use statements. See [issue 23](https://github.com/opis/closure/issues/23)
+1 -1
View File
@@ -1,6 +1,6 @@
The MIT License (MIT)
Copyright (c) 2014-2017 The Opis Project
Copyright (c) 2018 Zindex Software
Permission is hereby granted, free of charge, to any person obtaining a copy of
this software and associated documentation files (the "Software"), to deal in
+1 -1
View File
@@ -1,5 +1,5 @@
Opis Closure
Copyright 2018 Zindex Software
Copyright 2018-2019 Zindex Software
This product includes software developed at
Zindex Software (http://zindex.software).
+1 -1
View File
@@ -34,7 +34,7 @@
},
"extra": {
"branch-alias": {
"dev-master": "3.0.x-dev"
"dev-master": "3.1.x-dev"
}
}
}
+21 -2
View File
@@ -107,6 +107,8 @@ class ReflectionClosure extends ReflectionFunction
$hasTraitSupport = defined('T_TRAIT_C');
$tokens = $this->getTokens();
$state = $lastState = 'start';
$inside_anonymous = false;
$anonymous_mark = 0;
$open = 0;
$code = '';
$id_start = $id_start_ci = $id_name = $context = '';
@@ -248,6 +250,8 @@ class ReflectionClosure extends ReflectionFunction
$code .= '}';
if(--$open === 0){
break 3;
} elseif ($inside_anonymous) {
$inside_anonymous = !($open === $anonymous_mark);
}
break;
case T_LINE:
@@ -285,7 +289,7 @@ class ReflectionClosure extends ReflectionFunction
}
break;
case T_VARIABLE:
if($token[1] == '$this'){
if($token[1] == '$this' && !$inside_anonymous){
$isUsingThisObject = true;
}
$code .= $token[1];
@@ -309,6 +313,12 @@ class ReflectionClosure extends ReflectionFunction
$state = 'id_start';
$lastState = 'closure';
break 2;
case T_USE:
$code .= $token[1];
$context = 'use';
$state = 'id_start';
$lastState = 'closure';
break;
case T_INSTANCEOF:
$code .= $token[1];
$context = 'instanceof';
@@ -453,7 +463,12 @@ class ReflectionClosure extends ReflectionFunction
break;
default:
if($id_start !== '\\'){
if($context === 'instanceof' || $context === 'args' || $context === 'return_type' || $context === 'extends'){
if($context === 'use' ||
$context === 'instanceof' ||
$context === 'args' ||
$context === 'return_type' ||
$context === 'extends'
){
if($id_start_ci === 'self' || $id_start_ci === 'static' || $id_start_ci === 'parent'){
$isUsingScope = true;
} elseif (!($php7 && in_array($id_start_ci, $php7_types))){
@@ -494,6 +509,10 @@ class ReflectionClosure extends ReflectionFunction
break;
case '{':
$state = 'closure';
if (!$inside_anonymous) {
$inside_anonymous = true;
$anonymous_mark = $open;
}
$i--;
break;
default: