When namespace is not delimited by a block, the parser mistakes any top-level blocks for the end of the namespace block #21

Open
opened 8 months ago by hugo · 0 comments
hugo commented 8 months ago
Owner
namespace SomeNs;

// WP_List_Table is not loaded automatically so we need to load it in our application
if( ! class_exists( 'WP_List_Table' ) ) {
    require_once( ABSPATH . 'wp-admin/includes/class-wp-list-table.php' );
}

class SomeClass {}

In the example above, SomeClass is not seen as a member of namespace \\SomeNs, but as \\SomeClass

``` namespace SomeNs; // WP_List_Table is not loaded automatically so we need to load it in our application if( ! class_exists( 'WP_List_Table' ) ) { require_once( ABSPATH . 'wp-admin/includes/class-wp-list-table.php' ); } class SomeClass {} ``` In the example above, `SomeClass` is not seen as a member of namespace `\\SomeNs`, but as `\\SomeClass`
Sign in to join this conversation.
No Milestone
No project
No Assignees
1 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: hugo/phpinspect.el#21
Loading…
There is no content yet.