Weave Code
Code Weaver
Helps Laravel developers discover, compare, and choose open-source packages. See popularity, security, maintainers, and scores at a glance to make better decisions.
Feedback
Share your thoughts, report bugs, or suggest improvements.
Subject
Message

Framework Laravel Package

goaop/framework

Go! AOP brings aspect-oriented programming to PHP without extensions or eval. Define aspects once to apply logging, caching, security and other cross-cutting concerns across your app automatically, keeping business code clean with static file weaving.

View on GitHub
Deep Wiki
Context7
3.1.0

What's Changed

New Contributors

Full Changelog: https://github.com/goaop/framework/compare/3.0.0...3.1.0

3.1.1

Patch release, which includes https://github.com/goaop/framework/commit/d268f6fcc22eacf47a6c97917ca41cc3db5941d0 to allow backward-compatibility with 3.x branch

3.0.0

Better late than never! This is next major release of Go! AOP that contains some improvements and uses new code features for better performance and stability.

Notable changes are:

  • [BC BREAK] Switched to the PHP7.4 and upper, strict types, property and return type hints and new syntax
  • [BC BREAK] Removed the Joinpoint->getThis() method, as not all joinpoints belongs to classes (eg. FunctionInvocation)
  • [BC BREAK] Removed the Joinpoint->getStaticPart() method as it can return anything, better to use explicit methods
  • [Feature] Introduced the new ClassJoinpoint interface with getScope(), getThis() and isDynamic() methods
  • [Feature] Implemented parameter widening feature for generated code #380
  • [Feature] AnnotatedReflectionProperty provides simple access to property annotations #388 by @TheCelavi
  • [Feature] Switched to the laminas/laminas-code package to generate code for proxies
  • [Feature] Add private properties interception #412
  • [Feature] Static code analysis with PhpStan was enabled
  • [Feature] Migration from TravisCI to GitHub Actions

Notice: This version still doesn't support PHP8, see #466, mostly because of absence of PHP8-compatible parser reflection libraries. If you want to contribute this to one of existing projects, this will be very helpful.

2.3.4

Small patch version to allow installation of Symfony5 components #447

3.0.0-RC1

This is next major release of Go! AOP that contains some improvements and uses new code features for better performance and stability.

Notable changes are:

  • [BC BREAK] Switched to the PHP7.2 and upper, strict types, return type hints and new syntax
  • [BC BREAK] Removed the Joinpoint->getThis() method, as not all joinpoints belongs to classes (eg. FunctionInvocation)
  • [BC BREAK] Removed the Joinpoint->getStaticPart() method as it can return anything, better to use explicit methods
  • [Feature] Introduced the new ClassJoinpoint interface with getScope(), getThis() and isDynamic() methods
  • [Feature] Implemented parameter widening feature for generated code #380
  • [Feature] AnnotatedReflectionProperty provides simple access to property annotations #388 by @TheCelavi
  • [Feature] Switched to the zendframework/zend-code package to generate code for proxies
  • [Feature] Add private properties interception #412
2.3.3

This is a patch release with #425 bug fix.

2.3.2

Patch release that contains several small fixes

  • Fixed call to undefined method with new PhpParser for 2.x branch #419
  • Finder glob pattern #421
  • Fix memory leaks and late object disposal #423
2.3.0

This minor release introduces some fixes:

  • Fix error with "self" references in top level namespace #397
  • Use Symfony Finder component for faster enumeration #402
  • [BC Break] Update goaop/parser-reflection dependency to 2.0+ #403

Please, be aware that #403 bumps the PHP minimum version for 2.x branch to be >=7.0.0. As minimum supported PHP version now is 7.2, I decided to drop 5.6 for 2.x branch too.

In emergency cases 2.3.1 patch can be released.

2.2.0

This version introduces latest minor release in 2.x branch. Only security fixes and bug patches will be applied to the 2.x since current release.

Fixes:

  • AdviceMatcher should reject abstract method as fix for #335, #337
  • Fix wrong checking of member modifiers for static members, resolves #293
  • Feature/detecting inconsistent weaving #346
  • Fix incorrect optimization logic for transformers, resolves #355
  • Introduce an option to configure cached reader for annotations, resolves #136, #358 and #245

Improvements:

  • Replace unsupported HHVM with supported PHP7.2 in Travis matrix
  • Inline definition of advices into classes and beautify formatting
  • Improve PhpUnit integration and prepare reusable constraints, resolves #340 #350
  • Add support for class initializations asserts. #354
  • Apply short array syntax for files in 2.x branch
  • Performance tuning

Features:

  • Implementation of AST+token modification instead of direct source transforming #362. Be aware, that this feature can reduce the speed of proxy generation because of switching to the AST analysis.
  • Implement return-type pointcuts for the framework, #370 #371. Now you can match methods by return type.
  • Interception of final methods, resolves #372 #373. Yes, now you can intercept final methods in your classes with Go! AOP.

BC breaks on code level:

  • d0c11d06aba419a4ce2bbedd89c7e4957352ac46 Simplify interface of IntroductionAdvisor, also allow only one interface/trait per introduction.
