- Issue created by @alexpott
- Status changed to Needs review
over 1 year ago 4:34pm 1 December 2023 - Status changed to RTBC
over 1 year ago 9:14am 2 December 2023 - π§πͺBelgium borisson_ Mechelen, π§πͺ
In #1890784: Refactor configuration import and sync functions β , the patch where the implementation was added, there was this in the interface.
+ /** + * Add differences between source and target configuration storage to changelist. + * + * @return \Drupal\Core\Config\StorageComparerInterface + * An object which implements the StorageComparerInterface. + */ + public function createChangelist();
It was then removed in #2030073: Config cannot be imported in order for dependencies β , but I don't see any discussion about why this was removed in that issue; but since this was already public and we have a 1-1 relation between the Interface and the Class, I guess this was already kind of a public api, so we're not really adding any new api surface.
- π¬π§United Kingdom alexpott πͺπΊπ
@borisson_ nice git sleuthing! Very much looks like my mistake ;D
- πΊπΈUnited States thejimbirch Cape Cod, Massachusetts
I'm not sure I am doing this right, so going to talk through the steps and not change the status.
I applied the patch from this MR to a local site.
I ran
vendor/bin/phpstan analyse web/core/lib/Drupal/Core/Config/StorageComparer.php
with my default at level 5 and it passed.If I run it at level 9, I get 21 errors:
β― vendor/bin/phpstan analyse -l 9 web/core/lib/Drupal/Core/Config/StorageComparer.php Note: Using configuration file /Users/username/Projects/project-name/phpstan.neon. 1/1 [ββββββββββββββββββββββββββββ] 100% ------ ------------------------------------------------------------------------------------------------------------------------------------------- Line StorageComparer.php ------ ------------------------------------------------------------------------------------------------------------------------------------------- 50 Property Drupal\Core\Config\StorageComparer::$changelist type has no value type specified in iterable type array. π‘ See: https://phpstan.org/blog/solving-phpstan-no-value-type-specified-in-iterable-type 59 Property Drupal\Core\Config\StorageComparer::$sourceNames type has no value type specified in iterable type array. π‘ See: https://phpstan.org/blog/solving-phpstan-no-value-type-specified-in-iterable-type 68 Property Drupal\Core\Config\StorageComparer::$targetNames type has no value type specified in iterable type array. π‘ See: https://phpstan.org/blog/solving-phpstan-no-value-type-specified-in-iterable-type 148 Method Drupal\Core\Config\StorageComparer::getEmptyChangelist() return type has no value type specified in iterable type array. π‘ See: https://phpstan.org/blog/solving-phpstan-no-value-type-specified-in-iterable-type 160 Method Drupal\Core\Config\StorageComparer::getChangelist() return type has no value type specified in iterable type array. π‘ See: https://phpstan.org/blog/solving-phpstan-no-value-type-specified-in-iterable-type 180 Method Drupal\Core\Config\StorageComparer::addChangeList() has no return type specified. 180 Method Drupal\Core\Config\StorageComparer::addChangeList() has parameter $changes with no value type specified in iterable type array. π‘ See: https://phpstan.org/blog/solving-phpstan-no-value-type-specified-in-iterable-type 180 Method Drupal\Core\Config\StorageComparer::addChangeList() has parameter $sort_order with no value type specified in iterable type array. π‘ See: https://phpstan.org/blog/solving-phpstan-no-value-type-specified-in-iterable-type 223 Method Drupal\Core\Config\StorageComparer::addChangelistDelete() has no return type specified. 238 Method Drupal\Core\Config\StorageComparer::addChangelistCreate() has no return type specified. 253 Method Drupal\Core\Config\StorageComparer::addChangelistUpdate() has no return type specified. 259 Cannot access offset 'uuid' on array|bool. 290 Method Drupal\Core\Config\StorageComparer::addChangelistRename() has no return type specified. 344 Method Drupal\Core\Config\StorageComparer::removeFromChangelist() has no return type specified. 354 Method Drupal\Core\Config\StorageComparer::moveRenameToUpdate() has no return type specified. 394 Cannot access offset 'uuid' on non-empty-array|true. 394 Cannot access offset 'uuid' on non-empty-array|true. 400 Method Drupal\Core\Config\StorageComparer::getAndSortConfigData() has no return type specified. 400 Method Drupal\Core\Config\StorageComparer::getAndSortConfigData() has parameter $collection with no type specified. 442 Method Drupal\Core\Config\StorageComparer::extractRenameNames() return type has no value type specified in iterable type array. π‘ See: https://phpstan.org/blog/solving-phpstan-no-value-type-specified-in-iterable-type 453 Method Drupal\Core\Config\StorageComparer::getAllCollectionNames() return type has no value type specified in iterable type array. π‘ See: https://phpstan.org/blog/solving-phpstan-no-value-type-specified-in-iterable-type ------ ------------------------------------------------------------------------------------------------------------------------------------------- [ERROR] Found 21 errors
- π¬π§United Kingdom alexpott πͺπΊπ
@thejimbirch core is only doing level 1 scans - and they are done as part of the CI run. Addressing level 9 issues is not in scope for this issue.
- π¬π§United Kingdom alexpott πͺπΊπ
@thejimbirch also none of those are particularly easy to address - for example, we're not adding return types everywhere yet.
- πΊπΈUnited States thejimbirch Cape Cod, Massachusetts
Understood. Didn't know the "decent level" from the steps to reproduce. This passed as level 5 with no errors, so indeed much higher than core's normal level 1. +1 for RTBC.
- π³πΏNew Zealand quietone
I'm triaging RTBC issues β . I read the IS and the comments. I didn't find any unanswered questions or other work to do. I updated credit.
Leaving at RTBC.
- Status changed to Fixed
about 1 year ago 12:15pm 12 January 2024 -
longwave β
committed 0439701d on 11.x
Issue #3405574 by alexpott, borisson_: StorageComparerInterface() is...
-
longwave β
committed 0439701d on 11.x
Automatically closed - issue fixed for 2 weeks with no activity.