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.

MTime::read()   A
last analyzed

Complexity

Conditions 3
Paths 3

Size

Total Lines 16
Code Lines 9

Duplication

Lines 10
Ratio 62.5 %

Importance

Changes 0
Metric Value
dl 10
loc 16
rs 9.4285
c 0
b 0
f 0
cc 3
eloc 9
nc 3
nop 1
1
<?php
2
/**
3
 * MTime.php
4
 *
5
 * @package         ProjectVersioner
6
 * @subpackage      Reader
7
 */
8
9
namespace Naneau\ProjectVersioner\Reader\Finder;
10
11
/**
12
 * MTime
13
 *
14
 * Uses the highest mtime from a finder as a version
15
 *
16
 * @category        Naneau
17
 * @package         ProjectVersioner
18
 * @subpackage      Reader
19
 */
20
class MTime extends Finder
21
{
22
    /**
23
     * {@inheritdoc}
24
     **/
25
    public function read($directory)
26
    {
27
        $highest = 0;
28 View Code Duplication
        foreach ($this->getFinder() as $file) {
0 ignored issues
show
Duplication introduced by
This code seems to be duplicated across your project.

Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.

You can also find more detailed suggestions in the “Code” section of your repository.

Loading history...
29
30
            $mtime = filemtime(
31
                $file->getPath()
32
                . DIRECTORY_SEPARATOR . $file->getFilename()
33
            );
34
            if ($mtime > $highest) {
35
                $highest = $mtime;
36
            }
37
        }
38
39
        return $highest;
40
    }
41
}
42