Skip to content
Snippets Groups Projects
Commit 3bd9c292 authored by Ted Bowman's avatar Ted Bowman
Browse files

Issue #3228392 by tedbow: Fix various nits

parent 70ef2270
No related branches found
No related tags found
No related merge requests found
...@@ -4,32 +4,32 @@ services: ...@@ -4,32 +4,32 @@ services:
arguments: ['@keyvalue.expirable', '@datetime.time', 24] arguments: ['@keyvalue.expirable', '@datetime.time', 24]
automatic_updates.updater: automatic_updates.updater:
class: Drupal\automatic_updates\Updater class: Drupal\automatic_updates\Updater
arguments: [ '@state', '@string_translation','@automatic_updates.beginner', '@automatic_updates.stager', '@automatic_updates.cleaner', '@automatic_updates.committer' , '@file_system', '@event_dispatcher'] arguments: ['@state', '@string_translation','@automatic_updates.beginner', '@automatic_updates.stager', '@automatic_updates.cleaner', '@automatic_updates.committer' , '@file_system', '@event_dispatcher']
automatic_updates.staged_package_validator: automatic_updates.staged_package_validator:
class: Drupal\automatic_updates\Validation\StagedProjectsValidation class: Drupal\automatic_updates\Validation\StagedProjectsValidation
arguments: [ '@string_translation', '@automatic_updates.updater' ] arguments: ['@string_translation', '@automatic_updates.updater' ]
tags: tags:
- { name: event_subscriber } - { name: event_subscriber }
automatic_updates.beginner: automatic_updates.beginner:
class: Drupal\automatic_updates\ComposerStager\Beginner class: Drupal\automatic_updates\ComposerStager\Beginner
arguments: arguments:
[ '@automatic_updates.file_copier', '@automatic_updates.file_system' ] ['@automatic_updates.file_copier', '@automatic_updates.file_system' ]
automatic_updates.stager: automatic_updates.stager:
class: PhpTuf\ComposerStager\Domain\Stager class: PhpTuf\ComposerStager\Domain\Stager
arguments: arguments:
[ '@automatic_updates.composer_runner', '@automatic_updates.file_system' ] ['@automatic_updates.composer_runner', '@automatic_updates.file_system' ]
automatic_updates.cleaner: automatic_updates.cleaner:
class: PhpTuf\ComposerStager\Domain\Cleaner class: PhpTuf\ComposerStager\Domain\Cleaner
arguments: arguments:
[ '@automatic_updates.file_system' ] ['@automatic_updates.file_system' ]
automatic_updates.committer: automatic_updates.committer:
class: PhpTuf\ComposerStager\Domain\Committer class: PhpTuf\ComposerStager\Domain\Committer
arguments: arguments:
[ '@automatic_updates.file_copier', '@automatic_updates.file_system' ] ['@automatic_updates.file_copier', '@automatic_updates.file_system' ]
automatic_updates.composer_runner: automatic_updates.composer_runner:
class: PhpTuf\ComposerStager\Infrastructure\Process\Runner\ComposerRunner class: PhpTuf\ComposerStager\Infrastructure\Process\Runner\ComposerRunner
arguments: arguments:
[ '@automatic_updates.exec_finder', '@automatic_updates.process_factory' ] ['@automatic_updates.exec_finder', '@automatic_updates.process_factory' ]
automatic_updates.file_copier.factory: automatic_updates.file_copier.factory:
class: PhpTuf\ComposerStager\Infrastructure\Process\FileCopier\FileCopierFactory class: PhpTuf\ComposerStager\Infrastructure\Process\FileCopier\FileCopierFactory
arguments: arguments:
...@@ -55,7 +55,7 @@ services: ...@@ -55,7 +55,7 @@ services:
automatic_updates.file_system: automatic_updates.file_system:
class: PhpTuf\ComposerStager\Infrastructure\Filesystem\Filesystem class: PhpTuf\ComposerStager\Infrastructure\Filesystem\Filesystem
arguments: arguments:
[ '@automatic_updates.symfony_file_system' ] ['@automatic_updates.symfony_file_system' ]
automatic_updates.symfony_file_system: automatic_updates.symfony_file_system:
class: Symfony\Component\Filesystem\Filesystem class: Symfony\Component\Filesystem\Filesystem
automatic_updates.symfony_exec_finder: automatic_updates.symfony_exec_finder:
...@@ -63,10 +63,10 @@ services: ...@@ -63,10 +63,10 @@ services:
automatic_updates.rsync: automatic_updates.rsync:
class: PhpTuf\ComposerStager\Infrastructure\Process\Runner\RsyncRunner class: PhpTuf\ComposerStager\Infrastructure\Process\Runner\RsyncRunner
arguments: arguments:
[ '@automatic_updates.exec_finder', '@automatic_updates.process_factory' ] ['@automatic_updates.exec_finder', '@automatic_updates.process_factory' ]
automatic_updates.exec_finder: automatic_updates.exec_finder:
class: PhpTuf\ComposerStager\Infrastructure\Process\ExecutableFinder class: PhpTuf\ComposerStager\Infrastructure\Process\ExecutableFinder
arguments: arguments:
[ '@automatic_updates.symfony_exec_finder' ] ['@automatic_updates.symfony_exec_finder' ]
automatic_updates.process_factory: automatic_updates.process_factory:
class: Drupal\automatic_updates\ComposerStager\ProcessFactory class: Drupal\automatic_updates\ComposerStager\ProcessFactory
...@@ -12,7 +12,7 @@ use Symfony\Component\HttpFoundation\RedirectResponse; ...@@ -12,7 +12,7 @@ use Symfony\Component\HttpFoundation\RedirectResponse;
class BatchProcessor { class BatchProcessor {
/** /**
* Get the updater service. * Gets the updater service.
* *
* @return \Drupal\automatic_updates\Updater * @return \Drupal\automatic_updates\Updater
* The updater service. * The updater service.
......
...@@ -102,7 +102,7 @@ class UpdateReady extends UpdateFormBase { ...@@ -102,7 +102,7 @@ class UpdateReady extends UpdateFormBase {
$session = $this->getRequest()->getSession(); $session = $this->getRequest()->getSession();
// Store maintenance_mode setting so we can restore it when done. // Store maintenance_mode setting so we can restore it when done.
$session->set('maintenance_mode', $this->state->get('system.maintenance_mode')); $session->set('maintenance_mode', $this->state->get('system.maintenance_mode'));
if ($form_state->getValue('maintenance_mode') == TRUE) { if ($form_state->getValue('maintenance_mode') === TRUE) {
$this->state->set('system.maintenance_mode', TRUE); $this->state->set('system.maintenance_mode', TRUE);
// @todo unset after updater. After db update? // @todo unset after updater. After db update?
} }
......
...@@ -99,7 +99,7 @@ class UpdaterForm extends UpdateFormBase { ...@@ -99,7 +99,7 @@ class UpdaterForm extends UpdateFormBase {
$project = $project_data['drupal']; $project = $project_data['drupal'];
// If we're already up-to-date, there's nothing else we need to do. // If we're already up-to-date, there's nothing else we need to do.
if ($project['status'] == UpdateManagerInterface::CURRENT) { if ($project['status'] === UpdateManagerInterface::CURRENT) {
$this->messenger()->addMessage('No update available'); $this->messenger()->addMessage('No update available');
return $form; return $form;
} }
...@@ -190,7 +190,7 @@ class UpdaterForm extends UpdateFormBase { ...@@ -190,7 +190,7 @@ class UpdaterForm extends UpdateFormBase {
/** /**
* Builds the form actions. * Builds the form actions.
* *
* @return array * @return mixed[][]
* The form's actions elements. * The form's actions elements.
*/ */
protected function actions(): array { protected function actions(): array {
......
...@@ -80,7 +80,7 @@ class Updater { ...@@ -80,7 +80,7 @@ class Updater {
protected $eventDispatcher; protected $eventDispatcher;
/** /**
* Updater constructor. * Constructs an Updater object.
* *
* @param \Drupal\Core\State\StateInterface $state * @param \Drupal\Core\State\StateInterface $state
* The state service. * The state service.
......
...@@ -16,7 +16,7 @@ class MetadataController extends ControllerBase { ...@@ -16,7 +16,7 @@ class MetadataController extends ControllerBase {
* testing automatic updates. This was done in order to use a different * testing automatic updates. This was done in order to use a different
* directory of mock XML files. * directory of mock XML files.
*/ */
public function updateTest($project_name = 'drupal', $version = NULL) { public function updateTest($project_name = 'drupal', $version = NULL): Response {
if ($project_name !== 'drupal') { if ($project_name !== 'drupal') {
return new Response(); return new Response();
} }
......
...@@ -118,7 +118,7 @@ END; ...@@ -118,7 +118,7 @@ END;
/** /**
* Returns the data to write to the test site's composer.json. * Returns the data to write to the test site's composer.json.
* *
* @return array * @return mixed[]
* The data that should be written to the test site's composer.json. * The data that should be written to the test site's composer.json.
*/ */
protected function getComposerConfiguration(): array { protected function getComposerConfiguration(): array {
......
...@@ -16,7 +16,7 @@ trait JsonTrait { ...@@ -16,7 +16,7 @@ trait JsonTrait {
* @param string $path * @param string $path
* The path of the file to read. * The path of the file to read.
* *
* @return array * @return mixed[]
* The parsed data in the file. * The parsed data in the file.
*/ */
protected function readJson(string $path): array { protected function readJson(string $path): array {
......
...@@ -30,7 +30,7 @@ trait LocalPackagesTrait { ...@@ -30,7 +30,7 @@ trait LocalPackagesTrait {
* @param string $dir * @param string $dir
* The directory which contains composer.lock. * The directory which contains composer.lock.
* *
* @return array[] * @return mixed[][]
* The local path repositories' configuration, for inclusion in a * The local path repositories' configuration, for inclusion in a
* composer.json file. * composer.json file.
*/ */
...@@ -67,7 +67,7 @@ trait LocalPackagesTrait { ...@@ -67,7 +67,7 @@ trait LocalPackagesTrait {
* @param string $dir * @param string $dir
* The directory which contains the lock file. * The directory which contains the lock file.
* *
* @return array[] * @return mixed[][]
* All package information (including dev packages) from the lock file. * All package information (including dev packages) from the lock file.
*/ */
private function getPackagesFromLockFile(string $dir): array { private function getPackagesFromLockFile(string $dir): array {
......
...@@ -119,7 +119,7 @@ class StagedProjectsValidationTest extends UnitTestCase { ...@@ -119,7 +119,7 @@ class StagedProjectsValidationTest extends UnitTestCase {
* *
* @covers ::validateStagedProjects * @covers ::validateStagedProjects
*/ */
public function testNoErrors() { public function testNoErrors(): void {
$fixtures_dir = realpath(__DIR__ . '/../../fixtures/project_staged_validation/no_errors'); $fixtures_dir = realpath(__DIR__ . '/../../fixtures/project_staged_validation/no_errors');
$updater = $this->prophesize(Updater::class); $updater = $this->prophesize(Updater::class);
$updater->getActiveDirectory()->willReturn("$fixtures_dir/active"); $updater->getActiveDirectory()->willReturn("$fixtures_dir/active");
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment