- Issue created by @dineshkumarbollu
- 🇮🇳India dineshkumarbollu
Hi
I fixed the all phpcs issues including DI except (\Drupal::moduleHandler()->moduleExists('content_moderation')) this type of DIPlease review.
Thanks
- Issue was unassigned.
- Status changed to Needs review
over 1 year ago 4:44am 9 May 2023 - Status changed to Needs work
over 1 year ago 5:13am 9 May 2023 - 🇮🇳India Anmol_Specbee
The patch does not apply cleanly and not all the issues reported by phpcs are fixed. Attaching a screenshot for reference.
- Assigned to akshaydalvi212
- 🇮🇳India akshaydalvi212
I will work on this issue and raise the MR for the same.
- @akshaydalvi212 opened merge request.
- Issue was unassigned.
- Status changed to Needs review
over 1 year ago 8:49am 9 May 2023 - 🇮🇳India akshaydalvi212
Raised the MR which removes all the reported errors.
only warning as unused variables $field_storage_type and $delta is remaining which need to be confirmed from module maintainers.
kindly review the MR. - Status changed to Needs work
over 1 year ago 10:07pm 9 May 2023 - Assigned to akshaydalvi212
- 🇮🇳India akshaydalvi212
I will update the MR as per comments added on the MR.
- Issue was unassigned.
- Status changed to Needs review
over 1 year ago 8:06am 10 May 2023 - 🇮🇳India akshaydalvi212
Updated the MR as per suggested.
kindly review the MR. - Status changed to Needs work
over 1 year ago 8:59am 10 May 2023 - 🇮🇹Italy apaderno Brescia, 🇮🇹
--- a/paragraph_blocks.install +++ b/paragraph_blocks.install @@ -1,5 +1,10 @@ <?php +/** + * @file + * Contains install, update functions to DB. + */ +
The correct description is Install, update, and uninstall hooks for the Paragraph blocks module.
* @return bool + * Returns length of admin title. */ public function hasAdminTitle(): bool {
Since the return value is a Boolean, it cannot be the title length. The method name should give a hint on what that method returns.
/** - * Class ParagraphBlocksEntityManager. + * Defines ParagraphBlocksEntityManager class. */
Even with Defines, that description merely repeats the class name. It must describe the class purpose.
* @param \Drupal\Core\Entity\ContentEntityInterface $entity + * ContentEntityInterface service.
That is not a service, so it cannot be described as such.
* @return \Drupal\Core\Entity\ContentEntityInterface + * Returns ContentEntityInterface service. * * @throws \Drupal\Component\Plugin\Exception\InvalidPluginDefinitionException * @throws \Drupal\Component\Plugin\Exception\PluginNotFoundException */ public function getLatestEntityRevision(ContentEntityInterface &$entity): ContentEntityInterface {
The method does not return a service. (See the method name for a possible hint of what the method returns.)
- $moderation_info = \Drupal::service('content_moderation.moderation_information'); + // \Drupal::service('content_moderation.moderation_information'); + $moderation_info = $this->moderationInformation;
It is not necessary to comment out the previously used code.
+ /** + * The Drupal Logger Factory. + * + * @var \Drupal\Core\Logger\LoggerChannelFactoryInterface + */ + protected $loggerFactory; +
There is no need to add Drupal in descriptions.
In that description, only the first word must be capitalized.- * @var + * @var layout */ private $layout;
layout is not a PHP type and it cannot be used with
@var
.* @return array + * Return fields. */
The return value description must not start with Return.
- * @param $field + * @param mixed $field + * Provide field.
Parameter descriptions must not start with Provide.
* @return array + * Returns deltas fields before save. */ private function getDeltasOriginal($field): array {
That description is not clear and probably not correct.
* @param mixed $field + * List of Fields.
Given the parameter name, that is probably not a list of fields.
* @param array $new_paragraph_ids + * Paragraph ids.
The correct spelling for ids is IDs.
* @param string $field + * Field string. * @param array $configuration + * Configuration array.
Those descriptions are each missing a definite article.
* @param int|string $section_index + * Section_index. * @param int|string $component_index - * - * @return void + * Component_index.
Those descriptions are merely repeating the parameter name.
+ * @param \Drupal\Core\Extension\ModuleHandlerInterface $module_handler + * The module handler service. */
There is no need to say that is a service.
- Assigned to imustakim
- Issue was unassigned.
- Status changed to Needs review
over 1 year ago 11:36am 10 May 2023 - 🇮🇳India imustakim Ahmedabad
All the warnings and errors are resolved except these 2 warnings, It is caused by including the class namespace in constructor description, hence assuming this can be ignored.
Updated patch is attached.
Please review.❯ phpcs --standard="Drupal,DrupalPractice" --extensions=php,module,inc,install,test,profile,theme,info,txt,md,yml . FILE: /Users/specbee/Sites/Projects/paragraph_blocks/src/ParagraphBlocksEntityPresaveHelper.php ----------------------------------------------------------------------------------------------- FOUND 0 ERRORS AND 1 WARNING AFFECTING 1 LINE ----------------------------------------------------------------------------------------------- 51 | WARNING | Line exceeds 80 characters; contains 85 characters ----------------------------------------------------------------------------------------------- FILE: /Users/specbee/Sites/Projects/paragraph_blocks/src/ParagraphBlocksEntityManager.php ----------------------------------------------------------------------------------------- FOUND 0 ERRORS AND 1 WARNING AFFECTING 1 LINE ----------------------------------------------------------------------------------------- 55 | WARNING | Line exceeds 80 characters; contains 83 characters ----------------------------------------------------------------------------------------- Time: 351ms; Memory: 12MB
- 🇳🇱Netherlands basvredeling Amsterdam
#15 was a big improvement but also contained a couple of nasty typos. Here's an updated patch. Could you please review?
-
basvredeling →
committed 3d0e4025 on 3.x
Issue #3358995 by akshaydalvi212, basvredeling, dineshkumarbollu,...
-
basvredeling →
committed 3d0e4025 on 3.x
- Status changed to Fixed
over 1 year ago 9:03am 12 May 2023 - 🇳🇱Netherlands basvredeling Amsterdam
Made some extra changes to the services after #18.
Thanks for your efforts all. - Status changed to Fixed
over 1 year ago 1:23pm 22 May 2023