@@ -100,7 +100,7 @@ |
||
| 100 | 100 | * |
| 101 | 101 | * @return void |
| 102 | 102 | */ |
| 103 | - public function fetch($remote, $withTags=true) { |
|
| 103 | + public function fetch($remote, $withTags = true) { |
|
| 104 | 104 | $process = $this->getProcess(['fetch', $remote]); |
| 105 | 105 | $process->run(); |
| 106 | 106 | |
@@ -32,8 +32,8 @@ |
||
| 32 | 32 | */ |
| 33 | 33 | public function __toString() { |
| 34 | 34 | return sprintf(static::MESSAGE_FORMAT, $this->getExceptionType(), |
| 35 | - $this->getExceptionCodeName(), $this->code, |
|
| 36 | - $this->message); |
|
| 35 | + $this->getExceptionCodeName(), $this->code, |
|
| 36 | + $this->message); |
|
| 37 | 37 | } |
| 38 | 38 | |
| 39 | 39 | /** |
@@ -271,7 +271,7 @@ discard block |
||
| 271 | 271 | */ |
| 272 | 272 | protected function getMetadataCacheFilename() { |
| 273 | 273 | $urlHash = parse_url($this->options->uri, PHP_URL_HOST) . '-' |
| 274 | - . $this->options->project; |
|
| 274 | + . $this->options->project; |
|
| 275 | 275 | |
| 276 | 276 | return $this->platform->joinPaths([ |
| 277 | 277 | parent::getMetadataCacheDirectory(), |
@@ -370,7 +370,7 @@ discard block |
||
| 370 | 370 | */ |
| 371 | 371 | protected function getProjectRepositoryListUrl() { |
| 372 | 372 | return sprintf(static::PROJECT_REPOSITORY_LIST_PATH, |
| 373 | - $this->options->project); |
|
| 373 | + $this->options->project); |
|
| 374 | 374 | } |
| 375 | 375 | |
| 376 | 376 | /** |
@@ -382,7 +382,7 @@ discard block |
||
| 382 | 382 | */ |
| 383 | 383 | protected function getRepositoryBranchesPath($componentName) { |
| 384 | 384 | return sprintf(static::REPOSITORY_BRANCHES_PATH, $this->options->project, |
| 385 | - $componentName); |
|
| 385 | + $componentName); |
|
| 386 | 386 | } |
| 387 | 387 | |
| 388 | 388 | /** |
@@ -394,6 +394,6 @@ discard block |
||
| 394 | 394 | */ |
| 395 | 395 | protected function getRepositoryTagsPath($componentName) { |
| 396 | 396 | return sprintf(static::REPOSITORY_TAGS_PATH, $this->options->project, |
| 397 | - $componentName); |
|
| 397 | + $componentName); |
|
| 398 | 398 | } |
| 399 | 399 | } |
@@ -18,8 +18,8 @@ |
||
| 18 | 18 | use DateTime; |
| 19 | 19 | use OutOfBoundsException; |
| 20 | 20 | use Psr\Log\LoggerInterface; |
| 21 | -use stdClass; |
|
| 22 | 21 | use Symfony\Component\HttpFoundation\Request; |
| 22 | +use stdClass; |
|
| 23 | 23 | |
| 24 | 24 | /** |
| 25 | 25 | * Atlassian Stash project package repository. |
@@ -320,7 +320,7 @@ discard block |
||
| 320 | 320 | * |
| 321 | 321 | * @return mixed The JSON-decoded representation of the response body. |
| 322 | 322 | */ |
| 323 | - protected function get($path, array $queryParams=[]) { |
|
| 323 | + protected function get($path, array $queryParams = []) { |
|
| 324 | 324 | $uri = $this->options->uri . $path; |
| 325 | 325 | $uri = $this->httpClient->createUri($uri) |
| 326 | 326 | ->withQuery(http_build_query($queryParams)); |
@@ -339,7 +339,7 @@ discard block |
||
| 339 | 339 | * |
| 340 | 340 | * @return mixed The value attribute of the JSON-decoded response body. |
| 341 | 341 | */ |
| 342 | - protected function getAllPages($path, array $queryParams=[]) { |
|
| 342 | + protected function getAllPages($path, array $queryParams = []) { |
|
| 343 | 343 | $values = []; |
| 344 | 344 | |
| 345 | 345 | $responseBody = (object) [ |
@@ -325,7 +325,7 @@ |
||
| 325 | 325 | $uri = $this->httpClient->createUri($uri) |
| 326 | 326 | ->withQuery(http_build_query($queryParams)); |
| 327 | 327 | $message = $this->httpClient->createRequest(Request::METHOD_GET, $uri) |
| 328 | - ->withHeader('Authorization', "Basic {$this->options->authentication}"); |
|
| 328 | + ->withHeader('Authorization', "basic {$this->options->authentication}"); |
|
| 329 | 329 | $response = $this->httpClient->sendRequest($message); |
| 330 | 330 | |
| 331 | 331 | return json_decode($response->getBody()); |
@@ -94,7 +94,7 @@ |
||
| 94 | 94 | } |
| 95 | 95 | |
| 96 | 96 | return new Component($componentSpecification->getName(), $versions, |
| 97 | - $this); |
|
| 97 | + $this); |
|
| 98 | 98 | } |
| 99 | 99 | |
| 100 | 100 | /** |
@@ -103,12 +103,12 @@ |
||
| 103 | 103 | |
| 104 | 104 | $tempDirectory = $this->platform->createTempDirectory(); |
| 105 | 105 | $archive = $tempDirectory |
| 106 | - . $this->platform->getDirectorySeparator() |
|
| 107 | - . 'moodle.zip'; |
|
| 106 | + . $this->platform->getDirectorySeparator() |
|
| 107 | + . 'moodle.zip'; |
|
| 108 | 108 | $destination = $tempDirectory |
| 109 | - . $this->platform->getDirectorySeparator() . 'moodle'; |
|
| 109 | + . $this->platform->getDirectorySeparator() . 'moodle'; |
|
| 110 | 110 | $projectLockFilename = $destination . $this->platform->getDirectorySeparator() |
| 111 | - . 'componentmgr.lock.json'; |
|
| 111 | + . 'componentmgr.lock.json'; |
|
| 112 | 112 | |
| 113 | 113 | $moodle = new Moodle($destination, $this->platform); |
| 114 | 114 | $project = $this->getProject($projectFilename, $projectLockFilename); |
@@ -39,7 +39,7 @@ |
||
| 39 | 39 | */ |
| 40 | 40 | const HELP = <<<HELP |
| 41 | 41 | Packages a Moodle site from a project file. |
| 42 | -HELP; |
|
| 42 | +help; |
|
| 43 | 43 | |
| 44 | 44 | /** |
| 45 | 45 | * Moodle.org plugin and update API. |
@@ -79,9 +79,9 @@ discard block |
||
| 79 | 79 | * @return string |
| 80 | 80 | */ |
| 81 | 81 | protected function getArchiveFilename(Component $component, |
| 82 | - ComponentVersion $version) { |
|
| 82 | + ComponentVersion $version) { |
|
| 83 | 83 | return sprintf(static::ARCHIVE_FILENAME_FORMAT, $component->getName(), |
| 84 | - $version->getVersion()); |
|
| 84 | + $version->getVersion()); |
|
| 85 | 85 | } |
| 86 | 86 | |
| 87 | 87 | /** |
@@ -93,18 +93,18 @@ discard block |
||
| 93 | 93 | * @return string |
| 94 | 94 | */ |
| 95 | 95 | protected function getTargetDirectory(Component $component, |
| 96 | - ComponentVersion $version) { |
|
| 96 | + ComponentVersion $version) { |
|
| 97 | 97 | return sprintf(static::TARGET_DIRECTORY_FORMAT, $component->getName(), |
| 98 | - $version->getVersion()); |
|
| 98 | + $version->getVersion()); |
|
| 99 | 99 | } |
| 100 | 100 | |
| 101 | 101 | /** |
| 102 | 102 | * @override \ComponentManager\PackageSource\PackageSource |
| 103 | 103 | */ |
| 104 | 104 | public function obtainPackage($tempDirectory, |
| 105 | - ResolvedComponentVersion $resolvedComponentVersion, |
|
| 106 | - Filesystem $filesystem, |
|
| 107 | - LoggerInterface $logger) { |
|
| 105 | + ResolvedComponentVersion $resolvedComponentVersion, |
|
| 106 | + Filesystem $filesystem, |
|
| 107 | + LoggerInterface $logger) { |
|
| 108 | 108 | $component = $resolvedComponentVersion->getComponent(); |
| 109 | 109 | $version = $resolvedComponentVersion->getVersion(); |
| 110 | 110 | $sources = $version->getSources(); |
@@ -170,8 +170,8 @@ discard block |
||
| 170 | 170 | * @throws InstallationFailureException |
| 171 | 171 | */ |
| 172 | 172 | protected function trySource($tempDirectory, LoggerInterface $logger, |
| 173 | - Component $component, ComponentVersion $version, |
|
| 174 | - ZipComponentSource $source) { |
|
| 173 | + Component $component, ComponentVersion $version, |
|
| 174 | + ZipComponentSource $source) { |
|
| 175 | 175 | $archiveFilename = $this->platform->joinPaths([ |
| 176 | 176 | $tempDirectory, |
| 177 | 177 | $this->getArchiveFilename($component, $version), |
@@ -53,7 +53,7 @@ |
||
| 53 | 53 | * @param string|null $tagName |
| 54 | 54 | * @param string|null $appId |
| 55 | 55 | */ |
| 56 | - public function __construct($tagName=null, $appId=null) { |
|
| 56 | + public function __construct($tagName = null, $appId = null) { |
|
| 57 | 57 | $this->tagName = ($tagName === null) ? 'console.command' : $tagName; |
| 58 | 58 | $this->appId = ($appId === null) ? 'console.application' : $appId; |
| 59 | 59 | } |
@@ -27,7 +27,7 @@ |
||
| 27 | 27 | * |
| 28 | 28 | * @return void |
| 29 | 29 | */ |
| 30 | - public function setContainer(ContainerInterface $container=null) { |
|
| 30 | + public function setContainer(ContainerInterface $container = null) { |
|
| 31 | 31 | $this->container = $container; |
| 32 | 32 | } |
| 33 | 33 | } |
@@ -23,6 +23,7 @@ |
||
| 23 | 23 | * Initialiser. |
| 24 | 24 | * |
| 25 | 25 | * @param \Symfony\Component\Filesystem\Filesystem $filesystem |
| 26 | + * @return void |
|
| 26 | 27 | */ |
| 27 | 28 | public function __construct(Filesystem $filesystem); |
| 28 | 29 | |