1
|
|
|
<?php |
2
|
|
|
|
3
|
|
|
/** |
4
|
|
|
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR |
5
|
|
|
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, |
6
|
|
|
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE |
7
|
|
|
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER |
8
|
|
|
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, |
9
|
|
|
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN |
10
|
|
|
* THE SOFTWARE. |
11
|
|
|
* |
12
|
|
|
* This software consists of voluntary contributions made by many individuals |
13
|
|
|
* and is licensed under the MIT license. |
14
|
|
|
* |
15
|
|
|
* Copyright (c) 2015-2016 Yuuki Takezawa |
16
|
|
|
* |
17
|
|
|
*/ |
18
|
|
|
namespace Ytake\LaravelAspect; |
19
|
|
|
|
20
|
|
|
use Doctrine\Common\Annotations\AnnotationReader; |
21
|
|
|
|
22
|
|
|
/** |
23
|
|
|
* Class AnnotationConfiguration |
24
|
|
|
*/ |
25
|
|
|
class AnnotationConfiguration |
26
|
|
|
{ |
27
|
|
|
/** @var array */ |
28
|
|
|
protected $configuration; |
29
|
|
|
|
30
|
|
|
/** |
31
|
|
|
* AnnotationConfiguration constructor. |
32
|
|
|
* |
33
|
|
|
* @param array $configuration |
34
|
|
|
*/ |
35
|
|
|
public function __construct(array $configuration) |
36
|
|
|
{ |
37
|
|
|
$this->configuration = $configuration; |
38
|
|
|
} |
39
|
|
|
|
40
|
|
|
/** |
41
|
|
|
* Add a new annotation to the globally ignored annotation names with regard to exception handling. |
42
|
|
|
*/ |
43
|
|
|
public function ignoredAnnotations() |
44
|
|
|
{ |
45
|
|
|
if (isset($this->configuration['ignores'])) { |
46
|
|
|
$ignores = $this->configuration['ignores']; |
47
|
|
|
if (count($ignores)) { |
48
|
|
|
foreach ($ignores as $ignore) { |
49
|
|
|
AnnotationReader::addGlobalIgnoredName($ignore); |
50
|
|
|
} |
51
|
|
|
} |
52
|
|
|
} |
53
|
|
|
} |
54
|
|
|
} |
55
|
|
|
|