-
-
Notifications
You must be signed in to change notification settings - Fork 19
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #26 from ytake/feature-ignore-annotations
Feature ignore annotations
- Loading branch information
Showing
7 changed files
with
99 additions
and
2 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
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,36 @@ | ||
<?php | ||
|
||
/** | ||
* Class IgnoreAnnotationTest | ||
*/ | ||
class IgnoreAnnotationTest extends AspectTestCase | ||
{ | ||
/** @var \Ytake\LaravelAspect\AspectManager $manager */ | ||
protected $manager; | ||
|
||
protected function setUp() | ||
{ | ||
parent::setUp(); | ||
$this->manager = new \Ytake\LaravelAspect\AspectManager($this->app); | ||
$this->resolveManager(); | ||
} | ||
|
||
public function testGenerateCacheNameRemoveNullKey() | ||
{ | ||
/** @var \__Test\AnnotationStub $class */ | ||
$class = $this->app->make(\__Test\AnnotationStub::class); | ||
$this->assertNull($class->testing()); | ||
} | ||
|
||
|
||
/** | ||
* | ||
*/ | ||
protected function resolveManager() | ||
{ | ||
/** @var \Ytake\LaravelAspect\RayAspectKernel $aspect */ | ||
$aspect = $this->manager->driver('ray'); | ||
$aspect->register(\__Test\LogExceptionsModule::class); | ||
$aspect->dispatch(); | ||
} | ||
} |
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 |
---|---|---|
|
@@ -42,5 +42,10 @@ | |
'debug' => true, | ||
], | ||
], | ||
'ignores' => [ | ||
// global Ignored Annotations | ||
'Get', | ||
'Resource' | ||
], | ||
], | ||
]; |
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,25 @@ | ||
<?php | ||
|
||
|
||
namespace __Test; | ||
|
||
use Ytake\LaravelAspect\Annotation\LogExceptions; | ||
|
||
/** | ||
* Class AnnotationStub | ||
* for tests | ||
* @Resource | ||
*/ | ||
class AnnotationStub | ||
{ | ||
/** | ||
* @LogExceptions | ||
* @Get | ||
* @param null $id | ||
* @return null | ||
*/ | ||
public function testing($id = null) | ||
{ | ||
return $id; | ||
} | ||
} |
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