Example:

  /**
   * If banners decorator mode is on, decorates the node content with banners.
   *
   * @param stdClass $node
   *   The node to decorate.
   * @param string $view_mode
   *   The node display mode.
   */
  static public function addBannersDecoratorToNode(stdClass &$node, $view_mode) {

Gives Coder error report:

 Expected "object" but found "stdClass" for parameter type

In fact if you use 'object' as the type hint with PHP5.3 as far as I can tell it crashes:

Recoverable fatal error: Argument 1 passed to Drupal\flagplus\banner\BannerHelper::addBannersDecoratorToNode() must be an instance of Drupal\flagplus\banner\object, instance of stdClass given

Comments

webel’s picture

webel’s picture

Issue summary: View changes
klausi’s picture

Status: Active » Closed (works as designed)

That error is flagged against the @param doc type, which should be "object" instead of stdClass. See https://www.drupal.org/coding-standards/docs#types , so Coder is just following our standard here.

klausi’s picture

Status: Closed (works as designed) » Fixed

Ah, so there was still a false positive if you use "object" in the docs and "stdClass" for the actual type hint, which should be allowed. Committed a fix for that.

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.