- Fixed string interpolation
- Fixed serialization error #84
- Initial PHP 8 Support #67.
- Fixed issue #70
- Fixed a false-positive when using
Opis\Closure\ReflectionClosure::isScopeRequired
method
- Fixed a false-positive when using
Opis\Closure\ReflectionClosure::isScopeRequired
method - Fixed a bug related to
T_STRING_VARNAME
- Improved parser
- The class scope optimisation is no longer used. We always bind now to the closure's original class scope.
When the class scope was
null
, the optimisation failed to work as expected and kept the wrongSerializableClosure
scope.
- Removed extra semicolon in short closures, since is not part of the closure's body.
- Bugfix. See #47
- Added support for short closures (arrow functions)
- Added
isShortClosure
method toOpis\Closure\ReflectionClosure
- Added
stream_set_option()
- Fixed a bug that prevented serialization to work correctly.
- Added
createClosure
static method inOpis\Closure\SerializableClosure
. This method creates a new closure from arbitrary code, emulatingcreate_function
, but without using eval
- Use
sha1
instead ofmd5
for hashing file names inOpis\Closure\ReflectionClosure
class
- Fixed a bug that prevented signed closures to properly work when the serialized string
contains invalid UTF-8 chars. Starting with this version
json_encode
is no longer used when signing a closure. Backward compatibility is maintained and all closures that were previously signed using the old method will continue to work.
- Since an unsigned closure can be unserialized when no security provider is set,
there is no reason to treat differently a signed closure in the same situation.
Therefore, the
Opis\Closure\SecurityException
exception is no longer thrown when unserializing a signed closure, if no security provider is set.
- Fixed a bug that occurred when trying to set properties of classes that were not defined in user-land. Those properties are now ignored.
- Improved parser
- Added support for static methods that are named using PHP keywords or magic constants.
Ex:
A::new()
,A::use()
,A::if()
,A::function()
,A::__DIR__()
, etc. - Used
@internal
to mark classes & methods that are for internal use only and backward compatibility is not guaranteed.
- 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
- Fixed a bug regarding comma trail in group-use statements. See issue 23
- Fixed a bug where
parent
keyword was treated like a class-name and scope was not added to the serialized closure - Fixed a bug where return type was not properly handled for nested closures
- Support for anonymous classes was improved
- Added
transformUseVariables
andresolveUseVariables
toOpis\Closure\SerializableClosure
class. - Added
removeSecurityProvider
static method toOpis\Closure\SerializableClosure
class. - Fixed some security related issues where a user was able to unserialize an unsigned closure, even when a security provider was in use.
- Bugfix. See issue 20
- Bugfix. See issue 18
- Improved support for PHP 7.1 & 7.2
- Fixed a bug where the return type was not properly resolved. See issue 17
- Added more tests
- Fixed a bug. See issue 16
- Bugfix: static properties are ignored now, since they are not serializable
- Fixed a bug introduced by accident in 3.0.5
- Fixed a bug related to nested references
- [internal] Refactored
SerializableClosure::mapPointers
method - [internal] Added a new optional argument to
SerializableClosure::unwrapClosures
- [internal] Removed
SerializableClosure::getClosurePointer
method - Fixed various bugs
- Fixed a bug related to nested object references
- [internal]
Opis\Closure\ClosureScope
now extendsSplObjectStorage
- [internal] The
storage
property was removed fromOpis\Closure\ClosureScope
- [internal] The
instances
andobjects
properties were removed fromOpis\Closure\ClosureContext
- Fixed a bug where
$this
object was not handled properly inside theSerializableClosre::serialize
method.
- Fixed a bug in 'ignore_next' state
- Dropped PHP 5.3 support
- Moved source files from
lib
tosrc
folder - Removed second parameter from
Opis\Closure\SerializableClosure::from
method and from constructor - Removed
Opis\Closure\{SecurityProviderInterface, DefaultSecurityProvider, SecureClosure}
classes - Refactored how signed closures were handled
- Added
wrapClosures
andunwrapClosures
static methods toOpis\Closure\SerializableClosure
class - Added
Opis\Colosure\serialize
andOpis\Closure\unserialize
functions - Improved serialization. You can now serialize arbitrary objects and the library will automatically wrap all closures
- The parser was refactored and improved
- Refactored
Opis\Closure\SerializableClosure::__invoke
method Opis\Closure\{ISecurityProvider, SecurityProvider}
were addedOpis\Closure\{SecurityProviderInterface, DefaultSecurityProvider, SecureClosure}
were deprecated and they will be removed in the next major versionsetSecretKey
andaddSecurityProvider
static methods were added toOpis\Closure\SerializableClosure
- Fixed a bug that prevented namespace resolution to be done properly
- Hotfix. See PR
- Added
isBindingRequired
andisScopeRequired
to theOpis\Closure\ReflectionClosure
class - Automatically detects when the scope and/or the bound object of a closure needs to be serialized.
- Fixed a bug in
Opis\Closure\ReflectionClosure::fetchItems
- Fixed CS
Opis\Closure\ClosureContext
,Opis\Closure\ClosureScope
,Opis\Closure\SelfReference
andOpis\Closure\SecurityException
classes were moved into separate files- Added support for PHP7 syntax
- Fixed some bugs in
Opis\Closure\ReflectionClosure
class - Improved closure parser
- Added an analyzer for SuperClosure library
- Added support for the missing
__METHOD__
,__FUNCTION__
and__TRAIT__
magic constants - Added some security related classes and interfaces:
Opis\Closure\SecurityProviderInterface
,Opis\Closure\DefaultSecurityProvider
,Opis\Closure\SecureClosure
,Opis\Closure\SecurityException
. - Fiexed a bug in
Opis\Closure\ReflectionClosure::getClasses
method - Other minor bugfixes
- Added support for static closures
- Added public
isStatic
method toOpis\Closure\ReflectionClosure
class
- Removed
branch-alias
property fromcomposer.json
- Bugfix. See issue #6
- The closure parser was improved
- Class names are now automatically resolved
- Added support for the
#trackme
directive which allows tracking closure's residing source
- Added autoload file
- Changed README file
- Started changelog