@@ -118,7 +118,7 @@ |
||
| 118 | 118 | * |
| 119 | 119 | * @param string $property |
| 120 | 120 | * |
| 121 | - * @return mixed |
|
| 121 | + * @return string |
|
| 122 | 122 | * |
| 123 | 123 | * @throws \OutOfBoundsException |
| 124 | 124 | */ |
@@ -71,7 +71,7 @@ |
||
| 71 | 71 | * @param \ComponentManager\Project\ProjectLockFile $projectLockFile |
| 72 | 72 | * @param \ComponentManager\PackageRepository\PackageRepositoryFactory $packageRepositoryFactory |
| 73 | 73 | * @param \ComponentManager\PackageSource\PackageSourceFactory $packageSourceFactory |
| 74 | - * @param \ComponentManager\PackageSource\PackageFormatFactory $packageFormatFactory |
|
| 74 | + * @param PackageFormatFactory $packageFormatFactory |
|
| 75 | 75 | */ |
| 76 | 76 | public function __construct(ProjectFile $projectFile, |
| 77 | 77 | ProjectLockFile $projectLockFile, |
@@ -38,8 +38,6 @@ |
||
| 38 | 38 | /** |
| 39 | 39 | * Initialiser. |
| 40 | 40 | * |
| 41 | - * @param \ComponentManager\MoodleVersion $version |
|
| 42 | - * @param \Psr\Log\LoggerInterface $logger |
|
| 43 | 41 | * @param string $archive |
| 44 | 42 | * @param string $destination |
| 45 | 43 | */ |
@@ -56,7 +56,7 @@ |
||
| 56 | 56 | * @return string The path to the module's root directory. |
| 57 | 57 | */ |
| 58 | 58 | public function obtainPackage($tempDirectory, |
| 59 | - ResolvedComponentVersion $resolvedComponentVersion, |
|
| 60 | - Filesystem $filesystem, |
|
| 61 | - LoggerInterface $logger); |
|
| 59 | + ResolvedComponentVersion $resolvedComponentVersion, |
|
| 60 | + Filesystem $filesystem, |
|
| 61 | + LoggerInterface $logger); |
|
| 62 | 62 | } |
@@ -80,9 +80,9 @@ discard block |
||
| 80 | 80 | * @return string |
| 81 | 81 | */ |
| 82 | 82 | protected function getArchiveFilename(Component $component, |
| 83 | - ComponentVersion $version) { |
|
| 83 | + ComponentVersion $version) { |
|
| 84 | 84 | return sprintf(static::ARCHIVE_FILENAME_FORMAT, $component->getName(), |
| 85 | - $version->getVersion()); |
|
| 85 | + $version->getVersion()); |
|
| 86 | 86 | } |
| 87 | 87 | |
| 88 | 88 | /** |
@@ -94,18 +94,18 @@ discard block |
||
| 94 | 94 | * @return string |
| 95 | 95 | */ |
| 96 | 96 | protected function getTargetDirectory(Component $component, |
| 97 | - ComponentVersion $version) { |
|
| 97 | + ComponentVersion $version) { |
|
| 98 | 98 | return sprintf(static::TARGET_DIRECTORY_FORMAT, $component->getName(), |
| 99 | - $version->getVersion()); |
|
| 99 | + $version->getVersion()); |
|
| 100 | 100 | } |
| 101 | 101 | |
| 102 | 102 | /** |
| 103 | 103 | * @override \ComponentManager\PackageSource\PackageSource |
| 104 | 104 | */ |
| 105 | 105 | public function obtainPackage($tempDirectory, |
| 106 | - ResolvedComponentVersion $resolvedComponentVersion, |
|
| 107 | - Filesystem $filesystem, |
|
| 108 | - LoggerInterface $logger) { |
|
| 106 | + ResolvedComponentVersion $resolvedComponentVersion, |
|
| 107 | + Filesystem $filesystem, |
|
| 108 | + LoggerInterface $logger) { |
|
| 109 | 109 | $component = $resolvedComponentVersion->getComponent(); |
| 110 | 110 | $version = $resolvedComponentVersion->getVersion(); |
| 111 | 111 | $sources = $version->getSources(); |
@@ -171,14 +171,14 @@ discard block |
||
| 171 | 171 | * @throws InstallationFailureException |
| 172 | 172 | */ |
| 173 | 173 | protected function trySource($tempDirectory, LoggerInterface $logger, |
| 174 | - Component $component, ComponentVersion $version, |
|
| 175 | - ZipComponentSource $source) { |
|
| 174 | + Component $component, ComponentVersion $version, |
|
| 175 | + ZipComponentSource $source) { |
|
| 176 | 176 | $archiveFilename = $tempDirectory |
| 177 | - . PlatformUtil::directorySeparator() |
|
| 178 | - . $this->getArchiveFilename($component, $version); |
|
| 177 | + . PlatformUtil::directorySeparator() |
|
| 178 | + . $this->getArchiveFilename($component, $version); |
|
| 179 | 179 | $targetDirectory = $tempDirectory |
| 180 | - . PlatformUtil::directorySeparator() |
|
| 181 | - . $this->getTargetDirectory($component, $version); |
|
| 180 | + . PlatformUtil::directorySeparator() |
|
| 181 | + . $this->getTargetDirectory($component, $version); |
|
| 182 | 182 | |
| 183 | 183 | $logger->debug('Trying zip source', [ |
| 184 | 184 | 'archiveFilename' => $archiveFilename, |
@@ -212,8 +212,8 @@ discard block |
||
| 212 | 212 | } |
| 213 | 213 | |
| 214 | 214 | $moduleRootDirectory = $targetDirectory |
| 215 | - . PlatformUtil::directorySeparator() |
|
| 216 | - . $component->getPluginName(); |
|
| 215 | + . PlatformUtil::directorySeparator() |
|
| 216 | + . $component->getPluginName(); |
|
| 217 | 217 | if (!is_dir($moduleRootDirectory)) { |
| 218 | 218 | throw new InstallationFailureException( |
| 219 | 219 | "Module directory {$moduleRootDirectory} did not exist", |
@@ -39,9 +39,9 @@ |
||
| 39 | 39 | * @override \ComponentManager\PackageSource\PackageSource |
| 40 | 40 | */ |
| 41 | 41 | public function obtainPackage($tempDirectory, |
| 42 | - ResolvedComponentVersion $resolvedComponentVersion, |
|
| 43 | - Filesystem $filesystem, |
|
| 44 | - LoggerInterface $logger) { |
|
| 42 | + ResolvedComponentVersion $resolvedComponentVersion, |
|
| 43 | + Filesystem $filesystem, |
|
| 44 | + LoggerInterface $logger) { |
|
| 45 | 45 | $version = $resolvedComponentVersion->getVersion(); |
| 46 | 46 | $sources = $version->getSources(); |
| 47 | 47 | |
@@ -77,7 +77,7 @@ |
||
| 77 | 77 | } |
| 78 | 78 | |
| 79 | 79 | $path = $this->rootDirectory . PlatformUtil::directorySeparator() |
| 80 | - . static::CONFIG_FILENAME; |
|
| 80 | + . static::CONFIG_FILENAME; |
|
| 81 | 81 | if (is_file($path)) { |
| 82 | 82 | require_once $path; |
| 83 | 83 | |
@@ -45,8 +45,8 @@ |
||
| 45 | 45 | ->setHelp(static::HELP) |
| 46 | 46 | ->setDefinition(new InputDefinition([ |
| 47 | 47 | new InputArgument(Argument::ARGUMENT_ACTION, |
| 48 | - InputArgument::REQUIRED, |
|
| 49 | - Argument::ARGUMENT_ACTION_HELP), |
|
| 48 | + InputArgument::REQUIRED, |
|
| 49 | + Argument::ARGUMENT_ACTION_HELP), |
|
| 50 | 50 | new InputOption(Argument::ARGUMENT_MOODLE_DIR, null, |
| 51 | 51 | InputOption::VALUE_REQUIRED, |
| 52 | 52 | Argument::ARGUMENT_MOODLE_DIR_HELP), |
@@ -62,12 +62,12 @@ |
||
| 62 | 62 | |
| 63 | 63 | $tempDirectory = PlatformUtil::createTempDirectory(); |
| 64 | 64 | $archive = $tempDirectory |
| 65 | - . PlatformUtil::directorySeparator() |
|
| 66 | - . 'moodle.zip'; |
|
| 65 | + . PlatformUtil::directorySeparator() |
|
| 66 | + . 'moodle.zip'; |
|
| 67 | 67 | $destination = $tempDirectory |
| 68 | - . PlatformUtil::directorySeparator() . 'moodle'; |
|
| 68 | + . PlatformUtil::directorySeparator() . 'moodle'; |
|
| 69 | 69 | $projectLockFilename = $destination . PlatformUtil::directorySeparator() |
| 70 | - . 'componentmgr.lock.json'; |
|
| 70 | + . 'componentmgr.lock.json'; |
|
| 71 | 71 | |
| 72 | 72 | /** @var \Symfony\Component\Filesystem\Filesystem $filesystem */ |
| 73 | 73 | $filesystem = $this->container->get('filesystem'); |