2.1.2

This small patch introduces following fixes, thanks to @TheCelavi:

  • Implement workaround for Doctrine entities with metadata listener #327
  • CLI commands can be owerwritten for transparent integration with frameworks #330
2.1.1

Small patch version with fixes

  • Fix fnmatch issue on Windows machine #326
  • Fix incorrect usage of CachedAspectLoader when cache is not configured #319
2.1.0

Version 2.1.0 enables support for PHP7.1. As well it provides some useful features for you applications:

  • Add support for the nullable types in PHP7.1, see #309, #314
  • Add support for the void return types for PHP7.1, see #307
  • Update the requirement for the goaop/parser-reflection library to use the latest version with PHP7.1 support.
  • Add a fix for non-absolute paths returned from the composer since PHP5.6 #295
  • Add an ability to update invocation arguments via Invocation->setArguments() method #297
  • Enable wildcard paths for the Enumerator, e.g /*Bundle/*/Tests, see #300
  • Allow to pass an exception as a second argument to the invocation for the AfterThrowing type of adivce, see #302
1.2.0

Version 1.2.0 is a minor release with one new feature and several fixes:

  • Add an ability to update invocation arguments in advices, see #297
  • Restrict the 1.x branch only to the PHP5.5, because andrewsville/php-token-reflection can work only with PHP=<5.5 and is not maintained anymore, see #305
  • Fix broken logic of pattern matching for includePath and excludePath options, see #300, #311

Please, note, that the branch 1.x will not receive any new features and you should plan your time to upgrade to the 2.x versions.

2.0.0

Here it is! Shiny 2.0.0 version!

This version contains a lot of fixes and improvements:

  • Added a support for the PHP5.6 and 7.0 features: variadic arguments for methods, scalar type hints, return type hints
  • Migrated from the Andrewswille/Token-Reflection to the goaop/parser-reflection library for PHP5.6 and PHP7.0 support
  • Command-line tools for debugging aspects and advisors
  • Dropped support for PHP<5.6, cleaned all old code
  • [BC BREAK] Removed ability to rebind closures because of PHP restrictions, see #247
  • [BC BREAK] Removed getDefaultFeatures() method from the AspectKernel, no need in it since PHP5.6

Changes from the 1.x branch:

  • Fixed cache files permission, now all cache files will be created with given cache mode, resolves #275
  • Added context-sensitive matching that allows new checks #274 and resolves #272 by providing a new pointcut expression !matchInherited() to exclude all inherited methods from matching
  • Fixed logic for complex pointcut expressions, combined with OR logic, resolves #217
  • Fixed broken property interception generated source code for the constructor, resolves #271
  • Property interceptor now use trait for common logic as well returns values by reference, see #54 and #232

Pay attention, that some internal parts are changed, so be careful when updated. Also property interceptors logic is changed now and to modify values in advices, you should use returning by reference methods like following:

    /**
     * Advice that controls an access to the properties
     *
     * [@param](https://github.com/param) FieldAccess $fieldAccess Joinpoint
     *
     * [@Around](https://github.com/Around)("access(public|protected Demo\Example\PropertyDemo->*)")
     * [@return](https://github.com/return) mixed
     */
    public function aroundFieldAccess(FieldAccess $fieldAccess)
    {
        $isRead = $fieldAccess->getAccessType() == FieldAccess::READ;
        // proceed all internal advices
        $fieldAccess->proceed();

        if ($isRead) {
            // if you want to change original property value, then return it by reference
            $value = /* & */$fieldAccess->getValue();
        } else {
            // if you want to change value to set, then return it by reference
            $value = /* & */$fieldAccess->getValueToSet();
        }

        echo $fieldAccess, ", value: ", json_encode($value), PHP_EOL;
    }
1.1.0

This version contains several important fixes and improvements:

  • Fixed cache files permission, now all cache files will be created with given cache mode, resolves #275
  • Added context-sensitive matching that allows new checks #274 and resolves #272 by providing a new pointcut expression !matchInherited() to exclude all inherited methods from matching
  • Fixed logic for complex pointcut expressions, combined with OR logic, resolves #217
  • Fixed broken property interception generated source code for the constructor, resolves #271
  • Property interceptor now use trait for common logic as well returns values by reference, see #54 and #232

Pay attention, that some internal parts are changed, so be careful, when updated. Also property interceptors logic is changed now and to modify values in advices, you should use returning by reference methods like following:

    /**
     * Advice that controls an access to the properties
     *
     * [@param](https://github.com/param) FieldAccess $fieldAccess Joinpoint
     *
     * [@Around](https://github.com/Around)("access(public|protected Demo\Example\PropertyDemo->*)")
     * [@return](https://github.com/return) mixed
     */
    public function aroundFieldAccess(FieldAccess $fieldAccess)
    {
        $isRead = $fieldAccess->getAccessType() == FieldAccess::READ;
        // proceed all internal advices
        $fieldAccess->proceed();

        if ($isRead) {
            // if you want to change original property value, then return it by reference
            $value = /* & */$fieldAccess->getValue();
        } else {
            // if you want to change value to set, then return it by reference
            $value = /* & */$fieldAccess->getValueToSet();
        }

        echo $fieldAccess, ", value: ", json_encode($value), PHP_EOL;
    }
