1
|
|
|
<?php |
2
|
|
|
declare(strict_types=1); |
3
|
|
|
|
4
|
|
|
/** |
5
|
|
|
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR |
6
|
|
|
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, |
7
|
|
|
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE |
8
|
|
|
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER |
9
|
|
|
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, |
10
|
|
|
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN |
11
|
|
|
* THE SOFTWARE. |
12
|
|
|
* |
13
|
|
|
* This software consists of voluntary contributions made by many individuals |
14
|
|
|
* and is licensed under the MIT license. |
15
|
|
|
* |
16
|
|
|
* Copyright (c) 2015-2020 Yuuki Takezawa |
17
|
|
|
* |
18
|
|
|
*/ |
19
|
|
|
|
20
|
|
|
namespace Ytake\LaravelAspect; |
21
|
|
|
|
22
|
|
|
use Ytake\LaravelAspect\AspectServiceProvider as AspectProvider; |
23
|
|
|
|
24
|
|
|
/** |
25
|
|
|
* Class LumenAspectServiceProvider |
26
|
|
|
* |
27
|
|
|
* @codeCoverageIgnore |
28
|
|
|
*/ |
29
|
|
|
class LumenAspectServiceProvider extends AspectProvider |
30
|
|
|
{ |
31
|
|
|
/** |
32
|
|
|
* {@inheritdoc} |
33
|
|
|
*/ |
34
|
|
|
public function register(): void |
35
|
|
|
{ |
36
|
|
|
$this->app->configure('ytake-laravel-aop'); |
|
|
|
|
37
|
|
|
$this->app->singleton('aspect.manager', function ($app) { |
38
|
|
|
/** @var AnnotationConfiguration $annotationConfiguration */ |
39
|
|
|
$annotationConfiguration = $app->make(AnnotationConfiguration::class); |
40
|
|
|
$annotationConfiguration->ignoredAnnotations(); |
41
|
|
|
return new AspectManager($app); |
42
|
|
|
}); |
43
|
|
|
|
44
|
|
|
$this->app->singleton(AnnotationConfiguration::class, function ($app) { |
45
|
|
|
$annotationConfiguration = new AnnotationConfiguration( |
46
|
|
|
$app['config']->get('ytake-laravel-aop.annotation') |
47
|
|
|
); |
48
|
|
|
|
49
|
|
|
return $annotationConfiguration; |
50
|
|
|
}); |
51
|
|
|
} |
52
|
|
|
} |
53
|
|
|
|
This check marks calls to methods that do not seem to exist on an object.
This is most likely the result of a method being renamed without all references to it being renamed likewise.