Test Failed
Push — moodle-from-git ( b024ad )
by Luke
02:50
created

ZipMoodleSource::getId()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
c 0
b 0
f 0
dl 0
loc 3
rs 10
cc 1
eloc 2
nc 1
nop 0
1
<?php
2
3
/**
4
 * Moodle component manager.
5
 *
6
 * @author Luke Carrier <[email protected]>
7
 * @copyright 2016 Luke Carrier
8
 * @license GPL-3.0+
9
 */
10
11
namespace ComponentManager\MoodleSource;
12
13
use ComponentManager\MoodleVersion;
14
15
class ZipMoodleSource implements MoodleSource {
16
    /**
17
     * @inheritdoc MoodleSource
18
     */
19
    public function getId() {
20
        return 'Zip';
21
    }
22
23
    /**
24
     * @inheritdoc MoodleSource
25
     */
26
    public function obtainMoodle(MoodleVersion $moodleVersion,
27
                                 LoggerInterface $logger) {
28
        $uri = $moodleVersion->getDownloadUri();
29
30
        $logger->info('Downloading Moodle', [
31
            'uri'     => $uri,
32
            'archive' => $this->archive,
0 ignored issues
show
Bug introduced by
The property archive does not exist. Did you maybe forget to declare it?

In PHP it is possible to write to properties without declaring them. For example, the following is perfectly valid PHP code:

class MyClass { }

$x = new MyClass();
$x->foo = true;

Generally, it is a good practice to explictly declare properties to avoid accidental typos and provide IDE auto-completion:

class MyClass {
    public $foo;
}

$x = new MyClass();
$x->foo = true;
Loading history...
33
        ]);
34
    }
35
}
36