- Issue created by @akshaydalvi212
- Issue was unassigned.
- Status changed to Needs review
over 1 year ago 3:00pm 21 March 2023 - 🇮🇳India akshaydalvi212
Fixed all the issues reported by PHPCS.
kindly review. - Status changed to Needs work
over 1 year ago 4:09pm 21 March 2023 - 🇮🇹Italy apaderno Brescia, 🇮🇹
- public function __construct(StreamWrapperManagerInterface $streamWrapperManager, LinkCrypter $link_crypter) { + public function __construct(StreamWrapperManagerInterface $streamWrapperManager, LinkCrypter $linkCrypter) {
It is not necessary to change the parameter name, since
$link_crypter
is still correct, as local variable name. Drupal coding standards say that class properties should not use snake case names, but local variables are still allowed to use that name style.+ /** + * Constructs for CryptSettingsForm. + * + * @param \Drupal\Core\Config\ConfigFactoryInterface $config_factory + * The config_factory service. + * @param \Drupal\Core\File\FileSystemInterface $fileSystem + * The fileSystem service. + * @param \Drupal\encrypted_link_formatter\LinkCrypter $linkCrypter + * LinkCrypter service. + * @param \Drupal\Core\Cache\CacheTagsInvalidatorInterface $cacheTagsInvalidator + * The cacheTagsInvalidator service. + */ + public function __construct(ConfigFactoryInterface $config_factory, FileSystemInterface $fileSystem, LinkCrypter $linkCrypter, CacheTagsInvalidatorInterface $cacheTagsInvalidator) {
Grammatically, construct needs a direct object; constructs for is wrong.
The class name does not have its namespace.+ /** + * A helping function which generates invalidate tags. + */ + protected function generateIv($type): bool { + $private_dir = $this->fileSystem->realpath('private://'); + if (!$this->linkCrypter->ensureDirExists("$private_dir/iv")) { return FALSE; }
The short description should start with a verb.
+ /** + * A helper function for checking field defination. + */ public static function isApplicable(FieldDefinitionInterface $field_definition) { $uri_scheme = $field_definition->getItemDefinition()->getSetting('uri_scheme'); if ($uri_scheme === 'private') { return TRUE; } - return FALSE; }
defination is a typo.
The short description does not make clear what the method does.
The parameter description is missing, as well as the return value description. - First commit to issue fork.
- Assigned to sagarTiwari
- Issue was unassigned.
- Status changed to Needs review
over 1 year ago 7:26am 22 March 2023 - 🇮🇳India sagarTiwari
Intradiff file for phpcs issues and suggestions on comment #4.
- Status changed to Needs work
over 1 year ago 4:06pm 22 March 2023 - 🇮🇹Italy apaderno Brescia, 🇮🇹
- * The stream wrapper manager. + * The streamWrapper manager. + * @param \Drupal\encrypted_link_formatter\LinkCrypter $link_crypter + * The linkCrypter service.
Both the descriptions are wrong, since they merge into a word what are two words.
- $this->moduleHandler()->invokeAll('alter_file_uri', [&$uri, $queryParams, &$headers, $scheme]); + $this->moduleHandler()->invokeAll('alter_file_uri', [&$uri, $queryParams, + &$headers, $scheme, + ] + );
The last two lines are wrongly indented.
+ /** + * The Crypt settings form constructor. + * + * @param \Drupal\Core\Config\ConfigFactoryInterface $config_factory + * The config_factory service. + * @param \Drupal\Core\File\FileSystemInterface $fileSystem + * The fileSystem service. + * @param \Drupal\encrypted_link_formatter\LinkCrypter $linkCrypter + * LinkCrypter service. + * @param \Drupal\Core\Cache\CacheTagsInvalidatorInterface $cacheTagsInvalidator + * The cacheTagsInvalidator service.
The description for a method starts with a verb.
+ public function __construct(ConfigFactoryInterface $config_factory, FileSystemInterface $fileSystem, LinkCrypter $linkCrypter, CacheTagsInvalidatorInterface $cacheTagsInvalidator) { parent::__construct($config_factory); - $this->file_system = $file_system; - $this->link_crypter = $link_crypter; - $this->cache_tags_invalidator = $cache_tags_invalidator; + $this->fileSystem = $fileSystem; + $this->linkCrypter = $linkCrypter; + $this->cacheTagsInvalidator = $cacheTagsInvalidator;
There is no need to change the scheme used for the local variables. Snake case is allowed for them.
+ /** + * Helping function which generates invalidate tags. + */
It should be helper function, but Helping function which is not necessary. A method description starts with a verb.
The description of parameters and return value is still missing./** * Constructs an Example object. * * @param \Drupal\Core\Config\ConfigFactoryInterface $config_factory * The config factory. + * @param \Drupal\Core\File\FileSystemInterface $fileSystem + * The fileSystem service. */
Since that comment is changed, the class name should also include its namespace.
+ /** + * A helper function to ensure Directory Exists. + */
Directory and Exists are not at the beginning of a sentence. In English, those words are not written in capital case.
The description is still wrong.+ * @param \Drupal\Core\Routing\RouteMatchInterface $routeMatch + * RouteMatch service. + * @param \Drupal\encrypted_link_formatter\LinkCrypter $link_crypter + * LinkCrypter service. */
There are missing articles and words merged in a single word.
- Assigned to dcimorra
- Issue was unassigned.
- 🇮🇳India zkhan.aamir
Changing to unassigned since there is no update for a while
- First commit to issue fork.
- Assigned to nitin_lama
- Issue was unassigned.
- Status changed to Fixed
7 months ago 11:47am 7 May 2024 Automatically closed - issue fixed for 2 weeks with no activity.