Add visibility to __construct method in example#138
Add visibility to __construct method in example#138jeff-matthews merged 2 commits intoAdobeDocs:mainfrom
Conversation
There was a problem hiding this comment.
Thanks for the contribution @jlnarvaez!
When the scope of a function is not defined, it defaults to public, right? Is there a reason to set the scope to public?
https://www.php.net/manual/en/language.oop5.visibility.php#language.oop5.visiblity-methods
|
Yes, the default is
(https://www.php-fig.org/psr/psr-12/#44-methods-and-functions) |
|
Thanks for clarifying @jlnarvaez. This will need to wait until we update the coding standard in #141. |
|
@jeff-matthews if not merged yet, this is a inherited standard from the current (and deprecated) standard PSR-2: https://www.php-fig.org/psr/psr-2/#43-methods |
|
@jlnarvaez, aha! I see. Thank you for clarifying. I'll go ahead and merge this then. |
Purpose of this pull request
This pull request (PR) add the correct visibility for the example adding a factory in __construct method.
Affected pages