7 kyu
Object-Oriented PHP #3 - Class Constants and Static Methods
1,161donaldsebleung
Loading description...
Fundamentals
Tutorials
Object-oriented Programming
View
This comment has been reported as {{ abuseKindText }}.
Show
This comment has been hidden. You can view it now .
This comment can not be viewed.
- |
- Reply
- Edit
- View Solution
- Expand 1 Reply Expand {{ comments?.length }} replies
- Collapse
- Spoiler
- Remove
- Remove comment & replies
- Report
{{ fetchSolutionsError }}
-
-
Your rendered github-flavored markdown will appear here.
-
Label this discussion...
-
No Label
Keep the comment unlabeled if none of the below applies.
-
Issue
Use the issue label when reporting problems with the kata.
Be sure to explain the problem clearly and include the steps to reproduce. -
Suggestion
Use the suggestion label if you have feedback on how this kata can be improved.
-
Question
Use the question label if you have questions and/or need help solving the kata.
Don't forget to mention the language you're using, and mark as having spoiler if you include your solution.
-
No Label
- Cancel
Commenting is not allowed on this discussion
You cannot view this solution
There is no solution to show
Please sign in or sign up to leave a comment.
PSR-1 tell us: «Class constants MUST be declared in all upper case with underscore separators» http://www.php-fig.org/psr/psr-1/
I think it is better to use recommend syntax in your lessons.
Thanks for the article, interesting read :) I wasn't aware of this naming convention back when I authored this Kata but I will be sure to keep this in mind when authoring future PHP Kata :D
It might be good to mention that $this becomes "self::".
By convention, class constants are usually written in uppercase. One test for this kata failed when I used "const NAME" instead of "const name", which I don't think it should. Both should be allowed, and it's up to the author whether the case convention is mentioned or not.
Happy to deal with some basic PHP kata ! 多谢 || Thanks a lot ! ;)