Completed
Push — master ( a2c36c...334094 )
by yuuki
01:58
created

RetryOnFailurePointCut::configure()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 6
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 6
rs 9.4285
c 0
b 0
f 0
cc 1
eloc 3
nc 1
nop 1
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\PointCut;
19
20
use Illuminate\Contracts\Container\Container;
21
use Ytake\LaravelAspect\Annotation\RetryOnFailure;
22
use Ytake\LaravelAspect\Interceptor\RetryOnFailureInterceptor;
23
24
/**
25
 * Class RetryOnFailurePointCut
26
 */
27
class RetryOnFailurePointCut extends CommonPointCut implements PointCutable
28
{
29
    /** @var string */
30
    protected $annotation = RetryOnFailure::class;
31
32
    /**
33
     * @param Container $app
34
     *
35
     * @return \Ray\Aop\Pointcut
36
     */
37
    public function configure(Container $app)
38
    {
39
        $this->setInterceptor(new RetryOnFailureInterceptor);
40
41
        return $this->withAnnotatedAnyInterceptor();
42
    }
43
}
44