- Issue created by @sonam_sharma
- ๐ฎ๐ณIndia Raveen Kumar
Raveen Thakur โ made their first commit to this issueโs fork.
- Open on Drupal.org โCore: 9.5.5 + Environment: PHP 7.4 & MySQL 5.7last update
over 1 year ago Waiting for branch to pass - @raveen-thakur opened merge request.
- Issue was unassigned.
- Status changed to Needs work
over 1 year ago 8:53am 3 July 2023 - ๐ฎ๐นItaly apaderno Brescia, ๐ฎ๐น
The issue summary should always describe what should be fixed/changed. Neither the title nor screenshots are sufficient to describe what the issue is, even in the case a patch is provided.
In the case of a bug, the description should also list the steps necessary to reproduce the issue, starting from when the module/theme is installed.Also, since that would be reported by PHP_CodeSniffer, why is not this issue about fixing the warnings/errors reported by PHP_CodeSniffer?
- Assigned to imustakim
- ๐ฎ๐ณIndia imustakim Ahmedabad
Patch re-rolled with updated changes, only these errors are remaining now.
FILE: /Users/specbee/Sites/Projects/analytics/analytics.module ---------------------------------------------------------------------- FOUND 1 ERROR AFFECTING 1 LINE ---------------------------------------------------------------------- 3 | ERROR | Missing short description in doc comment ---------------------------------------------------------------------- FILE: /Users/specbee/Sites/Projects/analytics/analytics_piwik/src/Plugin/AnalyticsService/Piwik.php --------------------------------------------------------------------------------------------------- FOUND 1 ERROR AND 1 WARNING AFFECTING 2 LINES --------------------------------------------------------------------------------------------------- 52 | ERROR | Doc comment is empty 66 | WARNING | Unused variable $request. --------------------------------------------------------------------------------------------------- FILE: /Users/specbee/Sites/Projects/analytics/src/Form/AnalyticsServiceForm.php ------------------------------------------------------------------------------- FOUND 2 ERRORS AFFECTING 2 LINES ------------------------------------------------------------------------------- 13 | ERROR | Doc comment is empty 137 | ERROR | Doc comment is empty ------------------------------------------------------------------------------- FILE: /Users/specbee/Sites/Projects/analytics/src/Entity/AnalyticsService.php ----------------------------------------------------------------------------- FOUND 1 ERROR AFFECTING 1 LINE ----------------------------------------------------------------------------- 168 | ERROR | Description for the @return value is missing ----------------------------------------------------------------------------- FILE: /Users/specbee/Sites/Projects/analytics/src/Plugin/ServiceDataTrait.php ----------------------------------------------------------------------------- FOUND 5 ERRORS AFFECTING 5 LINES ----------------------------------------------------------------------------- 5 | ERROR | Doc comment is empty 10 | ERROR | Missing short description in doc comment 11 | ERROR | Description for the @return value is missing 15 | ERROR | Missing short description in doc comment 16 | ERROR | Description for the @return value is missing ----------------------------------------------------------------------------- FILE: /Users/specbee/Sites/Projects/analytics/src/Plugin/ServicePluginCollection.php ------------------------------------------------------------------------------------ FOUND 2 ERRORS AND 1 WARNING AFFECTING 3 LINES ------------------------------------------------------------------------------------ 8 | ERROR | Doc comment is empty 40 | ERROR | Description for the @return value is missing 42 | WARNING | Possible useless method overriding detected ------------------------------------------------------------------------------------ FILE: /Users/specbee/Sites/Projects/analytics/src/Render/AnalyticsJsMarkup.php ------------------------------------------------------------------------------ FOUND 1 ERROR AFFECTING 1 LINE ------------------------------------------------------------------------------ 25 | ERROR | Missing short description in doc comment ------------------------------------------------------------------------------ Time: 340ms; Memory: 10MB
- Issue was unassigned.
- Status changed to Needs review
about 1 year ago 6:13pm 31 August 2023 - Open on Drupal.org โCore: 9.5.5 + Environment: PHP 7.4 & MySQL 5.7last update
about 1 year ago Waiting for branch to pass - ๐ฎ๐ณIndia Bhupesh_upadhyay
I have fixed most of the issue mentioned above
kindly review. - Status changed to Needs work
about 1 year ago 9:54am 2 September 2023 - ๐ฎ๐นItaly apaderno Brescia, ๐ฎ๐น
+/** + * @file + * Contains implementation of analytics functionality for Drupal. + */ +
A .module description is
Hook implementations for the [module name] module
. where[module name]
is the module name given in the .info.yml file.+ /** + * Validates the config URL. + * + * @param array $element + * elements form URL. + * @param \Drupal\Core\Form\FormStateInterface $form_state + * Drupal\Core\Form\FormStateInterface. + */ protected function elementValidateConfigUrl(array &$element, FormStateInterface $form_state) { $value = $element['#value']; if ($value == '') { @@ -87,6 +95,14 @@ class AmpAnalytics extends ServicePluginBase { } } + /** + * Validates the config JSON. + * + * @param array $element + * elements form Json. + * @param \Drupal\Core\Form\FormStateInterface $form_state + * Drupal\Core\Form\FormStateInterface. + */ protected function elementValidateConfigJson(array &$element, FormStateInterface $form_state)
For form validation and submission handlers, only the short description is given, and that is
Form validation handler for [form ID].
orForm submission handler for [form ID].
* @return \Drupal\analytics\AnalyticsServiceManager + * analytics service.
A definite article is missing in that description.
/** - * Analytics ConfigSubscriber. + * Analytics Config Subscriber class. */
That description is still merely repeating the class name, like the existing documentation comment.
+/** + * Analytics Form. + */ class AnalyticsServiceForm extends EntityForm {
That does not describe the class purpose. Form is also misspelled, since it is not the first word in the description, it is not an acronym, or a proper noun.
+/** + * Service Data. + */
That description is not sufficient.
/** - * @return array + * Default Data. */ abstract public function defaultData();
That description does not say much about what that method does.
Removing the@return
line is also not correct, since parameters and return value must be described too.+ /** + * The has multiple check. + * + * @var bool + * Returns true if there are are multiple config entity.
The description does not make sense.
true
, as PHP value, is misspelled.
are is repeated.
there are needs a plural direct object, but config entity is singular.+/** + * Analytics Service Plugin collection. + */
Service and Plugin are misspelled, since they are not the first word.
* @return \Drupal\analytics\Plugin\ServicePluginInterface + * service Instance id
Instance and id are misspelled.
Since it returns a\Drupal\analytics\Plugin\ServicePluginInterface
instance, the return value cannot be an ID./** + * Do not track protection static variable. + * * @var bool */ - static $isDntEnforced; + protected static $isDntEnforced;
That is not the description for that property.
There is not need to say that a property is a variable. None of the property used in Drupal core classes is described as variable.* @return bool + * True if Do Not Track protection is enabled.
As PHP value,
True
is misspelled. - First commit to issue fork.