Hi @jonesrussell42
You need to update code according to Drupal coding standards. Below are details when I ran scan.


FILE: C:\Ampps\www\my_coding_review\web\modules\contrib\social_open_graph\social_open_graph.module
--------------------------------------------------------------------------------------------------
FOUND 2 ERRORS AFFECTING 2 LINES
--------------------------------------------------------------------------------------------------
  1 | ERROR | [x] End of line character is invalid; expected "\n" but found "\r\n"
 34 | ERROR | [x] Opening brace should be on the same line as the declaration
--------------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 2 MARKED SNIFF VIOLATIONS AUTOMATICALLY
--------------------------------------------------------------------------------------------------

FILE: C:\Ampps\www\my_coding_review\web\modules\contrib\social_open_graph\src\Entity\UrlOpenGraph.php
-----------------------------------------------------------------------------------------------------
FOUND 6 ERRORS AFFECTING 6 LINES
-----------------------------------------------------------------------------------------------------
 24 | ERROR | [x] There must be exactly one newline after the class comment
 27 | ERROR | [x] Opening brace should be on the same line as the declaration
 28 | ERROR | [x] Expected 1 blank line before function; 0 found
 29 | ERROR | [x] Opening brace should be on the same line as the declaration
 59 | ERROR | [x] Short array syntax must be used to define arrays
 74 | ERROR | [x] Expected 1 blank line after function; 0 found
-----------------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 7 MARKED SNIFF VIOLATIONS AUTOMATICALLY
-----------------------------------------------------------------------------------------------------

FILE: C:\Ampps\www\my_coding_review\web\modules\contrib\social_open_graph\src\Plugin\Filter\SocialOpenGraphUrlEmbedFilter.php
-----------------------------------------------------------------------------------------------------------------------------
FOUND 1 ERRORS AFFECTING 1 LINES
-----------------------------------------------------------------------------------------------------------------------------
 64 | ERROR | [ ] Parameter $renderer is not described in comment
-----------------------------------------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
-----------------------------------------------------------------------------------------------------------------------------


FILE: C:\Ampps\www\my_coding_review\web\modules\contrib\social_open_graph\src\Plugin\rest\resource\OpengraphResource.php
------------------------------------------------------------------------------------------------------------------------
FOUND 1 ERROR AND 1 WARNING AFFECTING 2 LINES
------------------------------------------------------------------------------------------------------------------------
 1 | ERROR   | [x] End of line character is invalid; expected "\n" but found "\r\n"
 7 | WARNING | [x] Unused use statement
------------------------------------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 2 MARKED SNIFF VIOLATIONS AUTOMATICALLY
------------------------------------------------------------------------------------------------------------------------

FILE: C:\Ampps\www\my_coding_review\web\modules\contrib\social_open_graph\src\UrlEmbed.php
---------------------------------------------------------------------------------------------------------------
FOUND 14 ERRORS AND 1 WARNING AFFECTING 14 LINES
---------------------------------------------------------------------------------------------------------------
   1 | ERROR   | [x] End of line character is invalid; expected "\n" but found "\r\n"
   3 | ERROR   | [x] Namespaced classes, interfaces and traits should not begin with a file doc comment
  15 | WARNING | [x] Unused use statement
  22 | ERROR   | [x] Opening brace should be on the same line as the declaration
  33 | ERROR   | [x] Doc comment short description must end with a full stop
  51 | ERROR   | [ ] Parameter $cache_backend is not described in comment
  51 | ERROR   | [ ] Parameter $time is not described in comment
  56 | ERROR   | [ ] Doc comment for parameter $config_factory does not match actual variable name <undefined>
  60 | ERROR   | [x] Opening brace should be on the same line as the declaration
  77 | ERROR   | [x] Opening brace should be on the same line as the declaration
  85 | ERROR   | [x] Opening brace should be on the same line as the declaration
  93 | ERROR   | [x] Opening brace should be on the same line as the declaration
 101 | ERROR   | [x] Opening brace should be on the same line as the declaration
 119 | ERROR   | [x] Expected newline after closing brace
 132 | ERROR   | [x] Expected 1 blank line after function; 0 found
---------------------------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 12 MARKED SNIFF VIOLATIONS AUTOMATICALLY
---------------------------------------------------------------------------------------------------------------


FILE: C:\Ampps\www\my_coding_review\web\modules\contrib\social_open_graph\src\UrlEmbedHelperTrait.php
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
FOUND 6 ERRORS AFFECTING 6 LINES
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
  1 | ERROR | [x] End of line character is invalid; expected "\n" but found "\r\n"
  3 | ERROR | [x] Namespaced classes, interfaces and traits should not begin with a file doc comment
 26 | ERROR | [x] Expected "\Drupal\Core\Extension\ModuleHandlerInterface" but found "\Drupal\Core\Extension\ModuleHandlerInterface." for @var tag in member variable comment
 33 | ERROR | [x] Expected "\Drupal\social_open_graph\UrlEmbed" but found "\Drupal\social_open_graph\UrlEmbed." for @var tag in member variable comment
 87 | ERROR | [x] Expected 1 blank line after function; 0 found
 88 | ERROR | [x] The closing brace for the trait must have an empty line before it
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 6 MARKED SNIFF VIOLATIONS AUTOMATICALLY
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

Time: 292ms; Memory: 10MB
CommentFileSizeAuthor
#3 3276150-3.patch8.58 KBsourabhjain

Comments

LuongGiap created an issue. See original summary.

sourabhjain’s picture

Assigned: Unassigned » sourabhjain
sourabhjain’s picture

Assigned: sourabhjain » Unassigned
Status: Active » Needs work
StatusFileSize
new8.58 KB

Hi

I have fixed the PHPCS issue.
But some issues are left.

FILE: /var/www/html/2021/drupal/modules/contrib/social_open_graph/src/UrlEmbed.php
--------------------------------------------------------------------------------------------------------
FOUND 6 ERRORS AFFECTING 6 LINES
--------------------------------------------------------------------------------------------------------
 39 | ERROR | Missing short description in doc comment
 53 | ERROR | Doc comment for parameter $config_factory does not match actual variable name <undefined>
 69 | ERROR | Missing short description in doc comment
 76 | ERROR | Missing short description in doc comment
 83 | ERROR | Missing short description in doc comment
 90 | ERROR | Missing short description in doc comment
--------------------------------------------------------------------------------------------------------
jonesrussell42’s picture

Hello, thank you both!

I've taken care of the remaining PHPCS issues.

jonesrussell42’s picture

Assigned: Unassigned » jonesrussell42
Status: Needs work » Fixed

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.