Completed
Push — 1.x ( a98302...e42f79 )
by Alexander
07:32
created

ErrorDemo   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 23
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 0
Metric Value
wmc 2
lcom 0
cbo 0
dl 0
loc 23
rs 10
1
<?php
2
/*
3
 * Go! AOP framework
4
 *
5
 * @copyright Copyright 2014, Lisachenko Alexander <[email protected]>
6
 *
7
 * This source file is subject to the license that is bundled
8
 * with this source code in the file LICENSE.
9
 */
10
11
namespace Demo\Example;
12
13
use Demo\Annotation\Deprecated as deprecated; // <== We import specific system annotation
14
15
/**
16
 * In this class we use system functions that will be intercepted by aspect
17
 */
18
class ErrorDemo
19
{
20
21
    /**
22
     * Some old method that is used by system in production, but shouldn't be used for the new code
23
     *
24
     * @deprecated
25
     */
26
    public function oldMethod()
27
    {
28
        echo "Hello, I'm old method", PHP_EOL;
29
    }
30
31
    /**
32
     * Method that is very tricky and should generate a notice
33
     */
34
    public function notSoGoodMethod()
35
    {
36
        $value = round(microtime(true)) % 3; // Sometimes this equal to 0
37
38
        return rand(1, 10) / $value;
39
    }
40
}
41