22aspect-oriented programming Package for laravel framework
33
44![ Build Status] ( https://github.com/ytake/Laravel-Aspect/workflows/Tests/badge.svg?branch=master )
5- [ ![ Coverage Status] ( http://img.shields.io/coveralls/ytake/Laravel-Aspect/master.svg?style=flat-square )] ( https://coveralls.io/r/ytake/Laravel-Aspect?branch=master )
6- [ ![ Scrutinizer Code Quality] ( http://img.shields.io/scrutinizer/g/ytake/Laravel-Aspect.svg?style=flat-square )] ( https://scrutinizer-ci.com/g/ytake/Laravel-Aspect/?branch=master )
7-
85[ ![ StyleCI] ( https://styleci.io/repos/40900709/shield )] ( https://styleci.io/repos/40900709 )
9- [ ![ SensioLabsInsight] ( https://insight.sensiolabs.com/projects/70dace68-fe04-4039-aeb4-47a64c6acca3/mini.png )] ( https://insight.sensiolabs.com/projects/70dace68-fe04-4039-aeb4-47a64c6acca3 )
106
117[ ![ License] ( http://img.shields.io/packagist/l/ytake/laravel-aspect.svg?style=flat-square )] ( https://packagist.org/packages/ytake/laravel-aspect )
128[ ![ Latest Version] ( http://img.shields.io/packagist/v/ytake/laravel-aspect.svg?style=flat-square )] ( https://packagist.org/packages/ytake/laravel-aspect )
@@ -31,6 +27,7 @@ This library is heavily inspired by the [jcabi/jcabi-aspects](https://github.com
3127 6.0.x | 4.0
3228 7.x | 6.0
3329 8.x | 7.0
30+ 9.x | 8.0
3431
3532### install
3633
@@ -40,25 +37,15 @@ $ composer require ytake/laravel-aspect
4037
4138* Supported Auto-Discovery(^Laravel5.5)*
4239
43- #### for Laravel5.1, 5.2
44- [ branch] ( https://github.com/ytake/Laravel-Aspect/tree/master-laravel5-legacy )
4540
46- ``` json
47- "require" : {
48- "php" : " >=5.5.9" ,
49- "laravel/framework" : " 5.*" ,
50- "ytake/laravel-aspect" : " ^1.0"
51- },
52- ```
53-
54- #### for Laravel5.6
41+ #### for Laravel9
5542[ Laravel-Aspect Supported Laravel5.6] ( https://github.com/ytake/Laravel-Aspect/blob/master-laravel5.6 )
5643
5744 ``` json
5845 "require" : {
5946 "php" : " >=7.1.3" ,
6047 "laravel/framework" : " ^5.7" ,
61- "ytake/laravel-aspect" : " ^3 .0.0"
48+ "ytake/laravel-aspect" : " ^8 .0.0"
6249 },
6350 ```
6451
@@ -448,46 +435,6 @@ class AspectQueryLog
448435testing.INFO: QueryLog:AspectQueryLog.multipleDatabaseAppendRecord {"queries":[{"query":"CREATE TABLE tests (test varchar(255) NOT NULL)","bindings":[],"time":0.58,"connectionName":"testing"},{"query":"CREATE TABLE tests (test varchar(255) NOT NULL)","bindings":[],"time":0.31,"connectionName":"testing_second"} ...
449436```
450437
451- ### @PostConstruct
452- The PostConstruct annotation is used on a method that needs to be executed after dependency injection is done to perform any initialization.
453-
454- you must use the PostConstructModule
455-
456- ``` php
457- use Ytake\LaravelAspect\Annotation\PostConstruct;
458-
459- class Something
460- {
461- protected $abstract;
462-
463- protected $counter = 0;
464-
465- public function __construct(ExampleInterface $abstract)
466- {
467- $this->abstract = $abstract;
468- }
469-
470- /**
471- * @PostConstruct
472- */
473- public function init()
474- {
475- $this->counter += 1;
476- }
477-
478- /**
479- * @return int
480- */
481- public function returning()
482- {
483- return $this->counter;
484- }
485- }
486-
487- ```
488-
489- ** The method MUST NOT have any parameters**
490-
491438### @RetryOnFailure
492439
493440Retry the method in case of exception.
0 commit comments