Forum Replies Created

Viewing 1 replies (of 1 total)
  • Thread Starter mrgrain

    (@mrgrain)

    Hi Xedin Unknown,

    Thanks for your response. Whereas we raised this issue with Automattic, the developers of Instant Articles for WP plugin, I strongly disagree: It is definitely a bug in this Plugin. And I am happy to explain you why:

    The ComponentFactory::createComponent() method is there to precisely ensure that all components are in fact components [..] and to allow requesting components by a short name

    This is not what happens. The code is trying to include a class with the fully qualified class name “Logger” which happens to be an un-namespaced.

    which is why our class is contained in a namespace, according to the specification of PSR-4.

    Correct, PSR-4 clearly states that “the fully qualified class name MUST have a top-level namespace name, also known as a “vendor namespace”.”

    However, PSR-4 also states

    1. The term “class” refers to classes, interfaces, traits, and other similar structures.

    And that’s where this plugin fails to comply with PSR-4. What you call “allow requesting components by a short name” certainly qualifies as “classes, interfaces, traits, and other similar structures” and thus must have a top-level namespace name.

Viewing 1 replies (of 1 total)