1.0.2

Patch release fox fixing the issue #259, which dramatically reduce the performance of the framework.

1.0.0

1.0.0 (Feb 13, 2016)

  • Dropped support for PHP<5.5, clean all old code
  • Tagged public methods and interfaces with @api tag. No more changes for them in future.
  • Refactored core code to use general interceptors for everything instead of separate classes
  • New static initialization pointcut to intercept the moment of class loading
  • New feature to intercept object initializations, requires INTERCEPT_INITIALIZATIONS to be enabled
  • [BC BREAK] remove class() pointcut from the grammar #189
  • [BC BREAK] make within() and @within() match all joinpoints #189
  • [BC BREAK] drop @annotation syntax. Add @execution pointcut
  • Pointcuts can be build now directly from closures via PointcutBuilder class
  • Do not create files in the cache, if no aspects were applied to them, respects includePath option now
  • FilterInjector is now disabled by default, this job for composer integration now
  • Automatic opcache invalidation for cache state file
0.6.1

Minor patch to fix a bug with overwriting of original files

0.6.0

Version 0.6.0 is ready! This is probably the last 0.x release and now we are going to 1.0.0.

However, this version also includes some improvements and changes:

  • Interceptor for magic methods via "dynamic" pointcut. This feature also gives an access for dynamic pointcuts with different checks and conditions.
  • PSR-4 standard for the codebase, thanks to @cordoval
  • Added a support for splat (...) operator for more efficient advice invocation (requires PHP5.6)
  • New feature system. All tunings of kernel are configured with feature-set. This breaks old configuration option interceptFunctions=>true use 'features' => $defaultFeatures | Features::INTERCEPT_FUNCTIONS now
  • Proxy can generate more effective invocation call with static::class for PHP>=5.5
  • Bug-fixes with empty cache path and PSR4 code, thanks to @andy-shea
0.5.0

Version 0.5.0 of framework is ready!

  • Proxies are now stored in the separate files to allow more transparent debugging
  • Cache warmer command added
  • Extended pointcut syntax for or-ed methods: ClassName->method1|method2(*)
  • Access to the annotations from MethodInvocation instance
  • Support for read-only file systems (phar, GAE, etc)
  • Direct access to advisors (no more serialize/unserialize)
  • New @within pointcut to match classes by annotation class
  • Nice demo GUI
  • Deprecate the usage of submodules for framework
  • Inheritance support during class-loading and weaving
  • List of small fixes and imrovements
0.4.3
  1. Add minor changes for supporting CLI-mode
  2. Optimization: sort list of advices only during the cache creation phase
  3. Optimization: do not split a source into array of lines if there is only one class per file
0.4.2
  1. Switched to doctrine/annotations package instead of doctrine/common
  2. Removed the Demo namespace from the composer and use it only for testing.
  3. Optimized injection of advices and caching of callables
  4. Some fixes for supporting Symfony2 and SensioDistributionBundle
0.4.1
  • Better parsing of complex "include" expressions for Yii (by @zvirusz)
  • Support for dynamic arguments count for methods by checking for func_get_args() inside method body
  • Fixed a bug with autoloaders reodering (by @zvirusz)
0.4.0

This release contains a lot of new features. Here are the short changelog for them:

  • Privileged advices for aspect: allows to access private and protected properties and methods of objects inside advice
  • Full integration with composer that allows for easy configuration and workflow with AOP
  • Fix some bugs with caching on Windows
  • "True" pointcut references that gives the ability to compose a complex pointcut from a simple pointcuts.
  • Pointcut now accept "$this" in references to point to the current aspect instance (Allows for abstract aspects and abstract pointcuts)
  • AspectContainer interface was extracted. This gives the way to integrate with another DIC. Look at Warlock framework.
  • Intercepting system functions such as fopen(), file_get_contents(), etc
  • Annotation property pointcut was added
  • Ability to declare multiple interfaces and/or traits with single DeclareParent introduction
  • DeclareError interceptor was added. This can be used for generating an runtime error for methods that should not be executed in such a way.
Weaver

How can I help you explore Laravel packages today?

Conversation history is not saved when not logged in.
Prompt
Add packages to context
No packages found.
yandex/translate-api
voku/simple_html_dom
league/flysystem-vfs
bkwld/upchuck
filament/spatie-laravel-tags-plugin
capell-app/block-library
axium/identity
cetria/laravel-dummy-models
cetria/reflection-helper
agropredict/sso-auth-bundle
evolvestudio/spam-protection
datacore/hub-sdk
develia/commons
cuci/prototurk-sdk
cuci/prototurk-sdk-symfony
develia/geo-bundle
dreamzy/livewire-charts
touchestate-sdk/php-sdk
22h/doctrine-garbage-collection-bundle
agtp/agtp-php