forked from goaop/framework
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Possible fix for goaop/goaop-symfony-bundle#15
- Loading branch information
Showing
15 changed files
with
151 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
<?php | ||
/* | ||
* Go! AOP framework | ||
* | ||
* @copyright Copyright 2014, Lisachenko Alexander <[email protected]> | ||
* | ||
* This source file is subject to the license that is bundled | ||
* with this source code in the file LICENSE. | ||
*/ | ||
|
||
namespace Go\Exception; | ||
|
||
class CircularWeavingException extends \RuntimeException implements ExceptionInterface | ||
{ | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
<?php | ||
/* | ||
* Go! AOP framework | ||
* | ||
* @copyright Copyright 2014, Lisachenko Alexander <[email protected]> | ||
* | ||
* This source file is subject to the license that is bundled | ||
* with this source code in the file LICENSE. | ||
*/ | ||
|
||
namespace Go\Exception; | ||
|
||
interface ExceptionInterface | ||
{ | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
16 changes: 16 additions & 0 deletions
16
tests/Fixtures/project/src/Application/CircularyWeaved.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
<?php | ||
|
||
namespace Go\Tests\TestProject\Application; | ||
|
||
use Go\Tests\TestProject\Annotation as Aop; | ||
|
||
class CircularyWeaved | ||
{ | ||
/** | ||
* @Aop\Loggable() | ||
*/ | ||
public function youCanNotWeaveMe() | ||
{ | ||
|
||
} | ||
} |
30 changes: 30 additions & 0 deletions
30
tests/Fixtures/project/src/Aspect/CircularWeavingAspect.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
<?php | ||
|
||
namespace Go\Tests\TestProject\Aspect; | ||
|
||
use Go\Aop\Aspect; | ||
use Go\Aop\Intercept\MethodInvocation; | ||
use Go\Tests\TestProject\Application\CircularyWeaved; | ||
use Go\Lang\Annotation as Pointcut; | ||
|
||
class CircularWeavingAspect implements Aspect | ||
{ | ||
private $circularyWeaved; | ||
|
||
public function __construct(CircularyWeaved $circularyWeaved) | ||
{ | ||
$this->circularyWeaved = $circularyWeaved; | ||
} | ||
|
||
/** | ||
* Intercepts doSomething() | ||
* | ||
* @param MethodInvocation $invocation | ||
* | ||
* @Pointcut\After("execution(public Go\Tests\TestProject\Application\CircularyWeaved->youCanNotWeaveMe(*))") | ||
*/ | ||
public function failToIntercept(MethodInvocation $invocation) | ||
{ | ||
$this->circularyWeaved->youCanNotWeaveMe(); | ||
} | ||
} |
22 changes: 22 additions & 0 deletions
22
tests/Fixtures/project/src/Kernel/CircularWeavingAspectKernel.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
<?php | ||
|
||
namespace Go\Tests\TestProject\Kernel; | ||
|
||
use Go\Core\AspectContainer; | ||
use Go\Core\AspectKernel; | ||
use Go\Tests\TestProject\Application\CircularyWeaved; | ||
use Go\Tests\TestProject\Aspect\CircularWeavingAspect; | ||
use Go\Tests\TestProject\Aspect\LoggingAspect; | ||
use Psr\Log\NullLogger; | ||
|
||
class CircularWeavingAspectKernel extends AspectKernel | ||
{ | ||
/** | ||
* {@inheritdoc} | ||
*/ | ||
protected function configureAop(AspectContainer $container) | ||
{ | ||
$container->registerAspect(new LoggingAspect(new NullLogger())); | ||
$container->registerAspect(new CircularWeavingAspect(new CircularyWeaved())); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
<?php | ||
|
||
namespace Go\Functional; | ||
|
||
class CircularWeavingTest extends BaseFunctionalTest | ||
{ | ||
public function testCircularWeaving() | ||
{ | ||
self::clearCache(); | ||
$output = self::exec('cache:warmup:aop', '', 'circular_weaving', false); | ||
$this->assertContains('is not processed correctly due to detected circular weaving.', $output); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters