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
| Comment | File | Size | Author |
|---|---|---|---|
| #3 | 3276150-3.patch | 8.58 KB | sourabhjain |
Comments
Comment #2
sourabhjainComment #3
sourabhjainHi
I have fixed the PHPCS issue.
But some issues are left.
Comment #4
jonesrussell42 commentedHello, thank you both!
I've taken care of the remaining PHPCS issues.
Comment #5
jonesrussell42 commented