Commit f6ae5852 authored by catch's avatar catch
Browse files

Issue #2572801 by alexpott, vprocessor, andriyun, andypost, chishah92, Mile23,...

Issue #2572801 by alexpott, vprocessor, andriyun, andypost, chishah92, Mile23, attiks, hussainweb, klausi, dawehner, pfrenssen: Fix 'Drupal.WhiteSpace.ScopeIndent' coding standard
parent b6a64fc0
......@@ -707,7 +707,7 @@ function update_language_list($flags = LanguageInterface::STATE_CONFIGURABLE) {
// Initialize master language list.
if (!isset($languages)) {
// Initialize local language list cache.
$languages = array();
$languages = array();
// Fill in master language list based on current configuration.
$default = \Drupal::languageManager()->getDefaultLanguage();
......
......@@ -81,9 +81,9 @@ public static function sortByTitleElement($a, $b) {
* @return int
* The comparison result for uasort().
*/
public static function sortByTitleProperty($a, $b) {
return static::sortByKeyString($a, $b, '#title');
}
public static function sortByTitleProperty($a, $b) {
return static::sortByKeyString($a, $b, '#title');
}
/**
* Sorts a string array item by an arbitrary key.
......
......@@ -66,8 +66,8 @@ public function get(EntityTypeInterface $entity_type, $conjunction) {
/**
* {@inheritdoc}
*/
public function getAggregate(EntityTypeInterface $entity_type, $conjunction) {
throw new QueryException('Aggregation over configuration entities is not supported');
public function getAggregate(EntityTypeInterface $entity_type, $conjunction) {
throw new QueryException('Aggregation over configuration entities is not supported');
}
/**
......
......@@ -65,7 +65,7 @@ protected function connect() {
$this->pass('Drupal can CONNECT to the database ok.');
}
catch (\Exception $e) {
// Attempt to create the database if it is not found.
// Attempt to create the database if it is not found.
if ($e->getCode() == Connection::DATABASE_NOT_FOUND) {
// Remove the database string from connection info.
$connection_info = Database::getConnectionInfo();
......
......@@ -90,7 +90,7 @@ public function rowCount();
* If $mode is PDO::FETCH_CLASS, the optional arguments to pass to the
* constructor.
*/
public function setFetchMode($mode, $a1 = NULL, $a2 = array());
public function setFetchMode($mode, $a1 = NULL, $a2 = array());
/**
* Fetches the next row from a result set.
......@@ -109,7 +109,7 @@ public function setFetchMode($mode, $a1 = NULL, $a2 = array());
* @return
* A result, formatted according to $mode.
*/
public function fetch($mode = NULL, $cursor_orientation = NULL, $cursor_offset = NULL);
public function fetch($mode = NULL, $cursor_orientation = NULL, $cursor_offset = NULL);
/**
* Returns a single field from the next record of a result set.
......@@ -128,7 +128,7 @@ public function fetchField($index = 0);
* The object will be of the class specified by StatementInterface::setFetchMode()
* or stdClass if not specified.
*/
public function fetchObject();
public function fetchObject();
/**
* Fetches the next row and returns it as an associative array.
......@@ -155,7 +155,7 @@ public function fetchAssoc();
* @return
* An array of results.
*/
function fetchAll($mode = NULL, $column_index = NULL, $constructor_arguments = NULL);
function fetchAll($mode = NULL, $column_index = NULL, $constructor_arguments = NULL);
/**
* Returns an entire single column of a result set as an indexed array.
......
......@@ -14,7 +14,7 @@ class Container extends DrupalContainer {
* {@inheritdoc}
*/
public function set($id, $service, $scope = ContainerInterface::SCOPE_CONTAINER) {
parent::set($id, $service, $scope);
parent::set($id, $service, $scope);
// Ensure that the _serviceId property is set on synthetic services as well.
if (isset($this->services[$id]) && is_object($this->services[$id]) && !isset($this->services[$id]->_serviceId)) {
......
......@@ -33,10 +33,10 @@ public function validate($value, Constraint $constraint) {
$referenced_entities = $existing_entity->{$value->getFieldDefinition()->getName()}->referencedEntities();
// Check permission if we are not already referencing the entity.
foreach ($referenced_entities as $ref) {
if (isset($referenced_entities[$ref->id()])) {
$check_permission = FALSE;
break;
}
if (isset($referenced_entities[$ref->id()])) {
$check_permission = FALSE;
break;
}
}
}
// We check that the current user had access to view any newly added
......
......@@ -225,7 +225,7 @@ protected function finish() {
if ($this->range) {
$this->sqlQuery->range($this->range['start'], $this->range['length']);
}
foreach ($this->sqlGroupBy as $field) {
foreach ($this->sqlGroupBy as $field) {
$this->sqlQuery->groupBy($field);
}
foreach ($this->sqlFields as $field) {
......
......@@ -893,9 +893,9 @@ function hook_ENTITY_TYPE_storage_load(array $entities) {
* @see hook_ENTITY_TYPE_presave()
*/
function hook_entity_presave(Drupal\Core\Entity\EntityInterface $entity) {
if ($entity instanceof ContentEntityInterface && $entity->isTranslatable()) {
$route_match = \Drupal::routeMatch();
\Drupal::service('content_translation.synchronizer')->synchronizeFields($entity, $entity->language()->getId(), $route_match->getParameter('source_langcode'));
if ($entity instanceof ContentEntityInterface && $entity->isTranslatable()) {
$route_match = \Drupal::routeMatch();
\Drupal::service('content_translation.synchronizer')->synchronizeFields($entity, $entity->language()->getId(), $route_match->getParameter('source_langcode'));
}
}
......
......@@ -30,7 +30,7 @@ trait AllowedTagsXssTrait {
* valid UTF-8.
*/
public function fieldFilterXss($string) {
return FieldFilteredMarkup::create($string);
return FieldFilteredMarkup::create($string);
}
/**
......
......@@ -257,7 +257,7 @@ public function view($display_options = array()) {
/**
* {@inheritdoc}
*/
public function generateSampleItems($count = 1) {
public function generateSampleItems($count = 1) {
$field_definition = $this->getFieldDefinition();
$field_type_class = \Drupal::service('plugin.manager.field.field_type')->getPluginClass($field_definition->getType());
for ($delta = 0; $delta < $count; $delta++) {
......
......@@ -617,7 +617,7 @@ public static function settingsAjaxSubmit($form, FormStateInterface $form_state)
$form_state->setRebuild();
}
/**
/**
* {@inheritdoc}
*/
public static function getPreconfiguredOptions() {
......
......@@ -31,7 +31,7 @@ class MimeTypeGuesser implements MimeTypeGuesserInterface {
*/
protected $sortedGuessers = NULL;
/**
/**
* The stream wrapper manager.
*
* @var \Drupal\Core\StreamWrapper\StreamWrapperManagerInterface
......
......@@ -648,7 +648,7 @@ public function disableRedirect($no_redirect = TRUE) {
* {@inheritdoc}
*/
public function isRedirectDisabled() {
return $this->no_redirect;
return $this->no_redirect;
}
/**
......
......@@ -123,7 +123,7 @@ protected function prepareArguments(array $arguments) {
// Use the default value if the argument is not passed in.
if (!array_key_exists($id, $arguments)) {
$arguments[$id] = $argument['default'];
$arguments[$id] = $argument['default'];
}
}
}
......
......@@ -37,7 +37,7 @@ class SiteSettingsForm extends FormBase {
public function __construct($site_path, RendererInterface $renderer) {
$this->sitePath = $site_path;
$this->renderer = $renderer;
}
}
/**
* {@inheritdoc}
......
......@@ -202,8 +202,7 @@ public static function htmlToText($string, $allowed_tags = NULL) {
// Ensure blank new-line.
$chunk = '';
}
// Fall-through.
// Intentional fall-through to the processing for '/li' and '/dd'.
case '/li':
case '/dd':
array_pop($indent);
......@@ -212,6 +211,7 @@ public static function htmlToText($string, $allowed_tags = NULL) {
case '/h3':
case '/h4':
array_pop($indent);
// Intentional fall-through to the processing for '/h5' and '/h6'.
case '/h5':
case '/h6':
// Ensure blank new-line.
......
......@@ -30,7 +30,7 @@ interface MailInterface {
*
* @see \Drupal\Core\Mail\MailManagerInterface
*/
public function format(array $message);
public function format(array $message);
/**
* Sends a message composed by \Drupal\Core\Mail\MailManagerInterface->mail().
......@@ -60,6 +60,6 @@ public function format(array $message);
* @return bool
* TRUE if the mail was successfully accepted for delivery, otherwise FALSE.
*/
public function mail(array $message);
public function mail(array $message);
}
......@@ -126,11 +126,11 @@ protected function getDiscovery() {
public function processDefinition(&$definition, $plugin_id) {
parent::processDefinition($definition, $plugin_id);
// If there is no route name, this is a broken definition.
// If there is no route name, this is a broken definition.
if (empty($definition['route_name'])) {
throw new PluginException(sprintf('Contextual link plugin (%s) definition must include "route_name".', $plugin_id));
}
// If there is no group name, this is a broken definition.
// If there is no group name, this is a broken definition.
if (empty($definition['group'])) {
throw new PluginException(sprintf('Contextual link plugin (%s) definition must include "group".', $plugin_id));
}
......
......@@ -37,7 +37,7 @@ class DefaultMenuLinkTreeManipulators {
*
* @var \Drupal\Core\Entity\Query\QueryFactory
*/
protected $queryFactory;
protected $queryFactory;
/**
* Constructs a \Drupal\Core\Menu\DefaultMenuLinkTreeManipulators object.
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment