- Issue created by @Grimreaper
- First commit to issue fork.
- Assigned to sijumpk
- Merge request !6190Update FunctionalTestSetupTrait.php; changing the second parameter type to... → (Open) created by sijumpk
- Issue was unassigned.
- Status changed to Needs review
about 1 year ago 5:07am 1 February 2024 - Status changed to Needs work
about 1 year ago 4:02pm 2 February 2024 - 🇺🇸United States smustgrave
Proposed solution is
Fix the type to be mixed or array|string?
What was the reason to just to array? Not against but thought needs to be said.
- 🇫🇷France Grimreaper France 🇫🇷
@smustgrave,
In Core almost all parameters are array, except: https://git.drupalcode.org/project/drupal/-/blob/11.x/sites/development....
parameters: http.response.debug_cacheability_headers: true
Also in JSON:API:
parameters: jsonapi.base_path: /jsonapi
So I guess, in some cases it can be something else.
- 🇮🇳India ankitsingh0188 Pune
ankitsingh0188 → changed the visibility of the branch 11.x to hidden.
- 🇮🇳India ankitsingh0188 Pune
ankitsingh0188 → changed the visibility of the branch 11.x to active.
- Merge request !11562Update FunctionalTestSetupTrait.php; changing the second parameter type to... → (Closed) created by ankitsingh0188
- 🇺🇸United States smustgrave
There was already an MR pointed to 11.x work should continue there
- 🇮🇳India ankitsingh0188 Pune
git checkout -b '11.x' --track drupal-3414535/'11.x'
The above commands not working because 11.x branch was already exists while taking the clone from drupal.git
- 🇨🇦Canada danrod Ottawa
I applied the MR locally:
There's a few core tests that call that the
setContainerParameter()
method:./core/modules/page_cache/tests/src/Functional/PageCacheTest.php: $this->setContainerParameter('http.response.debug_cacheability_headers', FALSE); ./core/modules/media/tests/src/FunctionalJavascript/MediaSourceOEmbedVideoTest.php: $this->setContainerParameter('twig.config', $parameters); ./core/modules/system/tests/src/Functional/Routing/RouterTest.php: $this->setContainerParameter('http.response.debug_cacheability_headers', FALSE); ./core/modules/system/tests/src/Functional/Theme/TwigDebugMarkupTest.php: $this->setContainerParameter('twig.config', $parameters); ./core/modules/system/tests/src/Functional/Theme/TwigDebugMarkupTest.php: $this->setContainerParameter('twig.config', $parameters); ./core/modules/system/tests/src/Functional/Theme/TwigExtensionTest.php: $this->setContainerParameter('twig.config', $parameters); ./core/modules/system/tests/src/Functional/Theme/TwigSettingsTest.php: $this->setContainerParameter('twig.config', $parameters); ./core/modules/system/tests/src/Functional/Theme/TwigSettingsTest.php: $this->setContainerParameter('twig.config', $parameters);
I ran some local tests contained in the file
./core/modules/system/tests/src/Functional/Theme/TwigSettingsTest.php
:I'll run test against the other test files
- 🇺🇸United States smustgrave
@ankitsingh0188 what was the reason to change to mixed vs array|string or just array like before?
Want to make sure we aren't just doing exactly what the summary says
- 🇮🇳India ankitsingh0188 Pune
@smustgrave We are not sure whether it'll be array or string or int or bool.
The mixed type accepts every value. It is equivalent to the union type object|resource|array|string|float|int|bool|null.
- 🇺🇸United States smustgrave
Personally -1 for changing to mixed, seems it would be better to leave as is or change to array|string
- Merge request !11751Update FunctionalTestSetupTrait.php; changing the second parameter type to... → (Closed) created by ankitsingh0188
- 🇮🇳India ankitsingh0188 Pune
ankitsingh0188 → changed the visibility of the branch 3414535-wrong-type-in to hidden.
- 🇮🇳India ankitsingh0188 Pune
The $value type can be array or string or bool most of the times it would be array but we are not sure if the type is bool then in that we need to change it to array|string|bool
IMO, we can use mixed return type instead of specifying the each return type individually.