Skip to content
Snippets Groups Projects
Verified Commit 523cbdf6 authored by Théodore Biadala's avatar Théodore Biadala
Browse files

Issue #3501866 by quietone, oily: Remove remaining instances of the array language construct

parent 0c23c746
Branches
Tags
6 merge requests!11197Issue #3506427 by eduardo morales alberti: Remove responsive_image.ajax from hook,!5423Draft: Resolve #3329907 "Test2",!3478Issue #3337882: Deleted menus are not removed from content type config,!2964Issue #2865710 : Dependencies from only one instance of a widget are used in display modes,!10223132456: Fix issue where views instances are emptied before an ajax request is complete,!579Issue #2230909: Simple decimals fail to pass validation
Pipeline #408158 passed with warnings
Pipeline: drupal

#408168

    Pipeline: drupal

    #408166

      Pipeline: drupal

      #408160

        ......@@ -298,12 +298,12 @@ private function parseDefinition(string $id, $service, string $file, array $defa
        if (is_string($service['factory'])) {
        if (str_contains($service['factory'], ':') && !str_contains($service['factory'], '::')) {
        $parts = explode(':', $service['factory']);
        $definition->setFactory(array($this->resolveServices('@'.$parts[0]), $parts[1]));
        $definition->setFactory([$this->resolveServices('@'.$parts[0]), $parts[1]]);
        } else {
        $definition->setFactory($service['factory']);
        }
        } else {
        $definition->setFactory(array($this->resolveServices($service['factory'][0]), $service['factory'][1]));
        $definition->setFactory([$this->resolveServices($service['factory'][0]), $service['factory'][1]]);
        }
        }
        ......@@ -335,7 +335,7 @@ private function parseDefinition(string $id, $service, string $file, array $defa
        if (is_string($service['configurator'])) {
        $definition->setConfigurator($service['configurator']);
        } else {
        $definition->setConfigurator(array($this->resolveServices($service['configurator'][0]), $service['configurator'][1]));
        $definition->setConfigurator([$this->resolveServices($service['configurator'][0]), $service['configurator'][1]]);
        }
        }
        ......@@ -347,10 +347,10 @@ private function parseDefinition(string $id, $service, string $file, array $defa
        foreach ($service['calls'] as $call) {
        if (isset($call['method'])) {
        $method = $call['method'];
        $args = isset($call['arguments']) ? $this->resolveServices($call['arguments']) : array();
        $args = isset($call['arguments']) ? $this->resolveServices($call['arguments']) : [];
        } else {
        $method = $call[0];
        $args = isset($call[1]) ? $this->resolveServices($call[1]) : array();
        $args = isset($call[1]) ? $this->resolveServices($call[1]) : [];
        }
        $definition->addMethodCall($method, $args);
        ......@@ -476,7 +476,7 @@ private function validate($content, $file)
        throw new InvalidArgumentException(sprintf('The service file "%s" is not valid. It should contain an array. Check your YAML syntax.', $file));
        }
        if ($invalid_keys = array_keys(array_diff_key($content, array('parameters' => 1, 'services' => 1)))) {
        if ($invalid_keys = array_keys(array_diff_key($content, ['parameters' => 1, 'services' => 1]))) {
        throw new InvalidArgumentException(sprintf('The service file "%s" is not valid: it contains invalid root key(s) "%s". Services have to be added under "services" and Parameters under "parameters".', $file, implode('", "', $invalid_keys)));
        }
        ......@@ -522,7 +522,7 @@ private function resolveServices(mixed $value): mixed
        }
        if (is_array($value)) {
        $value = array_map(array($this, 'resolveServices'), $value);
        $value = array_map([$this, 'resolveServices'], $value);
        } elseif (is_string($value) && str_starts_with($value, '@=')) {
        // Not supported.
        //return new Expression(substr($value, 2));
        ......
        ......@@ -80,11 +80,11 @@ public function compile(Compiler $compiler) {
        // Write any tokens found as an associative array parameter, otherwise just
        // leave as an empty array.
        $compiler->raw(', array(');
        $compiler->raw(', [');
        foreach ($tokens as $token) {
        $compiler->string($token->getAttribute('placeholder'))->raw(' => ')->subcompile($token)->raw(', ');
        }
        $compiler->raw(')');
        $compiler->raw(']');
        // Write any options passed.
        if ($this->hasNode('options')) {
        ......
        ......@@ -53,7 +53,7 @@ public function testDiscoveryInterface(): void {
        }
        // Ensure that an empty array is returned if no plugin definitions are found.
        $this->assertSame([], $this->emptyDiscovery->getDefinitions(), 'array() returned if no plugin definitions are found.');
        $this->assertSame([], $this->emptyDiscovery->getDefinitions(), 'Empty array returned if no plugin definitions are found.');
        // Ensure that NULL is returned as the definition of a non-existing plugin.
        $this->assertNull($this->emptyDiscovery->getDefinition('non_existing', FALSE), 'NULL returned as the definition of a non-existing plugin.');
        ......
        ......@@ -51,7 +51,7 @@ public function testDrupalRewriteSettings(): void {
        EXPECTED
        ],
        [
        'original' => '$no_index_value_array = array("old" => "value");',
        'original' => '$no_index_value_array = ["old" => "value"];',
        'settings' => [
        'no_index_value_array' => (object) [
        'value' => FALSE,
        ......@@ -59,7 +59,7 @@ public function testDrupalRewriteSettings(): void {
        'comment' => 'comment',
        ],
        ],
        'expected' => '$no_index_value_array = array("old" => "value");
        'expected' => '$no_index_value_array = ["old" => "value"];
        $no_index_value_array = false; // comment',
        ],
        [
        ......
        ......@@ -221,7 +221,7 @@ protected static function getContentHash($composerFileContents): string
        {
        $content = json_decode($composerFileContents, true);
        $relevantKeys = array(
        $relevantKeys = [
        'name',
        'version',
        'require',
        ......@@ -233,9 +233,9 @@ protected static function getContentHash($composerFileContents): string
        'prefer-stable',
        'repositories',
        'extra',
        );
        ];
        $relevantContent = array();
        $relevantContent = [];
        foreach (array_intersect($relevantKeys, array_keys($content)) as $key) {
        $relevantContent[$key] = $content[$key];
        ......
        ......@@ -20,19 +20,19 @@ Undefined index: foo
        <testsuite name="Drupal\Tests\Core\Route\RoleAccessCheckTest" file="/var/www/d8/core/tests/Drupal/Tests/Core/Route/RoleAccessCheckTestTest.php" namespace="Drupal\Tests\Core\Route" fullPackage="Drupal.Tests.Core.Route" tests="3" assertions="3" failures="3" errors="0" time="0.009176">
        <testsuite name="Drupal\Tests\Core\Route\RoleAccessCheckTest::testRoleAccess" tests="3" assertions="3" failures="3" errors="0" time="0.009176">
        <testcase name="testRoleAccess with data set #0" assertions="1" time="0.004519">
        <failure type="PHPUnit_Framework_ExpectationFailedException">Drupal\Tests\Core\Route\RoleAccessCheckTest::testRoleAccess with data set #0 ('role_test_1', array(Drupal\user\Entity\User, Drupal\user\Entity\User))
        <failure type="PHPUnit_Framework_ExpectationFailedException">Drupal\Tests\Core\Route\RoleAccessCheckTest::testRoleAccess with data set #0 ('role_test_1', [Drupal\user\Entity\User, Drupal\user\Entity\User])
        Access granted for user with the roles role_test_1 on path: role_test_1
        Failed asserting that false is true.
        </failure>
        </testcase>
        <testcase name="testRoleAccess with data set #1" assertions="1" time="0.002354">
        <failure type="PHPUnit_Framework_ExpectationFailedException">Drupal\Tests\Core\Route\RoleAccessCheckTest::testRoleAccess with data set #1 ('role_test_2', array(Drupal\user\Entity\User, Drupal\user\Entity\User))
        <failure type="PHPUnit_Framework_ExpectationFailedException">Drupal\Tests\Core\Route\RoleAccessCheckTest::testRoleAccess with data set #1 ('role_test_2', [Drupal\user\Entity\User, Drupal\user\Entity\User])
        Access granted for user with the roles role_test_2 on path: role_test_2
        Failed asserting that false is true.
        </failure>
        </testcase>
        <testcase name="testRoleAccess with data set #2" assertions="1" time="0.002303">
        <failure type="PHPUnit_Framework_ExpectationFailedException">Drupal\Tests\Core\Route\RoleAccessCheckTest::testRoleAccess with data set #2 ('role_test_3', array(Drupal\user\Entity\User))
        <failure type="PHPUnit_Framework_ExpectationFailedException">Drupal\Tests\Core\Route\RoleAccessCheckTest::testRoleAccess with data set #2 ('role_test_3', [Drupal\user\Entity\User])
        Access granted for user with the roles role_test_1, role_test_2 on path: role_test_3
        Failed asserting that false is true.
        </failure>
        ......
        0% Loading or .
        You are about to add 0 people to the discussion. Proceed with caution.
        Please register or to comment