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
1 merge request!7Issue #3228392: Fix various nits
......@@ -4,32 +4,32 @@ services:
arguments: ['@keyvalue.expirable', '@datetime.time', 24]
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:
class: Drupal\automatic_updates\Validation\StagedProjectsValidation
arguments: [ '@string_translation', '@automatic_updates.updater' ]
arguments: ['@string_translation', '@automatic_updates.updater' ]
tags:
- { name: event_subscriber }
automatic_updates.beginner:
class: Drupal\automatic_updates\ComposerStager\Beginner
arguments:
[ '@automatic_updates.file_copier', '@automatic_updates.file_system' ]
['@automatic_updates.file_copier', '@automatic_updates.file_system' ]
automatic_updates.stager:
class: PhpTuf\ComposerStager\Domain\Stager
arguments:
[ '@automatic_updates.composer_runner', '@automatic_updates.file_system' ]
['@automatic_updates.composer_runner', '@automatic_updates.file_system' ]
automatic_updates.cleaner:
class: PhpTuf\ComposerStager\Domain\Cleaner
arguments:
[ '@automatic_updates.file_system' ]
['@automatic_updates.file_system' ]
automatic_updates.committer:
class: PhpTuf\ComposerStager\Domain\Committer
arguments:
[ '@automatic_updates.file_copier', '@automatic_updates.file_system' ]
['@automatic_updates.file_copier', '@automatic_updates.file_system' ]
automatic_updates.composer_runner:
class: PhpTuf\ComposerStager\Infrastructure\Process\Runner\ComposerRunner
arguments:
[ '@automatic_updates.exec_finder', '@automatic_updates.process_factory' ]
['@automatic_updates.exec_finder', '@automatic_updates.process_factory' ]
automatic_updates.file_copier.factory:
class: PhpTuf\ComposerStager\Infrastructure\Process\FileCopier\FileCopierFactory
arguments:
......@@ -55,7 +55,7 @@ services:
automatic_updates.file_system:
class: PhpTuf\ComposerStager\Infrastructure\Filesystem\Filesystem
arguments:
[ '@automatic_updates.symfony_file_system' ]
['@automatic_updates.symfony_file_system' ]
automatic_updates.symfony_file_system:
class: Symfony\Component\Filesystem\Filesystem
automatic_updates.symfony_exec_finder:
......@@ -63,10 +63,10 @@ services:
automatic_updates.rsync:
class: PhpTuf\ComposerStager\Infrastructure\Process\Runner\RsyncRunner
arguments:
[ '@automatic_updates.exec_finder', '@automatic_updates.process_factory' ]
['@automatic_updates.exec_finder', '@automatic_updates.process_factory' ]
automatic_updates.exec_finder:
class: PhpTuf\ComposerStager\Infrastructure\Process\ExecutableFinder
arguments:
[ '@automatic_updates.symfony_exec_finder' ]
['@automatic_updates.symfony_exec_finder' ]
automatic_updates.process_factory:
class: Drupal\automatic_updates\ComposerStager\ProcessFactory
......@@ -12,7 +12,7 @@ use Symfony\Component\HttpFoundation\RedirectResponse;
class BatchProcessor {
/**
* Get the updater service.
* Gets the updater service.
*
* @return \Drupal\automatic_updates\Updater
* The updater service.
......
......@@ -102,7 +102,7 @@ class UpdateReady extends UpdateFormBase {
$session = $this->getRequest()->getSession();
// Store maintenance_mode setting so we can restore it when done.
$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);
// @todo unset after updater. After db update?
}
......
......@@ -99,7 +99,7 @@ class UpdaterForm extends UpdateFormBase {
$project = $project_data['drupal'];
// 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');
return $form;
}
......@@ -190,7 +190,7 @@ class UpdaterForm extends UpdateFormBase {
/**
* Builds the form actions.
*
* @return array
* @return mixed[][]
* The form's actions elements.
*/
protected function actions(): array {
......
......@@ -80,7 +80,7 @@ class Updater {
protected $eventDispatcher;
/**
* Updater constructor.
* Constructs an Updater object.
*
* @param \Drupal\Core\State\StateInterface $state
* The state service.
......
......@@ -16,7 +16,7 @@ class MetadataController extends ControllerBase {
* testing automatic updates. This was done in order to use a different
* 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') {
return new Response();
}
......
......@@ -118,7 +118,7 @@ END;
/**
* 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.
*/
protected function getComposerConfiguration(): array {
......
......@@ -16,7 +16,7 @@ trait JsonTrait {
* @param string $path
* The path of the file to read.
*
* @return array
* @return mixed[]
* The parsed data in the file.
*/
protected function readJson(string $path): array {
......
......@@ -30,7 +30,7 @@ trait LocalPackagesTrait {
* @param string $dir
* The directory which contains composer.lock.
*
* @return array[]
* @return mixed[][]
* The local path repositories' configuration, for inclusion in a
* composer.json file.
*/
......@@ -67,7 +67,7 @@ trait LocalPackagesTrait {
* @param string $dir
* The directory which contains the lock file.
*
* @return array[]
* @return mixed[][]
* All package information (including dev packages) from the lock file.
*/
private function getPackagesFromLockFile(string $dir): array {
......
......@@ -119,7 +119,7 @@ class StagedProjectsValidationTest extends UnitTestCase {
*
* @covers ::validateStagedProjects
*/
public function testNoErrors() {
public function testNoErrors(): void {
$fixtures_dir = realpath(__DIR__ . '/../../fixtures/project_staged_validation/no_errors');
$updater = $this->prophesize(Updater::class);
$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