Fix coding standard related errors

Created on 12 May 2016, over 8 years ago
Updated 8 August 2023, over 1 year ago

Running phpcs --standard=Drupal,DrupalPractice --extensions=php,module,inc,install,test,profile,theme,css,info,txt,md,yml,twig shows these warnings/errors.

FILE: ./prefetch_cache_8.x-1.x/config/install/prefetch_cache.settings.yml
 1 | ERROR | [x] Expected 1 newline at end of file; 0 found

FILE: ./prefetch_cache_8.x-1.x/CHANGELOG.txt
 17 | ERROR | [x] Expected 1 newline at end of file; 0 found

FILE: ./prefetch_cache_8.x-1.x/src/RequestPolicy/GetRequest.php
  3 | ERROR | [x] Namespaced classes, interfaces and traits should not begin with a file doc comment
 16 | ERROR | [x] Additional blank lines found at end of doc comment
 27 | ERROR | [x] Expected 1 blank line after function; 0 found
 28 | ERROR | [x] The closing brace for the class must have an empty line before it

FILE: ./prefetch_cache_8.x-1.x/src/RequestPolicy/NoSessionUser.php
  3 | ERROR | [x] Namespaced classes, interfaces and traits should not begin with a file doc comment
 16 | ERROR | [x] Additional blank lines found at end of doc comment
 27 | ERROR | [x] Expected 1 blank line after function; 0 found
 28 | ERROR | [x] The closing brace for the class must have an empty line before it

FILE: ./prefetch_cache_8.x-1.x/src/Cache/ChainCacheTagsGeneratorInterface.php
  3 | ERROR | [x] Namespaced classes, interfaces and traits should not begin with a file doc comment
 15 | ERROR | [x] Additional blank lines found at end of doc comment
 21 | ERROR | [ ] Missing parameter comment
 31 | ERROR | [x] Expected "\Drupal\prefetch_cache\Cache\CacheTagsGeneratorInterfacephp" but found
    |       |     "\Drupal\prefetch_cache\Cache\CacheTagsGeneratorInterface.php" for parameter type
 37 | ERROR | [x] Expected 1 newline at end of file; 0 found
 37 | ERROR | [x] The closing brace for the interface must have an empty line before it

FILE: ./prefetch_cache_8.x-1.x/src/Cache/CacheTagsGeneratorInterface.php
  3 | ERROR | [x] Namespaced classes, interfaces and traits should not begin with a file doc comment
 15 | ERROR | [x] Additional blank lines found at end of doc comment

FILE: ./prefetch_cache_8.x-1.x/src/Cache/ChainCacheTagsGenerator.php
  3 | ERROR | [x] Namespaced classes, interfaces and traits should not begin with a file doc comment
 16 | ERROR | [x] Additional blank lines found at end of doc comment
 27 | ERROR | [x] @inheritdoc found. Did you mean {@inheritdoc}?
 43 | ERROR | [x] @inheritdoc found. Did you mean {@inheritdoc}?

FILE: ./prefetch_cache_8.x-1.x/src/StackMiddleware/PrefetchCacheBeforePageCache.php
   3 | ERROR   | [x] Namespaced classes, interfaces and traits should not begin with a file doc comment
  25 | ERROR   | [x] Additional blank lines found at end of doc comment
  31 | ERROR   | [x] Expected "\Drupal\prefetch_cache\Cache\ChainCacheTagsGeneratorInterface" but found
     |         |     "\Drupal\prefetch_cache\Cache\ChainCacheTagsGeneratorInterface." for @var tag in member variable comment
  81 | WARNING | [x] There must be no blank line following an inline comment
  81 | WARNING | [ ] There must be no blank line following an inline comment
 125 | ERROR   | [x] Expected 1 space before opening brace; found 2
 139 | WARNING | [ ] \Drupal calls should be avoided in classes, use dependency injection instead
 145 | ERROR   | [ ] Missing parameter comment
 145 | ERROR   | [ ] Missing parameter type
 146 | ERROR   | [ ] Missing parameter comment
 146 | ERROR   | [ ] Missing parameter type
 147 | ERROR   | [x] Separate the @param and @return sections by a blank line.
 147 | ERROR   | [ ] Description for the @return value is missing
 160 | ERROR   | [ ] Missing parameter comment
 161 | ERROR   | [ ] Missing parameter comment
 161 | ERROR   | [ ] Missing parameter type
 162 | ERROR   | [ ] Missing parameter comment
 162 | ERROR   | [ ] Missing parameter type
 176 | ERROR   | [x] Expected 1 blank line after function; 0 found
 177 | ERROR   | [x] The closing brace for the class must have an empty line before it

FILE: ./prefetch_cache_8.x-1.x/src/StackMiddleware/PrefetchCacheAfterSessionInitialized.php
  3 | ERROR | [x] Namespaced classes, interfaces and traits should not begin with a file doc comment
 21 | ERROR | [x] Additional blank lines found at end of doc comment
 24 | ERROR | [x] Missing function doc comment
 70 | ERROR | [x] Expected 1 space before opening brace; found 2

FILE: ./prefetch_cache_8.x-1.x/src/PrefetchCacheInterface.php
  3 | ERROR | [x] Namespaced classes, interfaces and traits should not begin with a file doc comment
 18 | ERROR | [x] Additional blank lines found at end of doc comment
 40 | ERROR | [x] Expected 1 newline at end of file; 0 found
 40 | ERROR | [x] The closing brace for the interface must have an empty line before it

FILE: ./prefetch_cache_8.x-1.x/src/ResponsePolicy/CacheOnlyPrefetchCacheRequests.php
 3 | ERROR | [x] Namespaced classes, interfaces and traits should not begin with a file doc comment

FILE: ./prefetch_cache_8.x-1.x/prefetch_cache.module
 1 | ERROR | [x] Missing file doc comment
 8 | ERROR | [x] Expected 1 newline at end of file; 0 found

FILE: ./prefetch_cache_8.x-1.x/prefetch_cache.libraries.yml
 8 | ERROR | [x] Expected 1 newline at end of file; 0 found

FILE: ./prefetch_cache_8.x-1.x/README.md
 1 | WARNING | Line exceeds 80 characters; contains 127 characters
 3 | WARNING | Line exceeds 80 characters; contains 86 characters
 4 | WARNING | Line exceeds 80 characters; contains 239 characters

Those warnings/errors must be fixed, when possible.

📌 Task
Status

Needs review

Version

1.0

Component

Code

Created by

🇺🇸United States anoopjohn Washington D. C.

Live updates comments and jobs are added and updated live.
  • Coding standards

    It involves compliance with, or the content of coding standards. Requires broad community agreement.

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.

Production build 0.71.5 2024