Fixed the issues reported by phpcs
Closes #3354883
Merge request reports
Activity
110 110 */ 111 111 public function validateForm(array &$form, FormStateInterface $form_state) { 112 112 if (!$this->collection->access('delete')) { 113 $form_state->setError($form, $this->t('You don\'t have permission to manage this configuration.')); 113 $form_state->setError($form, $this->t("You don\'t have permission to manage this configuration.")); changed this line in version 6 of the diff
83 90 * The parameters collection. 84 91 * @param \Drupal\parameters\Plugin\ParameterInterface|null $parameter 85 92 * The parameter plugin. 93 * @param \Drupal\Core\Session\AccountInterface $current_user 94 * The current user. 86 95 */ 87 public function __construct(EntityTypeManagerInterface $entity_type_manager, MessengerInterface $messenger, RouteMatchInterface $route_match, ?ParametersCollectionInterface $collection = NULL, ?ParameterInterface $parameter = NULL) { 96 public function __construct(EntityTypeManagerInterface $entity_type_manager, MessengerInterface $messenger, RouteMatchInterface $route_match, ?ParametersCollectionInterface $collection = NULL, ?ParameterInterface $parameter = NULL, AccountInterface $current_user) { changed this line in version 6 of the diff
279 289 */ 280 290 public function validateForm(array &$form, FormStateInterface $form_state) { 281 291 if (!$this->collection->access('update')) { 282 $form_state->setError($form, $this->t('You don\'t have permission to manage this configuration.')); 292 $form_state->setError($form, $this->t("You don\'t have permission to manage this configuration.")); changed this line in version 6 of the diff
391 401 foreach ($parameter->getThirdPartyProviders() as $provider) { 392 402 $parameters_array[$parameter_name]['third_party_settings'][$provider] = $parameter->getThirdPartySettings($provider); 393 403 } 394 if (($form_state->getValue(['config', 'parameter_name'], '') !== '') && $form_state->getValue(['config', 'parameter_name']) !== $parameter_name) { 404 if (($form_state->getValue(['config', 'parameter_name',], '') !== '') 405 && $form_state->getValue(['config', 'parameter_name',]) !== $parameter_name) { This line is not correctly indented.
Furthermore, as per Drupal coding standards, control structure conditions may exceed 80 characters, if they are simple to read and understand.
changed this line in version 6 of the diff
14 14 */ 15 15 class ParametersConfigOverrideSubscriber implements EventSubscriberInterface { 16 16 17 /** 18 * {@inheritdoc} 19 */ 17 20 public function onOverrideSave($event) { 14 14 */ 15 15 class ParametersConfigOverrideSubscriber implements EventSubscriberInterface { 16 16 17 /** 18 * {@inheritdoc} 19 */ 17 20 public function onOverrideSave($event) { 18 21 $this->applyChanges($event, 'config_override_save'); 19 22 } 20 23 24 /** 25 * {@inheritdoc} 26 */ 21 27 public function onOverrideDelete($event) { 19 */ 17 20 public function onOverrideSave($event) { 18 21 $this->applyChanges($event, 'config_override_save'); 19 22 } 20 23 24 /** 25 * {@inheritdoc} 26 */ 21 27 public function onOverrideDelete($event) { 22 28 $this->applyChanges($event, 'config_override_delete'); 23 29 } 24 30 31 /** 32 * {@inheritdoc} 33 */ 25 34 protected function applyChanges($event, string $op): void { 125 125 // One exception is made for users that have ID 0 (anonymous) and 126 126 // ID 1 (admin). 127 127 if ($target_is_content) { 128 if ($target_entity_type->id() === 'user' && isset($field_value['target_id']) && in_array($field_value['target_id'], [0, 1])) { 128 if ($target_entity_type->id() === 'user' && isset($field_value['target_id']) && in_array($field_value['target_id'], [ 129 0, 1, 130 ])) { - Comment on lines -128 to +130
As per Drupal coding standards, control structure conditions may exceed 80 characters, if they are simple to read and understand.
changed this line in version 6 of the diff
154 156 unset($values['created'], $values['changed']); 155 157 $entity_keys = $entity_type->getKeys(); 156 158 // Remove IDs and timestamps. 157 foreach (array_intersect_key($entity_keys, array_flip(['id', 'revision', 'created', 'changed'])) as $k_1) { 159 foreach (array_intersect_key($entity_keys, array_flip([ 160 'id', 161 'revision', 162 'created', 163 'changed', 164 ])) as $k_1) { - Comment on lines -157 to +164
As per Drupal coding standards, control structure conditions may exceed 80 characters, if they are simple to read and understand.
changed this line in version 6 of the diff
32 40 */ 33 41 protected ContentEntityNormalizer $decoratedNormalizer; 34 42 43 /** 44 * Constructs a new block form. 45 * 46 * @param \Drupal\Component\Uuid\UuidInterface $uuid 47 * The UUID generator. 48 */ changed this line in version 12 of the diff
558 558 $values['pass'] = [[ 559 559 'value' => $entity->getPassword(), 560 560 'pre_hashed' => TRUE, 561 ]]; 561 ], 562 ]; changed this line in version 6 of the diff
1235 1230 $values['pass'] = [[ 1236 1231 'value' => $entity->getPassword(), 1237 1232 'pre_hashed' => TRUE, 1238 ]]; 1233 ], 1234 ]; changed this line in version 6 of the diff
534 534 } 535 535 if ($selected = $this->configuration['selected']) { 536 536 $num_items = count($selected); 537 [$subset, $num_rest] = $num_items > 4 ? [array_slice($selected, 0, 3), ($num_items - 3)] : [$selected, 0]; 537 [$subset, $num_rest] = $num_items > 4 ? [ 538 array_slice($selected, 0, 3), 539 ($num_items - 3), 540 ] : [$selected, 0]; changed this line in version 6 of the diff
291 292 292 293 if ($data = $this->readCache($use_cache, $uri, $bubbleable_metadata)) { 293 294 if (['___error' => TRUE] === $data) { 294 $this->logger->error(t('The endpoint @url seems to be faulty. Please see previous logged error messages for more information. This error message would disappear on its own, in case the endpoint has recovered.', 295 $this->logger->error($this->t('The endpoint @url seems to be faulty. Please see previous logged error messages for more information. This error message would disappear on its own, in case the endpoint has recovered.', changed this line in version 6 of the diff
312 313 sleep(1); 313 314 self::$lockWait[$lid]++; 314 315 if (self::$lockWait[$lid] > 3) { 315 $this->logger->warning(t('Lock wait exceeded for endpoint @uri. Now trying to fetch data from it. This may cause more traffic than needed.', ['@url' => $uri])); 316 $this->logger->warning($this->t('Lock wait exceeded for endpoint @uri. Now trying to fetch data from it. This may cause more traffic than needed.', ['@url' => $uri])); changed this line in version 6 of the diff
324 325 $response = $this->client->request('GET', $uri); 325 326 } 326 327 catch (GuzzleException $e) { 327 $this->logger->error(t('Failed to fetch data from @url. Exception message: @message', 328 $this->logger->error($this->t('Failed to fetch data from @url. Exception message: @message',