I ran into some issues using PhpStorm to review Drupal code today and I was able to track it down to improperly commented code found in Drupal. In every code block where we refer to an object we need to start the PSR-0 syntax with at "\".

Files: 
CommentFileSizeAuthor
#1 2100329-1.patch190.01 KBcosmicdreams
PASSED: [[SimpleTest]]: [MySQL] 58,927 pass(es). View

Comments

cosmicdreams’s picture

Status: Active » Needs review
FileSize
190.01 KB
PASSED: [[SimpleTest]]: [MySQL] 58,927 pass(es). View

Here's a patch that shows what I'm saying

Les Lim’s picture

tim.plunkett’s picture

Status: Needs review » Reviewed & tested by the community

a) This is correct
b) We just did #2053489: Standardize on \Drupal throughout core

RTBC if green.

cosmicdreams’s picture

Status: Reviewed & tested by the community » Needs work

Need to convert params, new patch coming soon.

cosmicdreams’s picture

Status: Needs work » Reviewed & tested by the community

nope I got the params, nevermind.

dawehner’s picture

+1

slashrsm’s picture

+1

dawehner’s picture

Title: Use \Drupal instead of Drupal to make PhpStorm happy » Use \Drupal instead of Drupal to make IDEs and static code analyse tools happy

.

mtift’s picture

+1

andypost’s picture

this need avoid commit conflicts tag
Also there could be a new hunks introduced with latest commits

cosmicdreams’s picture

Issue tags: +Avoid commit conflicts

Let's see if this needs a reroll

cosmicdreams’s picture

#1: 2100329-1.patch queued for re-testing.

andypost’s picture

@cosmicdreams is there a pattern to quickly grep for? to make sure all places are fixed

cosmicdreams’s picture

Yea, the patterns are :
replace all "@return Drupal\" with @return \Drupal\
replace all "@see Drupal\" with @see \Drupal\
replace all "@param Drupal\" with @param \Drupal\

Les Lim’s picture

Also these:
replace all "@var Drupal\" with @var \Drupal\
replace all "@throws Drupal\" with @throws \Drupal\

alexpott’s picture

Status: Reviewed & tested by the community » Fixed

Getting this in whilst it still applies - we can pick up any stragglers in a followup.

Committed 3cee107 and pushed to 8.x. Thanks!

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