Standard coding drupal

Created on 14 December 2019, almost 5 years ago
Updated 20 August 2024, 3 months ago

I found these errors when I using phpcs standard drupal and drupalpractice

phpcs --standard=Drupal .

FILE: ...v\docroot\modules\social_post_linkedin\src\Plugin\Network\LinkedInPost.php
--------------------------------------------------------------------------------
FOUND 1 ERROR AFFECTING 1 LINES
--------------------------------------------------------------------------------
 120 | ERROR | [x] Data types in @throws tags need to be fully namespaced
--------------------------------------------------------------------------------
PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
--------------------------------------------------------------------------------

Time: 406ms; Memory: 8MB

$ phpcs --standard=DrupalPractice .

FILE: ...e-dev\docroot\modules\social_post_linkedin\src\LinkedInPostAuthManager.php
--------------------------------------------------------------------------------
FOUND 1 ERROR AFFECTING 1 LINE
--------------------------------------------------------------------------------
 17 | ERROR | The $_GET super global must not be accessed directly; inject the
    |       | request.stack service and use
    |       | $stack->getCurrentRequest()->query->get('code') instead
--------------------------------------------------------------------------------

Time: 137ms; Memory: 6MB


šŸ“Œ Task
Status

Needs work

Version

2.0

Component

Code

Created by

šŸ‡®šŸ‡©Indonesia Adev22

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

  • šŸ‡µšŸ‡­Philippines cleavinjosh

    Hi @Adev22,

    I applied patch #3 and I encountered an error:

    āžœ  social_post_linkedin git:(8.x-2.x) curl https://www.drupal.org/files/issues/2020-01-03/Standard_coding_drupal-3101062-3.patch | git apply -v
      % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                     Dload  Upload   Total   Spent    Left  Speed
    100  1307  100  1307    0     0  12223      0 --:--:-- --:--:-- --:--:-- 12330
    <stdin>:17: trailing whitespace, space before tab in indent.
      	$request = \Drupal::request();
    Checking patch src/LinkedInPostAuthManager.php...
    error: src/LinkedInPostAuthManager.php: No such file or directory
    Checking patch src/Plugin/Network/LinkedInPost.php...
    error: while searching for:
       * @return \League\OAuth2\Client\Provider\LinkedIn
       *   The initialized 3rd party library instance.
       *
       * @throws SocialApiException
       *   If the SDK library does not exist.
       */
      protected function initSdk() {
    
    error: patch failed: src/Plugin/Network/LinkedInPost.php:117
    error: src/Plugin/Network/LinkedInPost.php: patch does not apply
    āžœ  social_post_linkedin git:(8.x-2.x)

    Please check and advise.
    Thank you.

Production build 0.71.5 2024