- Issue created by @sokru
- Status changed to Active
9 months ago 5:42am 12 March 2024 - First commit to issue fork.
- Open on Drupal.org →Core: 10.2.1 + Environment: PHP 8.1 & MySQL 5.7last update
9 months ago Waiting for branch to pass - Status changed to Needs review
9 months ago 10:09am 12 March 2024 - Status changed to Needs work
9 months ago 11:06am 12 March 2024 - 🇫🇮Finland sokru
Increasing the PHPStan level creates 48 new errors (see https://git.drupalcode.org/issue/elasticsearch_connector-3426825/-/jobs/...), we should fix them in this issue.
- Open on Drupal.org →Core: 10.2.1 + Environment: PHP 8.1 & MySQL 5.7last update
9 months ago Waiting for branch to pass - 🇧🇪Belgium BramDriesen Belgium 🇧🇪
3 errors remaining. Not sure what the easiest way to fix those is.
- First commit to issue fork.
- Open on Drupal.org →Core: 10.2.1 + Environment: PHP 8.1 & MySQL 5.7last update
9 months ago Waiting for branch to pass - 🇨🇦Canada mparker17 UTC-4
@BramDriesen, thank you very much for your hard work!
The remaining issues in
src/Plugin/search_api/backend/ElasticSearchBackend.php
...- Line 216: Call to an undefined method Drupal\Core\Plugin\PluginFormInterface::getLabel().
- Line 217: Call to an undefined method Drupal\Core\Plugin\PluginFormInterface::getDescription().
... are because we were checking if
$connector instanceof PluginFormInterface
; and PluginFormInterface which doesn't define getLabel() nor getDescription() methods (and it doesn't inherit from any interfaces that define these methods either).However, if we instead check whether
$connector instanceof ElasticSearchConnectorInterface
, the PHPStan lints will go away, because ElasticSearchConnectorInterface extends PluginFormInterface AND defines both a getLabel() method and a getDescription() method.There is one more lint in
src/SearchAPI/Query/FilterBuilder.php
, "Call to an undefined method Drupal\search_api\Query\ConditionGroupInterface::__toString()." - I will check this out in a bit. - Open on Drupal.org →Core: 10.2.1 + Environment: PHP 8.1 & MySQL 5.7last update
9 months ago Waiting for branch to pass - 🇨🇦Canada mparker17 UTC-4
Regarding the
Call to an undefined method Drupal\search_api\Query\ConditionGroupInterface::__toString().
lint insrc/SearchAPI/Query/FilterBuilder.php
, seems like Search API's API could use an improvement, so I've filed ✨ Declare that ConditionGroupInterface or ConditionGroup implements \Stringable Needs review , and we can add this lint to the baseline for now. - Open on Drupal.org →Core: 10.2.1 + Environment: PHP 8.1 & MySQL 5.7last update
9 months ago Waiting for branch to pass - Status changed to Needs review
9 months ago 6:41pm 15 March 2024 - 🇨🇦Canada mparker17 UTC-4
Alright! PHPStan is passing. Moving to Needs Review.
@sokru, did you also want to address some of the existing items in
phpstan-baseline.neon
? - Open on Drupal.org →Core: 10.2.1 + Environment: PHP 8.1 & MySQL 5.7last update
9 months ago Waiting for branch to pass - Open on Drupal.org →Core: 10.2.1 + Environment: PHP 8.1 & MySQL 5.7last update
9 months ago Waiting for branch to pass - Status changed to RTBC
9 months ago 8:53pm 16 March 2024 - 🇨🇦Canada mparker17 UTC-4
I was able to fix a deprecated function call, but the other lints in
phpstan-baseline.neon
are hard to figure out how to change safely, so I'm leaving them here. We should collaborate with the search_api_opensearch maintainers to figure out whether we can delete the code causing those errors.For now, though, this is RTBC from me, and I'd like another maintainer to review (and ask questions), instead of me merging directly.
- Open on Drupal.org →Core: 10.2.1 + Environment: PHP 8.1 & MySQL 5.7last update
9 months ago Waiting for branch to pass -
sokru →
committed 8be8e726 on 8.0.x authored by
BramDriesen →
Issue #3426825 by mparker17, BramDriesen, sokru: Increase PHPstan level...
-
sokru →
committed 8be8e726 on 8.0.x authored by
BramDriesen →
- Status changed to Fixed
9 months ago 8:53am 17 March 2024 - 🇫🇮Finland sokru
Thanks! I agree with decision to leave existing lints to
phpstan-baseline.neon
, we could research it on separate issue and collaborate with search_api_opensearch module maintainers, and maybe doing it before increasing the level further. It seems we get related errors when reaching level 5.Also thanks for creating ✨ Declare that ConditionGroupInterface or ConditionGroup implements \Stringable Needs review , maybe we should ask feedback from #search or #contribute on Drupal.org's Slack if we don't get any replies in few weeks.
Automatically closed - issue fixed for 2 weeks with no activity.