GitHub Access Token became invalid

It seems like the GitHub access token used for retrieving details about this repository from GitHub became invalid. This might prevent certain types of inspections from being run (in particular, everything related to pull requests).
Please ask an admin of your repository to re-new the access token on this website.

Metrics::current()   A
last analyzed

Complexity

Conditions 2
Paths 2

Size

Total Lines 7
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 2
eloc 3
c 1
b 0
f 0
nc 2
nop 0
dl 0
loc 7
rs 10
1
<?php
2
/**
3
 * This file is part of the O2System Framework package.
4
 *
5
 * For the full copyright and license information, please view the LICENSE
6
 * file that was distributed with this source code.
7
 *
8
 * @author         Steeve Andrian Salim
9
 * @copyright      Copyright (c) Steeve Andrian Salim
10
 */
11
12
// ------------------------------------------------------------------------
13
14
namespace O2System\Gear\Profiler;
15
16
// ------------------------------------------------------------------------
17
18
use O2System\Gear\Profiler\DataStructures\Metric;
19
20
/**
21
 * Class Metrics
22
 *
23
 * @package O2System\Gear\Profiler\Collections
24
 */
25
class Metrics extends \SplQueue
26
{
27
    /**
28
     * Metrics::$logged
29
     *
30
     * @var array
31
     */
32
    protected static $logged = [];
33
34
    // ------------------------------------------------------------------------
35
36
    /**
37
     * Metrics::push
38
     *
39
     * @param Metric $metric
40
     */
41
    public function push($metric)
42
    {
43
        $metric->stop();
44
45
        if ( ! $this->isEmpty()) {
46
            $metric->start($this->top()->endTime, $this->top()->endMemory);
47
        } elseif (defined('STARTUP_MEMORY')) {
48
            $metric->start(STARTUP_TIME, STARTUP_MEMORY);
0 ignored issues
show
Bug introduced by
The constant O2System\Gear\Profiler\STARTUP_MEMORY was not found. Maybe you did not declare it correctly or list all dependencies?
Loading history...
Bug introduced by
The constant O2System\Gear\Profiler\STARTUP_TIME was not found. Maybe you did not declare it correctly or list all dependencies?
Loading history...
49
        }
50
51
        parent::push($metric);
52
    }
53
54
    // ------------------------------------------------------------------------
55
56
    /**
57
     * Metrics::current
58
     *
59
     * Return the current Benchmark
60
     *
61
     * @return Metric
62
     */
63
    public function current()
64
    {
65
        if (null === ($current = parent::current())) {
0 ignored issues
show
Unused Code introduced by
The assignment to $current is dead and can be removed.
Loading history...
66
            $this->rewind();
67
        }
68
69
        return parent::current();
70
    }
71
}