/**
  * Initialiser.
  *
  * @param \ComponentManager\Project\Project        $project
  * @param \ComponentManager\Platform\Platform      $platform
  * @param \Symfony\Component\Filesystem\Filesystem $filesystem
  * @param \ComponentManager\Moodle                 $moodle
  */
 public function __construct(Project $project, Platform $platform, Filesystem $filesystem, Moodle $moodle)
 {
     parent::__construct();
     $this->addStep(new VerifyPackageRepositoriesCachedStep($project->getPackageRepositories()));
     $this->addStep(new ResolveComponentVersionsStep($project));
     $this->addStep(new InstallComponentsStep($project, $moodle, $platform, $filesystem));
     $this->addStep(new BuildComponentsStep($moodle, $platform, $filesystem));
     $this->addStep(new CommitProjectLockFileStep($project->getProjectLockFile()));
     $this->addStep(new RemoveTempDirectoriesStep($platform));
 }
 /**
  * Initialiser.
  *
  * @param \ComponentManager\MoodleApi              $moodleApi
  * @param \ComponentManager\Project\Project        $project
  * @param string                                   $moodleArchive
  * @param string                                   $moodleDestination
  * @param \Symfony\Component\Filesystem\Filesystem $filesystem
  * @param \ComponentManager\Moodle                 $moodle
  * @param string                                   $packageFormat
  * @param string                                   $packageDestination
  */
 public function __construct(MoodleApi $moodleApi, Project $project, $moodleArchive, $moodleDestination, Platform $platform, Filesystem $filesystem, Moodle $moodle, $packageFormat, $packageDestination)
 {
     /* Because we're reordering the installation steps, we don't want to
      * call InstallTask's constructor. */
     AbstractTask::__construct();
     $this->resolvedComponentVersions = [];
     $this->addStep(new VerifyPackageRepositoriesCachedStep($project->getPackageRepositories()));
     $this->addStep(new ResolveMoodleVersionStep($moodleApi, $project->getProjectFile()->getMoodleVersion()));
     $this->addStep(new ResolveComponentVersionsStep($project));
     $this->addStep(new ObtainMoodleSourceStep($moodleArchive, dirname($moodleDestination)));
     $this->addStep(new InstallComponentsStep($project, $moodle, $platform, $filesystem));
     $this->addStep(new BuildComponentsStep($moodle, $platform, $filesystem));
     $this->addStep(new CommitProjectLockFileStep($project->getProjectLockFile()));
     $this->addStep(new PackageStep($project, $moodleDestination, $packageFormat, $packageDestination));
     $this->addStep(new RemoveTempDirectoriesStep($platform));
 }