Skip to content
Snippets Groups Projects
Commit cfafc5a7 authored by Theresa Grannum's avatar Theresa Grannum Committed by Ted Bowman
Browse files

Issue #3295791 by Theresa.Grannum, tedbow: Add return types where needed

parent d9b09373
No related branches found
No related tags found
No related merge requests found
Showing
with 20 additions and 20 deletions
...@@ -101,7 +101,7 @@ END; ...@@ -101,7 +101,7 @@ END;
/** /**
* Tests updating a module in a staging area via the UI. * Tests updating a module in a staging area via the UI.
*/ */
public function testUi() { public function testUi(): void {
$this->createTestProject('RecommendedProject'); $this->createTestProject('RecommendedProject');
$mink = $this->getMink(); $mink = $this->getMink();
...@@ -154,7 +154,7 @@ END; ...@@ -154,7 +154,7 @@ END;
* @param string $version * @param string $version
* The expected version. * The expected version.
*/ */
private function assertModuleVersion(string $module_name, string $version) { private function assertModuleVersion(string $module_name, string $version): void {
$web_root = $this->getWebRoot(); $web_root = $this->getWebRoot();
$composer_json = file_get_contents("$web_root/modules/contrib/$module_name/composer.json"); $composer_json = file_get_contents("$web_root/modules/contrib/$module_name/composer.json");
$data = json_decode($composer_json, TRUE); $data = json_decode($composer_json, TRUE);
......
...@@ -47,7 +47,7 @@ class UpdaterFormTest extends AutomaticUpdatesFunctionalTestBase { ...@@ -47,7 +47,7 @@ class UpdaterFormTest extends AutomaticUpdatesFunctionalTestBase {
* @return array[] * @return array[]
* The test cases. * The test cases.
*/ */
public function providerSuccessfulUpdate() { public function providerSuccessfulUpdate(): array {
return [ return [
'maintenance mode on, semver' => [TRUE, 'semver_test', '8.1.0', '8.1.1'], 'maintenance mode on, semver' => [TRUE, 'semver_test', '8.1.0', '8.1.1'],
'maintenance mode off, legacy' => [FALSE, 'aaa_update_test', '8.x-2.0', '8.x-2.1'], 'maintenance mode off, legacy' => [FALSE, 'aaa_update_test', '8.x-2.0', '8.x-2.1'],
...@@ -82,7 +82,7 @@ class UpdaterFormTest extends AutomaticUpdatesFunctionalTestBase { ...@@ -82,7 +82,7 @@ class UpdaterFormTest extends AutomaticUpdatesFunctionalTestBase {
* @todo This is copied from core. We need to file a core issue so we do not * @todo This is copied from core. We need to file a core issue so we do not
* have to copy this. * have to copy this.
*/ */
protected function setProjectInstalledVersion($project_versions) { protected function setProjectInstalledVersion($project_versions): void {
$this->config('update.settings') $this->config('update.settings')
->set('fetch.url', $this->baseUrl . '/test-release-history') ->set('fetch.url', $this->baseUrl . '/test-release-history')
->save(); ->save();
......
...@@ -112,7 +112,7 @@ class TestSubscriber implements EventSubscriberInterface { ...@@ -112,7 +112,7 @@ class TestSubscriber implements EventSubscriberInterface {
* @return string * @return string
* The state key under which to store the results for the given event. * The state key under which to store the results for the given event.
*/ */
protected static function getStateKey(string $event) { protected static function getStateKey(string $event): string {
$parts = explode('\\', $event); $parts = explode('\\', $event);
return static::STATE_KEY . array_pop($parts); return static::STATE_KEY . array_pop($parts);
} }
......
...@@ -264,7 +264,7 @@ final class BatchProcessor { ...@@ -264,7 +264,7 @@ final class BatchProcessor {
* @see \Drupal\update\Form\UpdateReady::submitForm() * @see \Drupal\update\Form\UpdateReady::submitForm()
* @see automatic_updates_batch_alter() * @see automatic_updates_batch_alter()
*/ */
public static function dbUpdateBatchFinished(bool $success, array $results, array $operations) { public static function dbUpdateBatchFinished(bool $success, array $results, array $operations): void {
DbUpdateController::batchFinished($success, $results, $operations); DbUpdateController::batchFinished($success, $results, $operations);
// Now that the update is done, we can put the site back online if it was // Now that the update is done, we can put the site back online if it was
// previously not in maintenance mode. // previously not in maintenance mode.
......
...@@ -25,7 +25,7 @@ class StagedDatabaseUpdateValidator extends BaseValidator { ...@@ -25,7 +25,7 @@ class StagedDatabaseUpdateValidator extends BaseValidator {
* @param \Drupal\Core\State\StateInterface $state * @param \Drupal\Core\State\StateInterface $state
* The state service. * The state service.
*/ */
public function setState(StateInterface $state) { public function setState(StateInterface $state): void {
$this->state = $state; $this->state = $state;
} }
......
...@@ -14,7 +14,7 @@ class AutomaticUpdatesTestDisableValidatorsServiceProvider extends ServiceProvid ...@@ -14,7 +14,7 @@ class AutomaticUpdatesTestDisableValidatorsServiceProvider extends ServiceProvid
/** /**
* {@inheritdoc} * {@inheritdoc}
*/ */
public function alter(ContainerBuilder $container) { public function alter(ContainerBuilder $container): void {
parent::alter($container); parent::alter($container);
$validators = Settings::get('automatic_updates_test_disable_validators', []); $validators = Settings::get('automatic_updates_test_disable_validators', []);
......
...@@ -14,7 +14,7 @@ class CoreUpdateTest extends UpdateTestBase { ...@@ -14,7 +14,7 @@ class CoreUpdateTest extends UpdateTestBase {
/** /**
* {@inheritdoc} * {@inheritdoc}
*/ */
public function copyCodebase(\Iterator $iterator = NULL, $working_dir = NULL) { public function copyCodebase(\Iterator $iterator = NULL, $working_dir = NULL): void {
parent::copyCodebase($iterator, $working_dir); parent::copyCodebase($iterator, $working_dir);
// Ensure that we will install Drupal 9.8.0 (a fake version that should // Ensure that we will install Drupal 9.8.0 (a fake version that should
......
...@@ -41,7 +41,7 @@ abstract class AutomaticUpdatesFunctionalTestBase extends BrowserTestBase { ...@@ -41,7 +41,7 @@ abstract class AutomaticUpdatesFunctionalTestBase extends BrowserTestBase {
/** /**
* {@inheritdoc} * {@inheritdoc}
*/ */
protected function setUp() { protected function setUp(): void {
parent::setUp(); parent::setUp();
$this->disableValidators($this->disableValidators); $this->disableValidators($this->disableValidators);
...@@ -60,7 +60,7 @@ abstract class AutomaticUpdatesFunctionalTestBase extends BrowserTestBase { ...@@ -60,7 +60,7 @@ abstract class AutomaticUpdatesFunctionalTestBase extends BrowserTestBase {
/** /**
* {@inheritdoc} * {@inheritdoc}
*/ */
protected function installModulesFromClassProperty(ContainerInterface $container) { protected function installModulesFromClassProperty(ContainerInterface $container): void {
$container->get('module_installer')->install([ $container->get('module_installer')->install([
'automatic_updates_test_release_history', 'automatic_updates_test_release_history',
]); ]);
......
...@@ -427,7 +427,7 @@ class UpdaterFormTest extends AutomaticUpdatesFunctionalTestBase { ...@@ -427,7 +427,7 @@ class UpdaterFormTest extends AutomaticUpdatesFunctionalTestBase {
* @return bool[][] * @return bool[][]
* The test cases. * The test cases.
*/ */
public function providerStagedDatabaseUpdates() { public function providerStagedDatabaseUpdates(): array {
return [ return [
'maintenance mode on' => [TRUE], 'maintenance mode on' => [TRUE],
'maintenance mode off' => [FALSE], 'maintenance mode off' => [FALSE],
......
...@@ -23,7 +23,7 @@ class ProjectInfoTest extends AutomaticUpdatesKernelTestBase { ...@@ -23,7 +23,7 @@ class ProjectInfoTest extends AutomaticUpdatesKernelTestBase {
* *
* @dataProvider providerGetInstallableReleases * @dataProvider providerGetInstallableReleases
*/ */
public function testGetInstallableReleases(string $fixture, string $installed_version, array $expected_versions) { public function testGetInstallableReleases(string $fixture, string $installed_version, array $expected_versions): void {
[$project] = explode('.', $fixture); [$project] = explode('.', $fixture);
$fixtures_directory = __DIR__ . '/../../fixtures/release-history/'; $fixtures_directory = __DIR__ . '/../../fixtures/release-history/';
if ($project === 'drupal') { if ($project === 'drupal') {
...@@ -60,7 +60,7 @@ class ProjectInfoTest extends AutomaticUpdatesKernelTestBase { ...@@ -60,7 +60,7 @@ class ProjectInfoTest extends AutomaticUpdatesKernelTestBase {
* @return array[] * @return array[]
* The test cases. * The test cases.
*/ */
public function providerGetInstallableReleases() { public function providerGetInstallableReleases(): array {
return [ return [
'core, no updates' => [ 'core, no updates' => [
'drupal.9.8.2.xml', 'drupal.9.8.2.xml',
...@@ -122,7 +122,7 @@ class ProjectInfoTest extends AutomaticUpdatesKernelTestBase { ...@@ -122,7 +122,7 @@ class ProjectInfoTest extends AutomaticUpdatesKernelTestBase {
* *
* @covers ::getInstallableReleases() * @covers ::getInstallableReleases()
*/ */
public function testNotPublishedProject() { public function testNotPublishedProject(): void {
$this->setReleaseMetadata(['drupal' => __DIR__ . '/../../fixtures/release-history/drupal.9.8.2_unknown_status.xml']); $this->setReleaseMetadata(['drupal' => __DIR__ . '/../../fixtures/release-history/drupal.9.8.2_unknown_status.xml']);
$project_info = new ProjectInfo('drupal'); $project_info = new ProjectInfo('drupal');
$this->expectException('RuntimeException'); $this->expectException('RuntimeException');
......
...@@ -159,7 +159,7 @@ class ReleaseChooserTest extends AutomaticUpdatesKernelTestBase { ...@@ -159,7 +159,7 @@ class ReleaseChooserTest extends AutomaticUpdatesKernelTestBase {
* @param \Drupal\update\ProjectRelease|null $release * @param \Drupal\update\ProjectRelease|null $release
* The release to check, or NULL if no release is expected. * The release to check, or NULL if no release is expected.
*/ */
private function assertReleaseVersion(?string $version, ?ProjectRelease $release) { private function assertReleaseVersion(?string $version, ?ProjectRelease $release): void {
if (is_null($version)) { if (is_null($version)) {
$this->assertNull($release); $this->assertNull($release);
} }
......
...@@ -22,7 +22,7 @@ class LegacyVersionUtilityTest extends UnitTestCase { ...@@ -22,7 +22,7 @@ class LegacyVersionUtilityTest extends UnitTestCase {
* *
* @dataProvider providerConvertToSemanticVersion * @dataProvider providerConvertToSemanticVersion
*/ */
public function testConvertToSemanticVersion(string $version_number, string $expected) { public function testConvertToSemanticVersion(string $version_number, string $expected): void {
$this->assertSame($expected, LegacyVersionUtility::convertToSemanticVersion($version_number)); $this->assertSame($expected, LegacyVersionUtility::convertToSemanticVersion($version_number));
} }
...@@ -32,7 +32,7 @@ class LegacyVersionUtilityTest extends UnitTestCase { ...@@ -32,7 +32,7 @@ class LegacyVersionUtilityTest extends UnitTestCase {
* @return string[][] * @return string[][]
* The test cases. * The test cases.
*/ */
public function providerConvertToSemanticVersion() { public function providerConvertToSemanticVersion(): array {
return [ return [
'8.x-1.2' => ['8.x-1.2', '1.2.0'], '8.x-1.2' => ['8.x-1.2', '1.2.0'],
'8.x-1.2-alpha1' => ['8.x-1.2-alpha1', '1.2.0-alpha1'], '8.x-1.2-alpha1' => ['8.x-1.2-alpha1', '1.2.0-alpha1'],
...@@ -51,7 +51,7 @@ class LegacyVersionUtilityTest extends UnitTestCase { ...@@ -51,7 +51,7 @@ class LegacyVersionUtilityTest extends UnitTestCase {
* *
* @dataProvider providerConvertToLegacyVersion * @dataProvider providerConvertToLegacyVersion
*/ */
public function testConvertToLegacyVersion(string $version_number, ?string $expected) { public function testConvertToLegacyVersion(string $version_number, ?string $expected): void {
$this->assertSame($expected, LegacyVersionUtility::convertToLegacyVersion($version_number)); $this->assertSame($expected, LegacyVersionUtility::convertToLegacyVersion($version_number));
} }
...@@ -61,7 +61,7 @@ class LegacyVersionUtilityTest extends UnitTestCase { ...@@ -61,7 +61,7 @@ class LegacyVersionUtilityTest extends UnitTestCase {
* @return array[] * @return array[]
* The test cases. * The test cases.
*/ */
public function providerConvertToLegacyVersion() { public function providerConvertToLegacyVersion(): array {
return [ return [
'1.2.0' => ['1.2.0', '8.x-1.2'], '1.2.0' => ['1.2.0', '8.x-1.2'],
'1.2.0-alpha1' => ['1.2.0-alpha1', '8.x-1.2-alpha1'], '1.2.0-alpha1' => ['1.2.0-alpha1', '8.x-1.2-alpha1'],
......
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