You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
.php pages often define their own functions that are used only within the page. Functions are all defined in the same public namespace in PHP and defining a second function name is an error. But because .php pages are not included in other pages this is not actually a problem.
phpstan, however, doesn't know this and has gotten confused by it. As we add more type definitions to the codebase we're likely to run into this more. We can fix this by either:
making function names unique across the codebase
using PHP namespaces so they won't collide
moving functions into classes -- where appropriate
Here are the list of the current duplicate function names grouped into common problem-children.
Site Admin
These files were likely copied from one another -- or a common ancestor.
forum_interface.inc conditionally includes one of forum_interface_phpbb3.inc or forum_interface_json.inc -- the latter is only used during testing. By definition the latter two files define the exact same set of functions. We could punt this by telling phpstan to ignore forum_interface_json.inc.
.php
pages often define their own functions that are used only within the page. Functions are all defined in the same public namespace in PHP and defining a second function name is an error. But because.php
pages are not included in other pages this is not actually a problem.phpstan, however, doesn't know this and has gotten confused by it. As we add more type definitions to the codebase we're likely to run into this more. We can fix this by either:
Here are the list of the current duplicate function names grouped into common problem-children.
Site Admin
These files were likely copied from one another -- or a common ancestor.
Quizzes
My Projects / My Suggestions
my_suggestions.php
was copied frommy_projects.php
Exception handlers
We define two exception handlers, one for test and one for prod, that are different for API vs web and
bootstrap.inc
is common code that sets them up.Forum test abstraction
forum_interface.inc
conditionally includes one offorum_interface_phpbb3.inc
orforum_interface_json.inc
-- the latter is only used during testing. By definition the latter two files define the exact same set of functions. We could punt this by telling phpstan to ignoreforum_interface_json.inc
.Misc
The text was updated successfully, but these errors were encountered: