Closed (fixed)
Project:
Facets
Version:
3.0.x-dev
Component:
Code
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
19 Nov 2024 at 13:46 UTC
Updated:
7 May 2026 at 12:00 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #3
csmdgl commentedComment #4
mikell commentedThx, can confirm this patch fixed it.
Comment #5
mikell commentedComment #6
huzookaImho this can be solved without changing the return type at
Drupal\facets\Plugin\facets\facet_source\SearchApiDisplay::getCount().Comment #7
alorencComment #8
alorencComment #9
dxvargas commentedThe MR is working.
I'm not sure about removing the return type declaration, "?string" could be there. But since the return type declarations are not consistently used in the class and it's not used in the interface, removing is also an option that makes sense.
I mark the issue as RTBC.
Comment #10
dj1999 commentedThe #4 fixed the error.
Comment #11
ioana apetri commentedHello, I added the diff based on the MR. Thanks!
Comment #13
herved commentedThere is a conflict in the MR, recent changes on 3.x affected this and the return type was removed to fix phpstan.
See https://git.drupalcode.org/project/facets/-/commit/28332851b927d94f4deb3...
I think we could either:
- close this
- or add the return type to
::getCountin FacetSourcePluginInterface, FacetSourcePluginBase and SearchApiDisplay, but that would affect backwards compatibility I assume.Comment #14
liam morlandI re-rolled the MR.
Comment #15
herved commentedJust a thought, but the issue title is no longer accurate since the PHP TypeError doesn't happen anymore on 3.0.x.
So this now adds return type to
SearchApiDisplay::getCountwhich could be done but this could affect BC and I wonder if we should apply the same to other::getCountimplementations for consistency? as mentioned in #13Comment #16
liam morlandI don't see how adding the return type declaration would cause a problem. Having no return type declaration means it could return anything. The merge request just narrows the possibilities. Adding the return type declaration to the interface could cause a backwards-compatibility issue. Better to add it to the implementations first.
Comment #17
joaopauloscho commentedThis is fixed by https://www.drupal.org/project/facets/issues/3502957 included in the 3.0.2.
Comment #18
strykaizer