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\Task; |
12
|
|
|
|
13
|
|
|
use ComponentManager\Moodle; |
14
|
|
|
use ComponentManager\Platform\Platform; |
15
|
|
|
use ComponentManager\Project\Project; |
16
|
|
|
use ComponentManager\ResolvedComponentVersion; |
17
|
|
|
use ComponentManager\Step\BuildComponentsStep; |
18
|
|
|
use ComponentManager\Step\CommitProjectLockFileStep; |
19
|
|
|
use ComponentManager\Step\InstallComponentsStep; |
20
|
|
|
use ComponentManager\Step\RemoveTempDirectoriesStep; |
21
|
|
|
use ComponentManager\Step\ResolveComponentVersionsStep; |
22
|
|
|
use ComponentManager\Step\ValidateProjectStep; |
23
|
|
|
use ComponentManager\Step\VerifyPackageRepositoriesCachedStep; |
24
|
|
|
use Symfony\Component\Filesystem\Filesystem; |
25
|
|
|
|
26
|
|
|
class InstallTask extends AbstractTask implements Task { |
27
|
|
|
/** |
28
|
|
|
* Resolved component versions. |
29
|
|
|
* |
30
|
|
|
* @var ResolvedComponentVersion[] |
31
|
|
|
*/ |
32
|
|
|
protected $resolvedComponentVersions; |
33
|
|
|
|
34
|
|
|
/** |
35
|
|
|
* Initialiser. |
36
|
|
|
* |
37
|
|
|
* @param Project $project |
38
|
|
|
* @param Platform $platform |
39
|
|
|
* @param Filesystem $filesystem |
40
|
|
|
* @param Moodle $moodle |
41
|
|
|
* @param integer|null $timeouts |
|
|
|
|
42
|
|
|
* @param integer $attempts |
43
|
|
|
*/ |
44
|
|
|
public function __construct(Project $project, Platform $platform, |
45
|
|
|
Filesystem $filesystem, Moodle $moodle, |
46
|
|
|
$timeout, $attempts) { |
47
|
|
|
parent::__construct(); |
48
|
|
|
|
49
|
|
|
$this->addStep(new ValidateProjectStep($project)); |
50
|
|
|
$this->addStep(new VerifyPackageRepositoriesCachedStep( |
51
|
|
|
$project->getPackageRepositories())); |
52
|
|
|
$this->addStep(new ResolveComponentVersionsStep($project)); |
53
|
|
|
$this->addStep(new InstallComponentsStep( |
54
|
|
|
$project, $moodle, $platform, $filesystem, $timeout, |
55
|
|
|
$attempts)); |
56
|
|
|
$this->addStep(new BuildComponentsStep( |
57
|
|
|
$moodle, $platform, $filesystem)); |
58
|
|
|
$this->addStep(new CommitProjectLockFileStep( |
59
|
|
|
$project->getProjectLockFile())); |
60
|
|
|
$this->addStep(new RemoveTempDirectoriesStep($platform)); |
61
|
|
|
} |
62
|
|
|
|
63
|
|
|
/** |
64
|
|
|
* Add a resolved component version. |
65
|
|
|
* |
66
|
|
|
* @param ResolvedComponentVersion $resolvedComponentVersion |
67
|
|
|
*/ |
68
|
|
|
public function addResolvedComponentVersion(ResolvedComponentVersion $resolvedComponentVersion) { |
69
|
|
|
$this->resolvedComponentVersions[] = $resolvedComponentVersion; |
70
|
|
|
} |
71
|
|
|
|
72
|
|
|
/** |
73
|
|
|
* Get resolved component versions. |
74
|
|
|
* |
75
|
|
|
* @return ResolvedComponentVersion[] |
76
|
|
|
*/ |
77
|
|
|
public function getResolvedComponentVersions() { |
78
|
|
|
return $this->resolvedComponentVersions; |
79
|
|
|
} |
80
|
|
|
} |
81
|
|
|
|
This check looks for PHPDoc comments describing methods or function parameters that do not exist on the corresponding method or function. It has, however, found a similar but not annotated parameter which might be a good fit.
Consider the following example. The parameter
$ireland
is not defined by the methodfinale(...)
.The most likely cause is that the parameter was changed, but the annotation was not.