-
Notifications
You must be signed in to change notification settings - Fork 153
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
Member variables and methods should not require DocBlock when properly typed #476
base: develop
Are you sure you want to change the base?
Commits on Aug 16, 2023
-
Member variables and methods should not require DocBlock when properl…
…y typed https://developer.adobe.com/commerce/php/coding-standards/docblock/ > Include all necessary information without duplication. Example 1: ``` private ?ObjectManagerInterface $objectManager; ``` should not require a comment ``` /** @var ObjectManagerInterface|null $objectManager */ ``` because all of that information is duplicated. (Though the nullable is actually harder to read in DocBlock standard.) Example 2: ``` public function getWeakMap() : WeakMap { return $this->weakMap; } ``` This method is expressive. It is obvious what it does. It is strictly typed. There is no reason that it should need a DocBlock. This change no longer requires DocBlock in these cases: 1: member variables that have defined types 2: methods where all parameters have defined types AND method has defined return type (__construct and __destruct won't require return type, since it isn't allowed)
Configuration menu - View commit details
-
Copy full SHA for ee3ddb3 - Browse repository at this point
Copy the full SHA ee3ddb3View commit details
Commits on Oct 4, 2023
-
API class/interfaces should still require DocBlocks for methods
Adding in code to check the namespace of the class/interfaces to see if it is API. Magento's API code requires method Doc Blocks because it doesn't use Reflection for types. https://developer.adobe.com/commerce/php/development/components/web-api/services/
Configuration menu - View commit details
-
Copy full SHA for 83c8668 - Browse repository at this point
Copy the full SHA 83c8668View commit details -
Configuration menu - View commit details
-
Copy full SHA for b442f9a - Browse repository at this point
Copy the full SHA b442f9aView commit details
Commits on Dec 18, 2023
-
API class/interfaces should still require DocBlocks for methods
* Updated unit tests to cover new functionality reguarding when we can safely skip requiring DockBlocks * Fix MethodArgumentsSniff to work on PHP files without namespaces
Configuration menu - View commit details
-
Copy full SHA for 38f565c - Browse repository at this point
Copy the full SHA 38f565cView commit details -
Configuration menu - View commit details
-
Copy full SHA for 59b5d46 - Browse repository at this point
Copy the full SHA 59b5d46View commit details
Commits on Dec 22, 2023
-
Configuration menu - View commit details
-
Copy full SHA for 17e120f - Browse repository at this point
Copy the full SHA 17e120fView commit details
Commits on Oct 17, 2024
-
Merge branch 'develop' of https://github.com/magento/magento-coding-s…
…tandard into parameters-defined-needs-no-docblock-except-complex
Configuration menu - View commit details
-
Copy full SHA for b5c1496 - Browse repository at this point
Copy the full SHA b5c1496View commit details