Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[NFC] fix comment blocks capitalising null #14306

Merged
merged 1 commit into from
May 23, 2019

Conversation

eileenmcnaughton
Copy link
Contributor

Overview

Code cleanup to comply with tighter coder standard

Before

@var string|NULL

After

@var string|null

Technical Details

From running the drupal code sniffer with type checking enabled it turns out the capitalisation of NULL
does not extend to docblocks.

See civicrm/coder#7

Comments

@civibot
Copy link

civibot bot commented May 23, 2019

(Standard links)

@civibot civibot bot added the master label May 23, 2019
From running the drupal code sniffer with type checking enabled it turns out the capitalisation of NULL
does not extend to docblocks.

See civicrm/coder#7
@colemanw
Copy link
Member

My personal opinion is that declaring @var string|null is pretty pointless, since null isn't actually a type and it's obviously going to be null until you put a string in it. What you want to know from the docblock is what type it's going to contain after a value is set, and no one really cares about the fact that an unset variable is null.

@eileenmcnaughton
Copy link
Contributor Author

@colemanw possibly - but I'm not going to go through them one by one to check if they could be 'set-ish & still null' just to address a code formatting std

@colemanw
Copy link
Member

My point is that, by definition, a variable is not set if it is null, and all |null type declarations are pointless.

@eileenmcnaughton
Copy link
Contributor Author

I get that - but I'm not keen on including that in this scope

@eileenmcnaughton eileenmcnaughton merged commit 3894d89 into civicrm:master May 23, 2019
@eileenmcnaughton eileenmcnaughton deleted the doc_block branch May 23, 2019 03:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants