Issue #2901726 by mfernea, gmario, finn.lewis, robertoperuzzo, rachel_norfolk: Fix 'Squiz.Functions.MultiLineFunctionDeclaration' coding standard
							parent
							
								
									942b70b4dd
								
							
						
					
					
						commit
						f659d6ca8e
					
				| 
						 | 
				
			
			@ -1030,7 +1030,7 @@ function file_scan_directory($dir, $mask, $options = [], $depth = 0) {
 | 
			
		|||
  // performance boost.
 | 
			
		||||
  if (!isset($options['nomask'])) {
 | 
			
		||||
    $ignore_directories = Settings::get('file_scan_ignore_directories', []);
 | 
			
		||||
    array_walk($ignore_directories, function(&$value) {
 | 
			
		||||
    array_walk($ignore_directories, function (&$value) {
 | 
			
		||||
      $value = preg_quote($value, '/');
 | 
			
		||||
    });
 | 
			
		||||
    $default_nomask = '/^' . implode('|', $ignore_directories) . '$/';
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -25,7 +25,7 @@ class Handle {
 | 
			
		|||
        require __DIR__ . '/global_namespace_php5.php';
 | 
			
		||||
      }
 | 
			
		||||
      // PHP 5 - create a handler to throw the exception directly.
 | 
			
		||||
      assert_options(ASSERT_CALLBACK, function($file = '', $line = 0, $code = '', $message = '') {
 | 
			
		||||
      assert_options(ASSERT_CALLBACK, function ($file = '', $line = 0, $code = '', $message = '') {
 | 
			
		||||
        if (empty($message)) {
 | 
			
		||||
          $message = $code;
 | 
			
		||||
        }
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -376,7 +376,7 @@ EOD;
 | 
			
		|||
   */
 | 
			
		||||
  public static function ucwords($text) {
 | 
			
		||||
    $regex = '/(^|[' . static::PREG_CLASS_WORD_BOUNDARY . '])([^' . static::PREG_CLASS_WORD_BOUNDARY . '])/u';
 | 
			
		||||
    return preg_replace_callback($regex, function(array $matches) {
 | 
			
		||||
    return preg_replace_callback($regex, function (array $matches) {
 | 
			
		||||
      return $matches[1] . Unicode::strtoupper($matches[2]);
 | 
			
		||||
    }, $text);
 | 
			
		||||
  }
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -175,7 +175,7 @@ class CssCollectionOptimizer implements AssetCollectionOptimizerInterface {
 | 
			
		|||
  public function deleteAll() {
 | 
			
		||||
    $this->state->delete('drupal_css_cache_files');
 | 
			
		||||
 | 
			
		||||
    $delete_stale = function($uri) {
 | 
			
		||||
    $delete_stale = function ($uri) {
 | 
			
		||||
      // Default stale file threshold is 30 days.
 | 
			
		||||
      if (REQUEST_TIME - filemtime($uri) > \Drupal::config('system.performance')->get('stale_file_threshold')) {
 | 
			
		||||
        file_unmanaged_delete($uri);
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -178,7 +178,7 @@ class JsCollectionOptimizer implements AssetCollectionOptimizerInterface {
 | 
			
		|||
   */
 | 
			
		||||
  public function deleteAll() {
 | 
			
		||||
    $this->state->delete('system.js_cache_files');
 | 
			
		||||
    $delete_stale = function($uri) {
 | 
			
		||||
    $delete_stale = function ($uri) {
 | 
			
		||||
      // Default stale file threshold is 30 days.
 | 
			
		||||
      if (REQUEST_TIME - filemtime($uri) > \Drupal::config('system.performance')->get('stale_file_threshold')) {
 | 
			
		||||
        file_unmanaged_delete($uri);
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -278,7 +278,7 @@ class CachedStorage implements StorageInterface, StorageCacheInterface {
 | 
			
		|||
   */
 | 
			
		||||
  protected function getCacheKeys(array $names) {
 | 
			
		||||
    $prefix = $this->getCollectionPrefix();
 | 
			
		||||
    $cache_keys = array_map(function($name) use ($prefix) {
 | 
			
		||||
    $cache_keys = array_map(function ($name) use ($prefix) {
 | 
			
		||||
      return $prefix . $name;
 | 
			
		||||
    }, $names);
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -306,7 +306,7 @@ class ConfigFactory implements ConfigFactoryInterface, EventSubscriberInterface
 | 
			
		|||
   *   An array of cache keys that match the provided config name.
 | 
			
		||||
   */
 | 
			
		||||
  protected function getConfigCacheKeys($name) {
 | 
			
		||||
    return array_filter(array_keys($this->cache), function($key) use ($name) {
 | 
			
		||||
    return array_filter(array_keys($this->cache), function ($key) use ($name) {
 | 
			
		||||
      // Return TRUE if the key is the name or starts with the configuration
 | 
			
		||||
      // name plus the delimiter.
 | 
			
		||||
      return $key === $name || strpos($key, $name . ':') === 0;
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -185,7 +185,7 @@ class ConfigInstaller implements ConfigInstallerInterface {
 | 
			
		|||
    $existing_config = $this->getActiveStorages()->listAll();
 | 
			
		||||
 | 
			
		||||
    $list = array_unique(array_merge($storage->listAll(), $optional_profile_config));
 | 
			
		||||
    $list = array_filter($list, function($config_name) use ($existing_config) {
 | 
			
		||||
    $list = array_filter($list, function ($config_name) use ($existing_config) {
 | 
			
		||||
      // Only list configuration that:
 | 
			
		||||
      // - does not already exist
 | 
			
		||||
      // - is a configuration entity (this also excludes config that has an
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -233,7 +233,7 @@ class ConfigManager implements ConfigManagerInterface {
 | 
			
		|||
    // dependencies on the config entity classes. Assume data with UUID is a
 | 
			
		||||
    // config entity. Only configuration entities can be depended on so we can
 | 
			
		||||
    // ignore everything else.
 | 
			
		||||
    $data = array_map(function($config) {
 | 
			
		||||
    $data = array_map(function ($config) {
 | 
			
		||||
      $data = $config->get();
 | 
			
		||||
      if (isset($data['uuid'])) {
 | 
			
		||||
        return $data;
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -88,7 +88,7 @@ class Query extends QueryBase implements QueryInterface {
 | 
			
		|||
    foreach ($this->sort as $sort) {
 | 
			
		||||
      $direction = $sort['direction'] == 'ASC' ? -1 : 1;
 | 
			
		||||
      $field = $sort['field'];
 | 
			
		||||
      uasort($result, function($a, $b) use ($field, $direction) {
 | 
			
		||||
      uasort($result, function ($a, $b) use ($field, $direction) {
 | 
			
		||||
        return ($a[$field] <= $b[$field]) ? $direction : -$direction;
 | 
			
		||||
      });
 | 
			
		||||
    }
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -128,7 +128,7 @@ class Insert extends QueryInsert {
 | 
			
		|||
    // Default fields are always placed first for consistency.
 | 
			
		||||
    $insert_fields = array_merge($this->defaultFields, $this->insertFields);
 | 
			
		||||
 | 
			
		||||
    $insert_fields = array_map(function($f) {
 | 
			
		||||
    $insert_fields = array_map(function ($f) {
 | 
			
		||||
      return $this->connection->escapeField($f);
 | 
			
		||||
    }, $insert_fields);
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -100,7 +100,7 @@ class NativeUpsert extends QueryUpsert {
 | 
			
		|||
 | 
			
		||||
    // Default fields are always placed first for consistency.
 | 
			
		||||
    $insert_fields = array_merge($this->defaultFields, $this->insertFields);
 | 
			
		||||
    $insert_fields = array_map(function($f) {
 | 
			
		||||
    $insert_fields = array_map(function ($f) {
 | 
			
		||||
      return $this->connection->escapeField($f);
 | 
			
		||||
    }, $insert_fields);
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -108,7 +108,7 @@ class DrupalDateTime extends DateTimePlus {
 | 
			
		|||
      $format = parent::format($format, $settings);
 | 
			
		||||
 | 
			
		||||
      // Translates a formatted date string.
 | 
			
		||||
      $translation_callback = function($matches) use ($langcode) {
 | 
			
		||||
      $translation_callback = function ($matches) use ($langcode) {
 | 
			
		||||
        $code = $matches[1];
 | 
			
		||||
        $string = $matches[2];
 | 
			
		||||
        if (!isset($this->formatTranslationCache[$langcode][$code][$string])) {
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -916,7 +916,7 @@ abstract class ContentEntityBase extends Entity implements \IteratorAggregate, C
 | 
			
		|||
   * {@inheritdoc}
 | 
			
		||||
   */
 | 
			
		||||
  public function getTranslationLanguages($include_default = TRUE) {
 | 
			
		||||
    $translations = array_filter($this->translations, function($translation) {
 | 
			
		||||
    $translations = array_filter($this->translations, function ($translation) {
 | 
			
		||||
      return $translation['status'];
 | 
			
		||||
    });
 | 
			
		||||
    unset($translations[LanguageInterface::LANGCODE_DEFAULT]);
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -153,10 +153,10 @@ abstract class ContentEntityStorageBase extends EntityStorageBase implements Con
 | 
			
		|||
   */
 | 
			
		||||
  public function createTranslation(ContentEntityInterface $entity, $langcode, array $values = []) {
 | 
			
		||||
    $translation = $entity->getTranslation($langcode);
 | 
			
		||||
    $definitions = array_filter($translation->getFieldDefinitions(), function(FieldDefinitionInterface $definition) {
 | 
			
		||||
    $definitions = array_filter($translation->getFieldDefinitions(), function (FieldDefinitionInterface $definition) {
 | 
			
		||||
      return $definition->isTranslatable();
 | 
			
		||||
    });
 | 
			
		||||
    $field_names = array_map(function(FieldDefinitionInterface $definition) {
 | 
			
		||||
    $field_names = array_map(function (FieldDefinitionInterface $definition) {
 | 
			
		||||
      return $definition->getName();
 | 
			
		||||
    }, $definitions);
 | 
			
		||||
    $values[$this->langcodeKey] = $langcode;
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -77,7 +77,7 @@ class EntityAutocomplete extends Textfield {
 | 
			
		|||
    // Potentially the #value is set directly, so it contains the 'target_id'
 | 
			
		||||
    // array structure instead of a string.
 | 
			
		||||
    if ($input !== FALSE && is_array($input)) {
 | 
			
		||||
      $entity_ids = array_map(function(array $item) {
 | 
			
		||||
      $entity_ids = array_map(function (array $item) {
 | 
			
		||||
        return $item['target_id'];
 | 
			
		||||
      }, $input);
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -346,7 +346,7 @@ class EntityFieldManager implements EntityFieldManagerInterface {
 | 
			
		|||
 | 
			
		||||
    // Load base field overrides from configuration. These take precedence over
 | 
			
		||||
    // base field overrides returned above.
 | 
			
		||||
    $base_field_override_ids = array_map(function($field_name) use ($entity_type_id, $bundle) {
 | 
			
		||||
    $base_field_override_ids = array_map(function ($field_name) use ($entity_type_id, $bundle) {
 | 
			
		||||
      return $entity_type_id . '.' . $bundle . '.' . $field_name;
 | 
			
		||||
    }, array_keys($base_field_definitions));
 | 
			
		||||
    $base_field_overrides = $this->entityTypeManager->getStorage('base_field_override')->loadMultiple($base_field_override_ids);
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -50,7 +50,7 @@ class Query extends QueryBase {
 | 
			
		|||
    foreach ($this->sort as $sort) {
 | 
			
		||||
      $direction = $sort['direction'] == 'ASC' ? -1 : 1;
 | 
			
		||||
      $field = $sort['field'];
 | 
			
		||||
      uasort($result, function($a, $b) use ($field, $direction) {
 | 
			
		||||
      uasort($result, function ($a, $b) use ($field, $direction) {
 | 
			
		||||
        return ($a[$field] <= $b[$field]) ? $direction : -$direction;
 | 
			
		||||
      });
 | 
			
		||||
    }
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -296,13 +296,13 @@ class DefaultTableMapping implements TableMappingInterface {
 | 
			
		|||
   */
 | 
			
		||||
  public function getDedicatedTableNames() {
 | 
			
		||||
    $table_mapping = $this;
 | 
			
		||||
    $definitions = array_filter($this->fieldStorageDefinitions, function($definition) use ($table_mapping) {
 | 
			
		||||
    $definitions = array_filter($this->fieldStorageDefinitions, function ($definition) use ($table_mapping) {
 | 
			
		||||
      return $table_mapping->requiresDedicatedTableStorage($definition);
 | 
			
		||||
    });
 | 
			
		||||
    $data_tables = array_map(function($definition) use ($table_mapping) {
 | 
			
		||||
    $data_tables = array_map(function ($definition) use ($table_mapping) {
 | 
			
		||||
      return $table_mapping->getDedicatedDataTableName($definition);
 | 
			
		||||
    }, $definitions);
 | 
			
		||||
    $revision_tables = array_map(function($definition) use ($table_mapping) {
 | 
			
		||||
    $revision_tables = array_map(function ($definition) use ($table_mapping) {
 | 
			
		||||
      return $table_mapping->getDedicatedRevisionTableName($definition);
 | 
			
		||||
    }, $definitions);
 | 
			
		||||
    $dedicated_tables = array_merge(array_values($data_tables), array_values($revision_tables));
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -1529,7 +1529,7 @@ class SqlContentEntityStorageSchema implements DynamicallyFieldableEntityStorage
 | 
			
		|||
            // involving them. Only indexes for which all columns exist are
 | 
			
		||||
            // actually created.
 | 
			
		||||
            $create = FALSE;
 | 
			
		||||
            $specifier_columns = array_map(function($item) {
 | 
			
		||||
            $specifier_columns = array_map(function ($item) {
 | 
			
		||||
              return is_string($item) ? $item : reset($item);
 | 
			
		||||
            }, $specifier);
 | 
			
		||||
            if (!isset($column_names) || array_intersect($specifier_columns, $column_names)) {
 | 
			
		||||
| 
						 | 
				
			
			@ -1580,7 +1580,7 @@ class SqlContentEntityStorageSchema implements DynamicallyFieldableEntityStorage
 | 
			
		|||
      foreach ($index_keys as $key => $drop_method) {
 | 
			
		||||
        if (!empty($schema[$key])) {
 | 
			
		||||
          foreach ($schema[$key] as $name => $specifier) {
 | 
			
		||||
            $specifier_columns = array_map(function($item) {
 | 
			
		||||
            $specifier_columns = array_map(function ($item) {
 | 
			
		||||
              return is_string($item) ? $item : reset($item);
 | 
			
		||||
            }, $specifier);
 | 
			
		||||
            if (!isset($column_names) || array_intersect($specifier_columns, $column_names)) {
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -93,7 +93,7 @@ class EarlyRenderingControllerWrapperSubscriber implements EventSubscriberInterf
 | 
			
		|||
    // See \Symfony\Component\HttpKernel\HttpKernel::handleRaw().
 | 
			
		||||
    $arguments = $this->controllerResolver->getArguments($event->getRequest(), $controller);
 | 
			
		||||
 | 
			
		||||
    $event->setController(function() use ($controller, $arguments) {
 | 
			
		||||
    $event->setController(function () use ($controller, $arguments) {
 | 
			
		||||
      return $this->wrapControllerExecutionInRenderContext($controller, $arguments);
 | 
			
		||||
    });
 | 
			
		||||
  }
 | 
			
		||||
| 
						 | 
				
			
			@ -118,7 +118,7 @@ class EarlyRenderingControllerWrapperSubscriber implements EventSubscriberInterf
 | 
			
		|||
  protected function wrapControllerExecutionInRenderContext($controller, array $arguments) {
 | 
			
		||||
    $context = new RenderContext();
 | 
			
		||||
 | 
			
		||||
    $response = $this->renderer->executeInRenderContext($context, function() use ($controller, $arguments) {
 | 
			
		||||
    $response = $this->renderer->executeInRenderContext($context, function () use ($controller, $arguments) {
 | 
			
		||||
      // Now call the actual controller, just like HttpKernel does.
 | 
			
		||||
      return call_user_func_array($controller, $arguments);
 | 
			
		||||
    });
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -176,7 +176,7 @@ class SiteSettingsForm extends FormBase {
 | 
			
		|||
   */
 | 
			
		||||
  protected function getDatabaseErrors(array $database, $settings_file) {
 | 
			
		||||
    $errors = install_database_errors($database, $settings_file);
 | 
			
		||||
    $form_errors = array_filter($errors, function($value) {
 | 
			
		||||
    $form_errors = array_filter($errors, function ($value) {
 | 
			
		||||
      // Errors keyed by something other than an integer already are linked to
 | 
			
		||||
      // form elements.
 | 
			
		||||
      return is_int($value);
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -169,7 +169,7 @@ class MailManager extends DefaultPluginManager implements MailManagerInterface {
 | 
			
		|||
    // attachments. Therefore we perform mailing inside its own render context,
 | 
			
		||||
    // to ensure it doesn't leak into the render context for the HTTP response
 | 
			
		||||
    // to the current request.
 | 
			
		||||
    return $this->renderer->executeInRenderContext(new RenderContext(), function() use ($module, $key, $to, $langcode, $params, $reply, $send) {
 | 
			
		||||
    return $this->renderer->executeInRenderContext(new RenderContext(), function () use ($module, $key, $to, $langcode, $params, $reply, $send) {
 | 
			
		||||
      return $this->doMail($module, $key, $to, $langcode, $params, $reply, $send);
 | 
			
		||||
    });
 | 
			
		||||
  }
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -139,7 +139,7 @@ class Checkboxes extends FormElement {
 | 
			
		|||
    //
 | 
			
		||||
    // @see \Drupal\Core\Render\Element\Checkboxes::valueCallback()
 | 
			
		||||
    // @see https://www.w3.org/TR/html401/interact/forms.html#checkbox
 | 
			
		||||
    $checked = array_filter($input, function($value) {
 | 
			
		||||
    $checked = array_filter($input, function ($value) {
 | 
			
		||||
      return $value !== 0;
 | 
			
		||||
    });
 | 
			
		||||
    return array_keys($checked);
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -139,7 +139,7 @@ class HtmlRenderer implements MainContentRendererInterface {
 | 
			
		|||
    // RendererInterface::render() instead of RendererInterface::renderRoot().
 | 
			
		||||
    // @see \Drupal\Core\Render\HtmlResponseAttachmentsProcessor.
 | 
			
		||||
    $render_context = new RenderContext();
 | 
			
		||||
    $this->renderer->executeInRenderContext($render_context, function() use (&$html) {
 | 
			
		||||
    $this->renderer->executeInRenderContext($render_context, function () use (&$html) {
 | 
			
		||||
      // RendererInterface::render() renders the $html render array and updates
 | 
			
		||||
      // it in place. We don't care about the return value (which is just
 | 
			
		||||
      // $html['#markup']), but about the resulting render array.
 | 
			
		||||
| 
						 | 
				
			
			@ -216,7 +216,7 @@ class HtmlRenderer implements MainContentRendererInterface {
 | 
			
		|||
      // ::renderResponse().
 | 
			
		||||
      // @todo Remove this once https://www.drupal.org/node/2359901 lands.
 | 
			
		||||
      if (!empty($main_content)) {
 | 
			
		||||
        $this->renderer->executeInRenderContext(new RenderContext(), function() use (&$main_content) {
 | 
			
		||||
        $this->renderer->executeInRenderContext(new RenderContext(), function () use (&$main_content) {
 | 
			
		||||
          if (isset($main_content['#cache']['keys'])) {
 | 
			
		||||
            // Retain #title, otherwise, dynamically generated titles would be
 | 
			
		||||
            // missing for controllers whose entire returned render array is
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -309,7 +309,7 @@ class Renderer implements RendererInterface {
 | 
			
		|||
      if (count($elements['#lazy_builder']) !== 2) {
 | 
			
		||||
        throw new \DomainException('The #lazy_builder property must have an array as a value, containing two values: the callback, and the arguments for the callback.');
 | 
			
		||||
      }
 | 
			
		||||
      if (count($elements['#lazy_builder'][1]) !== count(array_filter($elements['#lazy_builder'][1], function($v) {
 | 
			
		||||
      if (count($elements['#lazy_builder'][1]) !== count(array_filter($elements['#lazy_builder'][1], function ($v) {
 | 
			
		||||
        return is_null($v) || is_scalar($v);
 | 
			
		||||
      }))) {
 | 
			
		||||
        throw new \DomainException("A #lazy_builder callback's context may only contain scalar values or NULL.");
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -130,7 +130,7 @@ class RouteCompiler extends SymfonyRouteCompiler implements RouteCompilerInterfa
 | 
			
		|||
 | 
			
		||||
    // Remove placeholders with default values from the outline, so that they
 | 
			
		||||
    // will still match.
 | 
			
		||||
    $remove = array_map(function($a) {
 | 
			
		||||
    $remove = array_map(function ($a) {
 | 
			
		||||
      return '/{' . $a . '}';
 | 
			
		||||
    }, array_keys($defaults));
 | 
			
		||||
    $path = str_replace($remove, '', $path);
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -610,7 +610,7 @@ class TwigExtension extends \Twig_Extension {
 | 
			
		|||
      $value = iterator_to_array($value, FALSE);
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    return implode($glue, array_map(function($item) use ($env) {
 | 
			
		||||
    return implode($glue, array_map(function ($item) use ($env) {
 | 
			
		||||
      // If $item is not marked safe then it will be escaped.
 | 
			
		||||
      return $this->escapeFilter($env, $item, 'html', NULL, TRUE);
 | 
			
		||||
    }, (array) $value));
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -225,7 +225,7 @@ class UpdateRegistry {
 | 
			
		|||
    $this->scanExtensionsAndLoadUpdateFiles();
 | 
			
		||||
    $all_functions = $this->getAvailableUpdateFunctions();
 | 
			
		||||
 | 
			
		||||
    return array_filter($all_functions, function($function_name) use ($module_name) {
 | 
			
		||||
    return array_filter($all_functions, function ($function_name) use ($module_name) {
 | 
			
		||||
      list($function_module_name, ) = explode("_{$this->updateType}_", $function_name);
 | 
			
		||||
      return $function_module_name === $module_name;
 | 
			
		||||
    });
 | 
			
		||||
| 
						 | 
				
			
			@ -254,7 +254,7 @@ class UpdateRegistry {
 | 
			
		|||
  public function filterOutInvokedUpdatesByModule($module) {
 | 
			
		||||
    $existing_update_functions = $this->keyValue->get('existing_updates', []);
 | 
			
		||||
 | 
			
		||||
    $remaining_update_functions = array_filter($existing_update_functions, function($function_name) use ($module) {
 | 
			
		||||
    $remaining_update_functions = array_filter($existing_update_functions, function ($function_name) use ($module) {
 | 
			
		||||
      return strpos($function_name, "{$module}_{$this->updateType}_") !== 0;
 | 
			
		||||
    });
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -112,7 +112,7 @@ class LinkGenerator implements LinkGeneratorInterface {
 | 
			
		|||
    }
 | 
			
		||||
 | 
			
		||||
    // Ensure that query values are strings.
 | 
			
		||||
    array_walk($variables['options']['query'], function(&$value) {
 | 
			
		||||
    array_walk($variables['options']['query'], function (&$value) {
 | 
			
		||||
      if ($value instanceof MarkupInterface) {
 | 
			
		||||
        $value = (string) $value;
 | 
			
		||||
      }
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -92,7 +92,7 @@ class GotoAction extends ConfigurableActionBase implements ContainerFactoryPlugi
 | 
			
		|||
      $url = $this->unroutedUrlAssembler->assemble($uri, $options);
 | 
			
		||||
    }
 | 
			
		||||
    $response = new RedirectResponse($url);
 | 
			
		||||
    $listener = function($event) use ($response) {
 | 
			
		||||
    $listener = function ($event) use ($response) {
 | 
			
		||||
      $event->setResponse($response);
 | 
			
		||||
    };
 | 
			
		||||
    // Add the listener to the event dispatcher.
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -86,7 +86,7 @@ class DefaultFetcher implements FetcherInterface, ContainerFactoryPluginInterfac
 | 
			
		|||
      $actual_uri = NULL;
 | 
			
		||||
      $response = $this->httpClientFactory->fromOptions([
 | 
			
		||||
        'allow_redirects' => [
 | 
			
		||||
          'on_redirect' => function(RequestInterface $request, ResponseInterface $response, UriInterface $uri) use (&$actual_uri) {
 | 
			
		||||
          'on_redirect' => function (RequestInterface $request, ResponseInterface $response, UriInterface $uri) use (&$actual_uri) {
 | 
			
		||||
            $actual_uri = (string) $uri;
 | 
			
		||||
          }
 | 
			
		||||
        ],
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -141,7 +141,7 @@ class DefaultProcessor extends AggregatorPluginSettingsBase implements Processor
 | 
			
		|||
    ];
 | 
			
		||||
 | 
			
		||||
    $lengths = [0, 200, 400, 600, 800, 1000, 1200, 1400, 1600, 1800, 2000];
 | 
			
		||||
    $options = array_map(function($length) {
 | 
			
		||||
    $options = array_map(function ($length) {
 | 
			
		||||
      return ($length == 0) ? t('Unlimited') : $this->formatPlural($length, '1 character', '@count characters');
 | 
			
		||||
    }, array_combine($lengths, $lengths));
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -374,7 +374,7 @@ class BigPipeTest extends BrowserTestBase {
 | 
			
		|||
    }
 | 
			
		||||
    ksort($placeholder_positions, SORT_NUMERIC);
 | 
			
		||||
    $this->assertEqual(array_keys($expected_big_pipe_placeholders), array_values($placeholder_positions));
 | 
			
		||||
    $placeholders = array_map(function(NodeElement $element) {
 | 
			
		||||
    $placeholders = array_map(function (NodeElement $element) {
 | 
			
		||||
      return $element->getAttribute('data-big-pipe-placeholder-id');
 | 
			
		||||
    }, $this->cssSelect('[data-big-pipe-placeholder-id]'));
 | 
			
		||||
    $this->assertEqual(count($expected_big_pipe_placeholders), count(array_unique($placeholders)));
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -84,7 +84,7 @@ class BlockFilterTest extends JavascriptTestBase {
 | 
			
		|||
   * @return NodeElement[]
 | 
			
		||||
   */
 | 
			
		||||
  protected function filterVisibleElements(array $elements) {
 | 
			
		||||
    $elements = array_filter($elements, function(NodeElement $element) {
 | 
			
		||||
    $elements = array_filter($elements, function (NodeElement $element) {
 | 
			
		||||
      return $element->isVisible();
 | 
			
		||||
    });
 | 
			
		||||
    return $elements;
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -66,7 +66,7 @@ function template_preprocess_ckeditor_settings_toolbar(&$variables) {
 | 
			
		|||
 | 
			
		||||
  $rtl = $language_interface->getDirection() === LanguageInterface::DIRECTION_RTL ? '_rtl' : '';
 | 
			
		||||
 | 
			
		||||
  $build_button_item = function($button, $rtl) {
 | 
			
		||||
  $build_button_item = function ($button, $rtl) {
 | 
			
		||||
    // Value of the button item.
 | 
			
		||||
    if (isset($button['image_alternative' . $rtl])) {
 | 
			
		||||
      $value = $button['image_alternative' . $rtl];
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -126,7 +126,7 @@ class Internal extends CKEditorPluginBase implements ContainerFactoryPluginInter
 | 
			
		|||
   * {@inheritdoc}
 | 
			
		||||
   */
 | 
			
		||||
  public function getButtons() {
 | 
			
		||||
    $button = function($name, $direction = 'ltr') {
 | 
			
		||||
    $button = function ($name, $direction = 'ltr') {
 | 
			
		||||
      // In the markup below, we mostly use the name (which may include spaces),
 | 
			
		||||
      // but in one spot we use it as a CSS class, so strip spaces.
 | 
			
		||||
      // Note: this uses str_replace() instead of Html::cleanCssIdentifier()
 | 
			
		||||
| 
						 | 
				
			
			@ -420,8 +420,8 @@ class Internal extends CKEditorPluginBase implements ContainerFactoryPluginInter
 | 
			
		|||
    }
 | 
			
		||||
    // Generate setting that accurately reflects allowed tags and attributes.
 | 
			
		||||
    else {
 | 
			
		||||
      $get_attribute_values = function($attribute_values, $allowed_values) {
 | 
			
		||||
        $values = array_keys(array_filter($attribute_values, function($value) use ($allowed_values) {
 | 
			
		||||
      $get_attribute_values = function ($attribute_values, $allowed_values) {
 | 
			
		||||
        $values = array_keys(array_filter($attribute_values, function ($value) use ($allowed_values) {
 | 
			
		||||
          if ($allowed_values) {
 | 
			
		||||
            return $value !== FALSE;
 | 
			
		||||
          }
 | 
			
		||||
| 
						 | 
				
			
			@ -532,7 +532,7 @@ class Internal extends CKEditorPluginBase implements ContainerFactoryPluginInter
 | 
			
		|||
          // getConfig() method, and override the JavaScript at
 | 
			
		||||
          // Drupal.editors.ckeditor to somehow make validation of values for
 | 
			
		||||
          // attributes other than "class" and "style" work.
 | 
			
		||||
          $allowed_attributes = array_filter($attributes, function($value) {
 | 
			
		||||
          $allowed_attributes = array_filter($attributes, function ($value) {
 | 
			
		||||
            return $value !== FALSE;
 | 
			
		||||
          });
 | 
			
		||||
          if (count($allowed_attributes)) {
 | 
			
		||||
| 
						 | 
				
			
			@ -567,7 +567,7 @@ class Internal extends CKEditorPluginBase implements ContainerFactoryPluginInter
 | 
			
		|||
          // implies that all of its possible attribute values are disallowed,
 | 
			
		||||
          // thus we must look at the disallowed attribute values on allowed
 | 
			
		||||
          // attributes.
 | 
			
		||||
          $disallowed_attributes = array_filter($attributes, function($value) {
 | 
			
		||||
          $disallowed_attributes = array_filter($attributes, function ($value) {
 | 
			
		||||
            return $value === FALSE;
 | 
			
		||||
          });
 | 
			
		||||
          if (count($disallowed_attributes)) {
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -194,7 +194,7 @@ class CKEditor extends EditorBase implements ContainerFactoryPluginInterface {
 | 
			
		|||
      }
 | 
			
		||||
    }
 | 
			
		||||
    // Get a list of all buttons that are provided by all plugins.
 | 
			
		||||
    $all_buttons = array_reduce($this->ckeditorPluginManager->getButtons(), function($result, $item) {
 | 
			
		||||
    $all_buttons = array_reduce($this->ckeditorPluginManager->getButtons(), function ($result, $item) {
 | 
			
		||||
      return array_merge($result, array_keys($item));
 | 
			
		||||
    }, []);
 | 
			
		||||
    // Build a fake Editor object, which we'll use to generate JavaScript
 | 
			
		||||
| 
						 | 
				
			
			@ -418,7 +418,7 @@ class CKEditor extends EditorBase implements ContainerFactoryPluginInterface {
 | 
			
		|||
    ];
 | 
			
		||||
    $this->moduleHandler->alter('ckeditor_css', $css, $editor);
 | 
			
		||||
    // Get a list of all enabled plugins' iframe instance CSS files.
 | 
			
		||||
    $plugins_css = array_reduce($this->ckeditorPluginManager->getCssFiles($editor), function($result, $item) {
 | 
			
		||||
    $plugins_css = array_reduce($this->ckeditorPluginManager->getCssFiles($editor), function ($result, $item) {
 | 
			
		||||
      return array_merge($result, array_values($item));
 | 
			
		||||
    }, []);
 | 
			
		||||
    $css = array_merge($css, $plugins_css);
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -179,7 +179,7 @@ class CKEditorAdminTest extends BrowserTestBase {
 | 
			
		|||
    // JavaScript's drupalSettings, and Unicode-escaped) is correctly rendered.
 | 
			
		||||
    $this->drupalGet('admin/config/content/formats/manage/filtered_html');
 | 
			
		||||
    // Create function to encode HTML as we expect it in drupalSettings.
 | 
			
		||||
    $json_encode = function($html) {
 | 
			
		||||
    $json_encode = function ($html) {
 | 
			
		||||
      return trim(Json::encode($html), '"');
 | 
			
		||||
    };
 | 
			
		||||
    // Check the Button separator.
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -67,7 +67,7 @@ class CKEditorToolbarButtonTest extends BrowserTestBase {
 | 
			
		|||
    $this->drupalGet('admin/config/content/formats/manage/full_html');
 | 
			
		||||
 | 
			
		||||
    // Check if any image button is loaded in CKEditor json.
 | 
			
		||||
    $json_encode = function($html) {
 | 
			
		||||
    $json_encode = function ($html) {
 | 
			
		||||
      return trim(Json::encode($html), '"');
 | 
			
		||||
    };
 | 
			
		||||
    $markup = $json_encode(file_url_transform_relative(file_create_url('core/modules/ckeditor/js/plugins/drupalimage/icons/drupalimage.png')));
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -55,7 +55,7 @@ class AjaxCssTest extends JavascriptTestBase {
 | 
			
		|||
    // but not the iframe.
 | 
			
		||||
    $page->pressButton('Add CSS to inline CKEditor instance');
 | 
			
		||||
 | 
			
		||||
    $result = $page->waitFor(10, function() use ($style_color) {
 | 
			
		||||
    $result = $page->waitFor(10, function () use ($style_color) {
 | 
			
		||||
      return ($this->getEditorStyle('edit-inline', 'color') == $style_color)
 | 
			
		||||
        && ($this->getEditorStyle('edit-iframe-value', 'color') != $style_color);
 | 
			
		||||
    });
 | 
			
		||||
| 
						 | 
				
			
			@ -70,7 +70,7 @@ class AjaxCssTest extends JavascriptTestBase {
 | 
			
		|||
    // but not the main body.
 | 
			
		||||
    $page->pressButton('Add CSS to iframe CKEditor instance');
 | 
			
		||||
 | 
			
		||||
    $result = $page->waitFor(10, function() use ($style_color) {
 | 
			
		||||
    $result = $page->waitFor(10, function () use ($style_color) {
 | 
			
		||||
      return ($this->getEditorStyle('edit-inline', 'color') != $style_color)
 | 
			
		||||
        && ($this->getEditorStyle('edit-iframe-value', 'color') == $style_color);
 | 
			
		||||
    });
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -136,7 +136,7 @@ class MailHandlerTest extends UnitTestCase {
 | 
			
		|||
    $this->mailManager->expects($this->any())
 | 
			
		||||
      ->method('mail')
 | 
			
		||||
      ->willReturnCallback(
 | 
			
		||||
        function($module, $key, $to, $langcode, $params, $from) use (&$results) {
 | 
			
		||||
        function ($module, $key, $to, $langcode, $params, $from) use (&$results) {
 | 
			
		||||
          $result = array_shift($results);
 | 
			
		||||
          $this->assertEquals($module, $result['module']);
 | 
			
		||||
          $this->assertEquals($key, $result['key']);
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -71,7 +71,7 @@ class EntityModerationForm extends FormBase {
 | 
			
		|||
    $transitions = $this->validation->getValidTransitions($entity, $this->currentUser());
 | 
			
		||||
 | 
			
		||||
    // Exclude self-transitions.
 | 
			
		||||
    $transitions = array_filter($transitions, function(Transition $transition) use ($current_state) {
 | 
			
		||||
    $transitions = array_filter($transitions, function (Transition $transition) use ($current_state) {
 | 
			
		||||
      return $transition->to()->id() != $current_state;
 | 
			
		||||
    });
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -42,7 +42,7 @@ class StateTransitionValidation implements StateTransitionValidationInterface {
 | 
			
		|||
    $workflow = $this->moderationInfo->getWorkflowForEntity($entity);
 | 
			
		||||
    $current_state = $entity->moderation_state->value ? $workflow->getTypePlugin()->getState($entity->moderation_state->value) : $workflow->getTypePlugin()->getInitialState($entity);
 | 
			
		||||
 | 
			
		||||
    return array_filter($current_state->getTransitions(), function(Transition $transition) use ($workflow, $user) {
 | 
			
		||||
    return array_filter($current_state->getTransitions(), function (Transition $transition) use ($workflow, $user) {
 | 
			
		||||
      return $user->hasPermission('use ' . $workflow->id() . ' transition ' . $transition->id());
 | 
			
		||||
    });
 | 
			
		||||
  }
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -52,7 +52,7 @@ class StateFormatterTest extends KernelTestBase {
 | 
			
		|||
    ]);
 | 
			
		||||
    $entity->save();
 | 
			
		||||
 | 
			
		||||
    $field_output = $this->container->get('renderer')->executeInRenderContext(new RenderContext(), function() use ($entity, $formatter_settings) {
 | 
			
		||||
    $field_output = $this->container->get('renderer')->executeInRenderContext(new RenderContext(), function () use ($entity, $formatter_settings) {
 | 
			
		||||
      return $entity->moderation_state->view($formatter_settings);
 | 
			
		||||
    });
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -181,19 +181,19 @@ class ContentTranslationSyncUnitTest extends KernelTestBase {
 | 
			
		|||
    // their delta.
 | 
			
		||||
    $delta_callbacks = [
 | 
			
		||||
      // Continuous field values: all values are equal.
 | 
			
		||||
      function($delta) {
 | 
			
		||||
      function ($delta) {
 | 
			
		||||
        return TRUE;
 | 
			
		||||
      },
 | 
			
		||||
      // Alternated field values: only the even ones are equal.
 | 
			
		||||
      function($delta) {
 | 
			
		||||
      function ($delta) {
 | 
			
		||||
        return $delta % 2 !== 0;
 | 
			
		||||
      },
 | 
			
		||||
      // Sparse field values: only the "middle" ones are equal.
 | 
			
		||||
      function($delta) {
 | 
			
		||||
      function ($delta) {
 | 
			
		||||
        return $delta === 1 || $delta === 2;
 | 
			
		||||
      },
 | 
			
		||||
      // Sparse field values: only the "extreme" ones are equal.
 | 
			
		||||
      function($delta) {
 | 
			
		||||
      function ($delta) {
 | 
			
		||||
        return $delta === 0 || $delta === 3;
 | 
			
		||||
      },
 | 
			
		||||
    ];
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -46,7 +46,7 @@ class EditorFileReferenceFilterTest extends KernelTestBase {
 | 
			
		|||
  public function testEditorFileReferenceFilter() {
 | 
			
		||||
    $filter = $this->filters['editor_file_reference'];
 | 
			
		||||
 | 
			
		||||
    $test = function($input) use ($filter) {
 | 
			
		||||
    $test = function ($input) use ($filter) {
 | 
			
		||||
      return $filter->process($input, 'und');
 | 
			
		||||
    };
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -57,7 +57,7 @@ class FieldUITest extends FieldTestBase {
 | 
			
		|||
 | 
			
		||||
    // Tests the available formatter options.
 | 
			
		||||
    $result = $this->xpath('//select[@id=:id]/option', [':id' => 'edit-options-type']);
 | 
			
		||||
    $options = array_map(function($item) {
 | 
			
		||||
    $options = array_map(function ($item) {
 | 
			
		||||
      return (string) $item->attributes()->value[0];
 | 
			
		||||
    }, $result);
 | 
			
		||||
    // @todo Replace this sort by assertArray once it's in.
 | 
			
		||||
| 
						 | 
				
			
			@ -111,7 +111,7 @@ class FieldUITest extends FieldTestBase {
 | 
			
		|||
    // Test the click sort column options.
 | 
			
		||||
    // Tests the available formatter options.
 | 
			
		||||
    $result = $this->xpath('//select[@id=:id]/option', [':id' => 'edit-options-click-sort-column']);
 | 
			
		||||
    $options = array_map(function($item) {
 | 
			
		||||
    $options = array_map(function ($item) {
 | 
			
		||||
      return (string) $item->attributes()->value[0];
 | 
			
		||||
    }, $result);
 | 
			
		||||
    sort($options, SORT_STRING);
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -174,7 +174,7 @@ class MigrateFieldInstanceTest extends MigrateDrupal7TestBase {
 | 
			
		|||
    // message with the required steps to fix this.
 | 
			
		||||
    $migration = $this->getMigration('d7_field_instance');
 | 
			
		||||
    $messages = $migration->getIdMap()->getMessageIterator()->fetchAll();
 | 
			
		||||
    $errors = array_map(function($message) {
 | 
			
		||||
    $errors = array_map(function ($message) {
 | 
			
		||||
      return $message->message;
 | 
			
		||||
    }, $messages);
 | 
			
		||||
    $this->assertCount(8, $errors);
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -149,7 +149,7 @@ class MigrateFieldTest extends MigrateDrupal7TestBase {
 | 
			
		|||
    // message with the required steps to fix this.
 | 
			
		||||
    $migration = $this->getMigration('d7_field');
 | 
			
		||||
    $messages = $migration->getIdMap()->getMessageIterator()->fetchAll();
 | 
			
		||||
    $errors = array_map(function($message) {
 | 
			
		||||
    $errors = array_map(function ($message) {
 | 
			
		||||
      return $message->message;
 | 
			
		||||
    }, $messages);
 | 
			
		||||
    sort($errors);
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -125,7 +125,7 @@ abstract class EntityDisplayFormBase extends EntityForm {
 | 
			
		|||
   */
 | 
			
		||||
  protected function getFieldDefinitions() {
 | 
			
		||||
    $context = $this->displayContext;
 | 
			
		||||
    return array_filter($this->entityManager->getFieldDefinitions($this->entity->getTargetEntityTypeId(), $this->entity->getTargetBundle()), function(FieldDefinitionInterface $field_definition) use ($context) {
 | 
			
		||||
    return array_filter($this->entityManager->getFieldDefinitions($this->entity->getTargetEntityTypeId(), $this->entity->getTargetBundle()), function (FieldDefinitionInterface $field_definition) use ($context) {
 | 
			
		||||
      return $field_definition->isDisplayConfigurable($context);
 | 
			
		||||
    });
 | 
			
		||||
  }
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -85,7 +85,7 @@ class ManageDisplayTest extends WebTestBase {
 | 
			
		|||
 | 
			
		||||
    // Check whether formatter weights are respected.
 | 
			
		||||
    $result = $this->xpath('//select[@id=:id]/option', [':id' => 'edit-fields-field-test-type']);
 | 
			
		||||
    $options = array_map(function($item) {
 | 
			
		||||
    $options = array_map(function ($item) {
 | 
			
		||||
      return (string) $item->attributes()->value[0];
 | 
			
		||||
    }, $result);
 | 
			
		||||
    $expected_options = [
 | 
			
		||||
| 
						 | 
				
			
			@ -247,7 +247,7 @@ class ManageDisplayTest extends WebTestBase {
 | 
			
		|||
 | 
			
		||||
    // Check whether widget weights are respected.
 | 
			
		||||
    $result = $this->xpath('//select[@id=:id]/option', [':id' => 'edit-fields-field-test-type']);
 | 
			
		||||
    $options = array_map(function($item) {
 | 
			
		||||
    $options = array_map(function ($item) {
 | 
			
		||||
      return (string) $item->attributes()->value[0];
 | 
			
		||||
    }, $result);
 | 
			
		||||
    $expected_options = [
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -1208,7 +1208,7 @@ function file_managed_file_save_upload($element, FormStateInterface $form_state)
 | 
			
		|||
 | 
			
		||||
    // Value callback expects FIDs to be keys.
 | 
			
		||||
    $files = array_filter($files);
 | 
			
		||||
    $fids = array_map(function($file) {
 | 
			
		||||
    $fids = array_map(function ($file) {
 | 
			
		||||
      return $file->id();
 | 
			
		||||
    }, $files);
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -25,7 +25,7 @@ class UploadInstance extends DrupalSqlBase {
 | 
			
		|||
      ->fields('nt', ['type'])
 | 
			
		||||
      ->execute()
 | 
			
		||||
      ->fetchCol();
 | 
			
		||||
    $variables = array_map(function($type) {
 | 
			
		||||
    $variables = array_map(function ($type) {
 | 
			
		||||
      return 'upload_' . $type;
 | 
			
		||||
    }, $node_types);
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -38,7 +38,7 @@ class FileCckTest extends UnitTestCase {
 | 
			
		|||
    // process pipeline created by the plugin, we need to ensure that
 | 
			
		||||
    // getProcess() always returns the last input to mergeProcessOfProperty().
 | 
			
		||||
    $migration->mergeProcessOfProperty(Argument::type('string'), Argument::type('array'))
 | 
			
		||||
      ->will(function($arguments) use ($migration) {
 | 
			
		||||
      ->will(function ($arguments) use ($migration) {
 | 
			
		||||
        $migration->getProcess()->willReturn($arguments[1]);
 | 
			
		||||
      });
 | 
			
		||||
    $this->migration = $migration->reveal();
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -38,7 +38,7 @@ class FileCckTest extends UnitTestCase {
 | 
			
		|||
    // process pipeline created by the plugin, we need to ensure that
 | 
			
		||||
    // getProcess() always returns the last input to mergeProcessOfProperty().
 | 
			
		||||
    $migration->mergeProcessOfProperty(Argument::type('string'), Argument::type('array'))
 | 
			
		||||
      ->will(function($arguments) use ($migration) {
 | 
			
		||||
      ->will(function ($arguments) use ($migration) {
 | 
			
		||||
        $migration->getProcess()->willReturn($arguments[1]);
 | 
			
		||||
      });
 | 
			
		||||
    $this->migration = $migration->reveal();
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -37,7 +37,7 @@ class ImageCckTest extends UnitTestCase {
 | 
			
		|||
    // process pipeline created by the plugin, we need to ensure that
 | 
			
		||||
    // getProcess() always returns the last input to mergeProcessOfProperty().
 | 
			
		||||
    $migration->mergeProcessOfProperty(Argument::type('string'), Argument::type('array'))
 | 
			
		||||
      ->will(function($arguments) use ($migration) {
 | 
			
		||||
      ->will(function ($arguments) use ($migration) {
 | 
			
		||||
        $migration->getProcess()->willReturn($arguments[1]);
 | 
			
		||||
      });
 | 
			
		||||
    $this->migration = $migration->reveal();
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -37,7 +37,7 @@ class FileFieldTest extends UnitTestCase {
 | 
			
		|||
    // process pipeline created by the plugin, we need to ensure that
 | 
			
		||||
    // getProcess() always returns the last input to mergeProcessOfProperty().
 | 
			
		||||
    $migration->mergeProcessOfProperty(Argument::type('string'), Argument::type('array'))
 | 
			
		||||
      ->will(function($arguments) use ($migration) {
 | 
			
		||||
      ->will(function ($arguments) use ($migration) {
 | 
			
		||||
        $migration->getProcess()->willReturn($arguments[1]);
 | 
			
		||||
      });
 | 
			
		||||
    $this->migration = $migration->reveal();
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -37,7 +37,7 @@ class FileFieldTest extends UnitTestCase {
 | 
			
		|||
    // process pipeline created by the plugin, we need to ensure that
 | 
			
		||||
    // getProcess() always returns the last input to mergeProcessOfProperty().
 | 
			
		||||
    $migration->mergeProcessOfProperty(Argument::type('string'), Argument::type('array'))
 | 
			
		||||
      ->will(function($arguments) use ($migration) {
 | 
			
		||||
      ->will(function ($arguments) use ($migration) {
 | 
			
		||||
        $migration->getProcess()->willReturn($arguments[1]);
 | 
			
		||||
      });
 | 
			
		||||
    $this->migration = $migration->reveal();
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -36,7 +36,7 @@ class ImageFieldTest extends UnitTestCase {
 | 
			
		|||
    // process pipeline created by the plugin, we need to ensure that
 | 
			
		||||
    // getProcess() always returns the last input to mergeProcessOfProperty().
 | 
			
		||||
    $migration->mergeProcessOfProperty(Argument::type('string'), Argument::type('array'))
 | 
			
		||||
      ->will(function($arguments) use ($migration) {
 | 
			
		||||
      ->will(function ($arguments) use ($migration) {
 | 
			
		||||
        $migration->getProcess()->willReturn($arguments[1]);
 | 
			
		||||
      });
 | 
			
		||||
    $this->migration = $migration->reveal();
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -82,7 +82,7 @@ class ProcessedText extends RenderElement {
 | 
			
		|||
      return $element;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    $filter_must_be_applied = function(FilterInterface $filter) use ($filter_types_to_skip) {
 | 
			
		||||
    $filter_must_be_applied = function (FilterInterface $filter) use ($filter_types_to_skip) {
 | 
			
		||||
      $enabled = $filter->status === TRUE;
 | 
			
		||||
      $type = $filter->getType();
 | 
			
		||||
      // Prevent FilterInterface::TYPE_HTML_RESTRICTOR from being skipped.
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -269,7 +269,7 @@ class FilterFormat extends ConfigEntityBase implements FilterFormatInterface, En
 | 
			
		|||
   */
 | 
			
		||||
  public function getHtmlRestrictions() {
 | 
			
		||||
    // Ignore filters that are disabled or don't have HTML restrictions.
 | 
			
		||||
    $filters = array_filter($this->filters()->getAll(), function($filter) {
 | 
			
		||||
    $filters = array_filter($this->filters()->getAll(), function ($filter) {
 | 
			
		||||
      if (!$filter->status) {
 | 
			
		||||
        return FALSE;
 | 
			
		||||
      }
 | 
			
		||||
| 
						 | 
				
			
			@ -286,7 +286,7 @@ class FilterFormat extends ConfigEntityBase implements FilterFormatInterface, En
 | 
			
		|||
      // From the set of remaining filters (they were filtered by array_filter()
 | 
			
		||||
      // above), collect the list of tags and attributes that are allowed by all
 | 
			
		||||
      // filters, i.e. the intersection of all allowed tags and attributes.
 | 
			
		||||
      $restrictions = array_reduce($filters, function($restrictions, $filter) {
 | 
			
		||||
      $restrictions = array_reduce($filters, function ($restrictions, $filter) {
 | 
			
		||||
        $new_restrictions = $filter->getHTMLRestrictions();
 | 
			
		||||
 | 
			
		||||
        // The first filter with HTML restrictions provides the initial set.
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -22,7 +22,7 @@ class FilterTestRestrictTagsAndAttributes extends FilterBase {
 | 
			
		|||
   * {@inheritdoc}
 | 
			
		||||
   */
 | 
			
		||||
  public function process($text, $langcode) {
 | 
			
		||||
    $allowed_tags = array_filter($this->settings['restrictions']['allowed'], function($value) {
 | 
			
		||||
    $allowed_tags = array_filter($this->settings['restrictions']['allowed'], function ($value) {
 | 
			
		||||
      return is_array($value) || (bool) $value !== FALSE;
 | 
			
		||||
    });
 | 
			
		||||
    return new FilterProcessResult(Xss::filter($text, array_keys($allowed_tags)));
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -44,7 +44,7 @@ class FilterKernelTest extends KernelTestBase {
 | 
			
		|||
  public function testAlignFilter() {
 | 
			
		||||
    $filter = $this->filters['filter_align'];
 | 
			
		||||
 | 
			
		||||
    $test = function($input) use ($filter) {
 | 
			
		||||
    $test = function ($input) use ($filter) {
 | 
			
		||||
      return $filter->process($input, 'und');
 | 
			
		||||
    };
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			@ -101,7 +101,7 @@ class FilterKernelTest extends KernelTestBase {
 | 
			
		|||
    $renderer = \Drupal::service('renderer');
 | 
			
		||||
    $filter = $this->filters['filter_caption'];
 | 
			
		||||
 | 
			
		||||
    $test = function($input) use ($filter, $renderer) {
 | 
			
		||||
    $test = function ($input) use ($filter, $renderer) {
 | 
			
		||||
      return $renderer->executeInRenderContext(new RenderContext(), function () use ($input, $filter) {
 | 
			
		||||
        return $filter->process($input, 'und');
 | 
			
		||||
      });
 | 
			
		||||
| 
						 | 
				
			
			@ -266,7 +266,7 @@ class FilterKernelTest extends KernelTestBase {
 | 
			
		|||
    $align_filter = $this->filters['filter_align'];
 | 
			
		||||
    $caption_filter = $this->filters['filter_caption'];
 | 
			
		||||
 | 
			
		||||
    $test = function($input) use ($align_filter, $caption_filter, $renderer) {
 | 
			
		||||
    $test = function ($input) use ($align_filter, $caption_filter, $renderer) {
 | 
			
		||||
      return $renderer->executeInRenderContext(new RenderContext(), function () use ($input, $align_filter, $caption_filter) {
 | 
			
		||||
        return $caption_filter->process($align_filter->process($input, 'und'), 'und');
 | 
			
		||||
      });
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -147,7 +147,7 @@ class PathProcessorLanguage implements InboundPathProcessorInterface, OutboundPa
 | 
			
		|||
 | 
			
		||||
    // Sort the processors list, so that their functions are called in the
 | 
			
		||||
    // order specified by the weight of the methods.
 | 
			
		||||
    uksort($this->processors[$scope], function ($method_id_a, $method_id_b) use($weights) {
 | 
			
		||||
    uksort($this->processors[$scope], function ($method_id_a, $method_id_b) use ($weights) {
 | 
			
		||||
      $a_weight = $weights[$method_id_a];
 | 
			
		||||
      $b_weight = $weights[$method_id_b];
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -70,7 +70,7 @@ class LanguageServiceProvider extends ServiceProviderBase {
 | 
			
		|||
    //   and caching. This might prove difficult as this is called before the
 | 
			
		||||
    //   container has finished building.
 | 
			
		||||
    $config_storage = BootstrapConfigStorageFactory::get();
 | 
			
		||||
    $config_ids = array_filter($config_storage->listAll($prefix), function($config_id) use ($prefix) {
 | 
			
		||||
    $config_ids = array_filter($config_storage->listAll($prefix), function ($config_id) use ($prefix) {
 | 
			
		||||
      return $config_id != $prefix . LanguageInterface::LANGCODE_NOT_SPECIFIED && $config_id != $prefix . LanguageInterface::LANGCODE_NOT_APPLICABLE;
 | 
			
		||||
    });
 | 
			
		||||
    return count($config_ids) > 1;
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -104,7 +104,7 @@ class Language extends ConditionPluginBase implements ContainerFactoryPluginInte
 | 
			
		|||
    $language_list = $this->languageManager->getLanguages(LanguageInterface::STATE_ALL);
 | 
			
		||||
    $selected = $this->configuration['langcodes'];
 | 
			
		||||
    // Reduce the language list to an array of language names.
 | 
			
		||||
    $language_names = array_reduce($language_list, function(&$result, $item) use ($selected) {
 | 
			
		||||
    $language_names = array_reduce($language_list, function (&$result, $item) use ($selected) {
 | 
			
		||||
      // If the current item of the $language_list array is one of the selected
 | 
			
		||||
      // languages, add it to the $results array.
 | 
			
		||||
      if (!empty($selected[$item->getId()])) {
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -44,7 +44,7 @@ class LinkCckTest extends KernelTestBase {
 | 
			
		|||
    // process pipeline created by the plugin, we need to ensure that
 | 
			
		||||
    // getProcess() always returns the last input to mergeProcessOfProperty().
 | 
			
		||||
    $migration->mergeProcessOfProperty(Argument::type('string'), Argument::type('array'))
 | 
			
		||||
      ->will(function($arguments) use ($migration) {
 | 
			
		||||
      ->will(function ($arguments) use ($migration) {
 | 
			
		||||
        $migration->getProcess()->willReturn($arguments[1]);
 | 
			
		||||
      });
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -43,7 +43,7 @@ class LinkFieldTest extends KernelTestBase {
 | 
			
		|||
    // process pipeline created by the plugin, we need to ensure that
 | 
			
		||||
    // getProcess() always returns the last input to mergeProcessOfProperty().
 | 
			
		||||
    $migration->mergeProcessOfProperty(Argument::type('string'), Argument::type('array'))
 | 
			
		||||
      ->will(function($arguments) use ($migration) {
 | 
			
		||||
      ->will(function ($arguments) use ($migration) {
 | 
			
		||||
        $migration->getProcess()->willReturn($arguments[1]);
 | 
			
		||||
      });
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -37,7 +37,7 @@ class LinkCckTest extends UnitTestCase {
 | 
			
		|||
    // process pipeline created by the plugin, we need to ensure that
 | 
			
		||||
    // getProcess() always returns the last input to mergeProcessOfProperty().
 | 
			
		||||
    $migration->mergeProcessOfProperty(Argument::type('string'), Argument::type('array'))
 | 
			
		||||
      ->will(function($arguments) use ($migration) {
 | 
			
		||||
      ->will(function ($arguments) use ($migration) {
 | 
			
		||||
        $migration->getProcess()->willReturn($arguments[1]);
 | 
			
		||||
      });
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -36,7 +36,7 @@ class LinkFieldTest extends UnitTestCase {
 | 
			
		|||
    // process pipeline created by the plugin, we need to ensure that
 | 
			
		||||
    // getProcess() always returns the last input to mergeProcessOfProperty().
 | 
			
		||||
    $migration->mergeProcessOfProperty(Argument::type('string'), Argument::type('array'))
 | 
			
		||||
      ->will(function($arguments) use ($migration) {
 | 
			
		||||
      ->will(function ($arguments) use ($migration) {
 | 
			
		||||
        $migration->getProcess()->willReturn($arguments[1]);
 | 
			
		||||
      });
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -240,7 +240,7 @@ function locale_translation_http_check($uri) {
 | 
			
		|||
    $actual_uri = NULL;
 | 
			
		||||
    $response = \Drupal::service('http_client_factory')->fromOptions([
 | 
			
		||||
      'allow_redirects' => [
 | 
			
		||||
        'on_redirect' => function(RequestInterface $request, ResponseInterface $response, UriInterface $request_uri) use (&$actual_uri) {
 | 
			
		||||
        'on_redirect' => function (RequestInterface $request, ResponseInterface $response, UriInterface $request_uri) use (&$actual_uri) {
 | 
			
		||||
          $actual_uri = (string) $request_uri;
 | 
			
		||||
        }
 | 
			
		||||
      ],
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -67,7 +67,7 @@ function locale_translation_get_projects(array $project_names = []) {
 | 
			
		|||
      locale_translation_build_projects();
 | 
			
		||||
    }
 | 
			
		||||
    $projects = \Drupal::service('locale.project')->getAll();
 | 
			
		||||
    array_walk($projects, function(&$project) {
 | 
			
		||||
    array_walk($projects, function (&$project) {
 | 
			
		||||
      $project = (object) $project;
 | 
			
		||||
    });
 | 
			
		||||
  }
 | 
			
		||||
| 
						 | 
				
			
			@ -329,7 +329,7 @@ function locale_cron_fill_queue() {
 | 
			
		|||
  // Determine which project+language should be updated.
 | 
			
		||||
  $last = REQUEST_TIME - $config->get('translation.update_interval_days') * 3600 * 24;
 | 
			
		||||
  $projects = \Drupal::service('locale.project')->getAll();
 | 
			
		||||
  $projects = array_filter($projects, function($project) {
 | 
			
		||||
  $projects = array_filter($projects, function ($project) {
 | 
			
		||||
    return $project['status'] == 1;
 | 
			
		||||
  });
 | 
			
		||||
  $files = db_select('locale_file', 'f')
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -221,7 +221,7 @@ class MenuForm extends EntityForm {
 | 
			
		|||
    $this->getRequest()->attributes->set('_menu_admin', FALSE);
 | 
			
		||||
 | 
			
		||||
    // Determine the delta; the number of weights to be made available.
 | 
			
		||||
    $count = function(array $tree) {
 | 
			
		||||
    $count = function (array $tree) {
 | 
			
		||||
      $sum = function ($carry, MenuLinkTreeElement $item) {
 | 
			
		||||
        return $carry + $item->count();
 | 
			
		||||
      };
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -64,7 +64,7 @@ class MigrationPluginManager extends DefaultPluginManager implements MigrationPl
 | 
			
		|||
   */
 | 
			
		||||
  protected function getDiscovery() {
 | 
			
		||||
    if (!isset($this->discovery)) {
 | 
			
		||||
      $directories = array_map(function($directory) {
 | 
			
		||||
      $directories = array_map(function ($directory) {
 | 
			
		||||
        return [$directory . '/migration_templates', $directory . '/migrations'];
 | 
			
		||||
      }, $this->moduleHandler->getModuleDirectories());
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			@ -125,7 +125,7 @@ class MigrationPluginManager extends DefaultPluginManager implements MigrationPl
 | 
			
		|||
   *   An array of migration objects with the given tag.
 | 
			
		||||
   */
 | 
			
		||||
  public function createInstancesByTag($tag) {
 | 
			
		||||
    $migrations = array_filter($this->getDefinitions(), function($migration) use ($tag) {
 | 
			
		||||
    $migrations = array_filter($this->getDefinitions(), function ($migration) use ($tag) {
 | 
			
		||||
      return !empty($migration['migration_tags']) && in_array($tag, $migration['migration_tags']);
 | 
			
		||||
    });
 | 
			
		||||
    return $this->createInstances(array_keys($migrations));
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -39,7 +39,7 @@ abstract class MigrateSqlSourceTestBase extends MigrateSourceTestBase {
 | 
			
		|||
        ->createTable($table, [
 | 
			
		||||
          // SQLite uses loose affinity typing, so it's OK for every field to
 | 
			
		||||
          // be a text field.
 | 
			
		||||
          'fields' => array_map(function() {
 | 
			
		||||
          'fields' => array_map(function () {
 | 
			
		||||
            return ['type' => 'text'];
 | 
			
		||||
          }, $pilot),
 | 
			
		||||
        ]);
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -230,7 +230,7 @@ abstract class MigrateTestBase extends KernelTestBase implements MigrateMessageI
 | 
			
		|||
      $migration = $this->getMigration($migration);
 | 
			
		||||
    }
 | 
			
		||||
    /** @var \Drupal\migrate\Plugin\MigrationInterface $migration */
 | 
			
		||||
    $destination = array_map(function() {
 | 
			
		||||
    $destination = array_map(function () {
 | 
			
		||||
      return NULL;
 | 
			
		||||
    }, $migration->getDestinationPlugin()->getIds());
 | 
			
		||||
    $row = new Row($row, $migration->getSourcePlugin()->getIds());
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -61,12 +61,12 @@ abstract class MigrateTestCase extends UnitTestCase {
 | 
			
		|||
    // on the test class and use a return callback.
 | 
			
		||||
    $migration->expects($this->any())
 | 
			
		||||
      ->method('getStatus')
 | 
			
		||||
      ->willReturnCallback(function() {
 | 
			
		||||
      ->willReturnCallback(function () {
 | 
			
		||||
        return $this->migrationStatus;
 | 
			
		||||
      });
 | 
			
		||||
    $migration->expects($this->any())
 | 
			
		||||
      ->method('setStatus')
 | 
			
		||||
      ->willReturnCallback(function($status) {
 | 
			
		||||
      ->willReturnCallback(function ($status) {
 | 
			
		||||
        $this->migrationStatus = $status;
 | 
			
		||||
      });
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			@ -147,7 +147,7 @@ abstract class MigrateTestCase extends UnitTestCase {
 | 
			
		|||
  protected function createSchemaFromRow(array $row) {
 | 
			
		||||
    // SQLite uses loose ("affinity") typing, so it is OK for every column to be
 | 
			
		||||
    // a text field.
 | 
			
		||||
    $fields = array_map(function() {
 | 
			
		||||
    $fields = array_map(function () {
 | 
			
		||||
      return ['type' => 'text'];
 | 
			
		||||
    }, $row);
 | 
			
		||||
    return ['fields' => $fields];
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -114,7 +114,7 @@ class EntityContentBaseTest extends MigrateDrupal6TestBase {
 | 
			
		|||
    $message = $this->prophesize(MigrateMessageInterface::class);
 | 
			
		||||
    // Match the expected message. Can't use default argument types, because
 | 
			
		||||
    // we need to convert to string from TranslatableMarkup.
 | 
			
		||||
    $argument = Argument::that(function($msg) {
 | 
			
		||||
    $argument = Argument::that(function ($msg) {
 | 
			
		||||
      return strpos((string) $msg, "This entity type does not support translation") !== FALSE;
 | 
			
		||||
    });
 | 
			
		||||
    $message->display($argument, Argument::any())
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -77,7 +77,7 @@ function quickedit_library_info_alter(&$libraries, $extension) {
 | 
			
		|||
    $theme = Drupal::config('system.theme')->get('admin');
 | 
			
		||||
 | 
			
		||||
    // First let the base theme modify the library, then the actual theme.
 | 
			
		||||
    $alter_library = function(&$library, $theme) use (&$alter_library) {
 | 
			
		||||
    $alter_library = function (&$library, $theme) use (&$alter_library) {
 | 
			
		||||
      if (isset($theme) && $theme_path = drupal_get_path('theme', $theme)) {
 | 
			
		||||
        $info = system_get_info('theme', $theme);
 | 
			
		||||
        // Recurse to process base theme(s) first.
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -13,7 +13,7 @@ use Drupal\Core\Entity\Entity\EntityViewDisplay;
 | 
			
		|||
 */
 | 
			
		||||
function responsive_image_post_update_recreate_dependencies() {
 | 
			
		||||
  $displays = EntityViewDisplay::loadMultiple();
 | 
			
		||||
  array_walk($displays, function(EntityViewDisplayInterface $entity_view_display) {
 | 
			
		||||
  array_walk($displays, function (EntityViewDisplayInterface $entity_view_display) {
 | 
			
		||||
    $old_dependencies = $entity_view_display->getDependencies();
 | 
			
		||||
    $new_dependencies = $entity_view_display->calculateDependencies()->getDependencies();
 | 
			
		||||
    if ($old_dependencies !== $new_dependencies) {
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -407,7 +407,7 @@ class RestExport extends PathPluginBase implements ResponseDisplayPluginInterfac
 | 
			
		|||
   */
 | 
			
		||||
  public function render() {
 | 
			
		||||
    $build = [];
 | 
			
		||||
    $build['#markup'] = $this->renderer->executeInRenderContext(new RenderContext(), function() {
 | 
			
		||||
    $build['#markup'] = $this->renderer->executeInRenderContext(new RenderContext(), function () {
 | 
			
		||||
      return $this->view->style_plugin->render();
 | 
			
		||||
    });
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -184,7 +184,7 @@ class DataFieldRow extends RowPluginBase {
 | 
			
		|||
   *   A regular one dimensional array of values.
 | 
			
		||||
   */
 | 
			
		||||
  protected static function extractFromOptionsArray($key, $options) {
 | 
			
		||||
    return array_map(function($item) use ($key) {
 | 
			
		||||
    return array_map(function ($item) use ($key) {
 | 
			
		||||
      return isset($item[$key]) ? $item[$key] : NULL;
 | 
			
		||||
    }, $options);
 | 
			
		||||
  }
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -667,7 +667,7 @@ class StyleSerializerTest extends ViewTestBase {
 | 
			
		|||
 | 
			
		||||
    $result = Json::decode($this->drupalGet('test/serialize/node-field', ['query' => ['_format' => 'json']]));
 | 
			
		||||
    $this->assertEqual(count($result[2]['body']), $node->body->count(), 'Expected count of values');
 | 
			
		||||
    $this->assertEqual($result[2]['body'], array_map(function($item) {
 | 
			
		||||
    $this->assertEqual($result[2]['body'], array_map(function ($item) {
 | 
			
		||||
      return $item['value'];
 | 
			
		||||
    }, $node->body->getValue()), 'Expected raw body values found.');
 | 
			
		||||
  }
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -36,7 +36,7 @@ abstract class NormalizerBase extends SerializerAwareNormalizer implements Norma
 | 
			
		|||
 | 
			
		||||
    $supported = (array) $this->supportedInterfaceOrClass;
 | 
			
		||||
 | 
			
		||||
    return (bool) array_filter($supported, function($name) use ($data) {
 | 
			
		||||
    return (bool) array_filter($supported, function ($name) use ($data) {
 | 
			
		||||
      return $data instanceof $name;
 | 
			
		||||
    });
 | 
			
		||||
  }
 | 
			
		||||
| 
						 | 
				
			
			@ -56,7 +56,7 @@ abstract class NormalizerBase extends SerializerAwareNormalizer implements Norma
 | 
			
		|||
 | 
			
		||||
    $supported = (array) $this->supportedInterfaceOrClass;
 | 
			
		||||
 | 
			
		||||
    $subclass_check = function($name) use ($type) {
 | 
			
		||||
    $subclass_check = function ($name) use ($type) {
 | 
			
		||||
      return (class_exists($name) || interface_exists($name)) && is_subclass_of($type, $name, TRUE);
 | 
			
		||||
    };
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -345,7 +345,7 @@ function simpletest_phpunit_run_command(array $unescaped_test_classnames, $phpun
 | 
			
		|||
  }
 | 
			
		||||
  else {
 | 
			
		||||
    // Double escape namespaces so they'll work in a regexp.
 | 
			
		||||
    $escaped_test_classnames = array_map(function($class) {
 | 
			
		||||
    $escaped_test_classnames = array_map(function ($class) {
 | 
			
		||||
      return addslashes($class);
 | 
			
		||||
    }, $unescaped_test_classnames);
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -874,7 +874,7 @@ trait AssertContentTrait {
 | 
			
		|||
    // The string cast is necessary because theme functions return
 | 
			
		||||
    // MarkupInterface objects. This means we can assert that $expected
 | 
			
		||||
    // matches the theme output without having to worry about 0 == ''.
 | 
			
		||||
    $output = (string) $renderer->executeInRenderContext(new RenderContext(), function() use ($callback, $variables) {
 | 
			
		||||
    $output = (string) $renderer->executeInRenderContext(new RenderContext(), function () use ($callback, $variables) {
 | 
			
		||||
      return \Drupal::theme()->render($callback, $variables);
 | 
			
		||||
    });
 | 
			
		||||
    $this->verbose(
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -110,7 +110,7 @@ class SystemManager {
 | 
			
		|||
 | 
			
		||||
    // Check run-time requirements and status information.
 | 
			
		||||
    $requirements = $this->moduleHandler->invokeAll('requirements', ['runtime']);
 | 
			
		||||
    uasort($requirements, function($a, $b) {
 | 
			
		||||
    uasort($requirements, function ($a, $b) {
 | 
			
		||||
      if (!isset($a['weight'])) {
 | 
			
		||||
        if (!isset($b['weight'])) {
 | 
			
		||||
          return strcasecmp($a['title'], $b['title']);
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -124,7 +124,7 @@ class CommandsTest extends AjaxTestBase {
 | 
			
		|||
   * Regression test: Settings command exists regardless of JS aggregation.
 | 
			
		||||
   */
 | 
			
		||||
  public function testAttachedSettings() {
 | 
			
		||||
    $assert = function($message) {
 | 
			
		||||
    $assert = function ($message) {
 | 
			
		||||
      $response = new AjaxResponse();
 | 
			
		||||
      $response->setAttachments([
 | 
			
		||||
        'library' => ['core/drupalSettings'],
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -15,7 +15,7 @@ class ErrorContainer extends Container {
 | 
			
		|||
  public function get($id, $invalidBehavior = self::EXCEPTION_ON_INVALID_REFERENCE) {
 | 
			
		||||
    if ($id === 'http_kernel') {
 | 
			
		||||
      // Enforce a recoverable error.
 | 
			
		||||
      $callable = function(ErrorContainer $container) {
 | 
			
		||||
      $callable = function (ErrorContainer $container) {
 | 
			
		||||
      };
 | 
			
		||||
      $callable(1);
 | 
			
		||||
    }
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -168,7 +168,7 @@ class UrlTest extends WebTestBase {
 | 
			
		|||
    $l = \Drupal::l('foo', Url::fromUri('https://www.drupal.org'));
 | 
			
		||||
 | 
			
		||||
    // Test a renderable array passed to the link generator.
 | 
			
		||||
    $renderer->executeInRenderContext(new RenderContext(), function() use ($renderer, $l) {
 | 
			
		||||
    $renderer->executeInRenderContext(new RenderContext(), function () use ($renderer, $l) {
 | 
			
		||||
      $renderable_text = ['#markup' => 'foo'];
 | 
			
		||||
      $l_renderable_text = \Drupal::l($renderable_text, Url::fromUri('https://www.drupal.org'));
 | 
			
		||||
      $this->assertEqual($l_renderable_text, $l);
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -56,7 +56,7 @@ class ErrorTestController extends ControllerBase {
 | 
			
		|||
   * Generate fatals to test the error handler.
 | 
			
		||||
   */
 | 
			
		||||
  public function generateFatals() {
 | 
			
		||||
    $function = function(array $test) {
 | 
			
		||||
    $function = function (array $test) {
 | 
			
		||||
    };
 | 
			
		||||
 | 
			
		||||
    $function("test-string");
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -42,7 +42,7 @@ class EntityViewControllerTest extends BrowserTestBase {
 | 
			
		|||
   * Tests EntityViewController.
 | 
			
		||||
   */
 | 
			
		||||
  public function testEntityViewController() {
 | 
			
		||||
    $get_label_markup = function($label) {
 | 
			
		||||
    $get_label_markup = function ($label) {
 | 
			
		||||
      return '<h1 class="page-title">
 | 
			
		||||
            <div class="field field--name-name field--type-string field--label-hidden field__item">' . $label . '</div>
 | 
			
		||||
      </h1>';
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -191,7 +191,7 @@ class PathBasedBreadcrumbBuilderTest extends UnitTestCase {
 | 
			
		|||
 | 
			
		||||
    $this->requestMatcher->expects($this->exactly(1))
 | 
			
		||||
      ->method('matchRequest')
 | 
			
		||||
      ->will($this->returnCallback(function(Request $request) use ($route_1) {
 | 
			
		||||
      ->will($this->returnCallback(function (Request $request) use ($route_1) {
 | 
			
		||||
        if ($request->getPathInfo() == '/example') {
 | 
			
		||||
          return [
 | 
			
		||||
            RouteObjectInterface::ROUTE_NAME => 'example',
 | 
			
		||||
| 
						 | 
				
			
			@ -227,7 +227,7 @@ class PathBasedBreadcrumbBuilderTest extends UnitTestCase {
 | 
			
		|||
 | 
			
		||||
    $this->requestMatcher->expects($this->exactly(2))
 | 
			
		||||
      ->method('matchRequest')
 | 
			
		||||
      ->will($this->returnCallback(function(Request $request) use ($route_1, $route_2) {
 | 
			
		||||
      ->will($this->returnCallback(function (Request $request) use ($route_1, $route_2) {
 | 
			
		||||
        if ($request->getPathInfo() == '/example/bar') {
 | 
			
		||||
          return [
 | 
			
		||||
            RouteObjectInterface::ROUTE_NAME => 'example_bar',
 | 
			
		||||
| 
						 | 
				
			
			@ -357,7 +357,7 @@ class PathBasedBreadcrumbBuilderTest extends UnitTestCase {
 | 
			
		|||
 | 
			
		||||
    $this->requestMatcher->expects($this->exactly(1))
 | 
			
		||||
      ->method('matchRequest')
 | 
			
		||||
      ->will($this->returnCallback(function(Request $request) use ($route_1) {
 | 
			
		||||
      ->will($this->returnCallback(function (Request $request) use ($route_1) {
 | 
			
		||||
        if ($request->getPathInfo() == '/user/1') {
 | 
			
		||||
          return [
 | 
			
		||||
            RouteObjectInterface::ROUTE_NAME => 'user_page',
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -137,7 +137,7 @@ class MenuLinkTreeTest extends UnitTestCase {
 | 
			
		|||
      ]
 | 
			
		||||
    ];
 | 
			
		||||
 | 
			
		||||
    $get_built_element = function(MenuLinkTreeElement $element) {
 | 
			
		||||
    $get_built_element = function (MenuLinkTreeElement $element) {
 | 
			
		||||
      $return = [
 | 
			
		||||
        'attributes' => new Attribute(),
 | 
			
		||||
        'title' => $element->link->getTitle(),
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -37,7 +37,7 @@ class TaxonomyTermReferenceCckTest extends UnitTestCase {
 | 
			
		|||
    // process pipeline created by the plugin, we need to ensure that
 | 
			
		||||
    // getProcess() always returns the last input to setProcessOfProperty().
 | 
			
		||||
    $migration->setProcessOfProperty(Argument::type('string'), Argument::type('array'))
 | 
			
		||||
      ->will(function($arguments) use ($migration) {
 | 
			
		||||
      ->will(function ($arguments) use ($migration) {
 | 
			
		||||
        $migration->getProcess()->willReturn($arguments[1]);
 | 
			
		||||
      });
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -36,7 +36,7 @@ class TaxonomyTermReferenceFieldTest extends UnitTestCase {
 | 
			
		|||
    // process pipeline created by the plugin, we need to ensure that
 | 
			
		||||
    // getProcess() always returns the last input to setProcessOfProperty().
 | 
			
		||||
    $migration->setProcessOfProperty(Argument::type('string'), Argument::type('array'))
 | 
			
		||||
      ->will(function($arguments) use ($migration) {
 | 
			
		||||
      ->will(function ($arguments) use ($migration) {
 | 
			
		||||
        $migration->getProcess()->willReturn($arguments[1]);
 | 
			
		||||
      });
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -38,7 +38,7 @@ class TextCckTest extends UnitTestCase {
 | 
			
		|||
    // process pipeline created by the plugin, we need to ensure that
 | 
			
		||||
    // getProcess() always returns the last input to setProcessOfProperty().
 | 
			
		||||
    $migration->setProcessOfProperty(Argument::type('string'), Argument::type('array'))
 | 
			
		||||
      ->will(function($arguments) use ($migration) {
 | 
			
		||||
      ->will(function ($arguments) use ($migration) {
 | 
			
		||||
        $migration->getProcess()->willReturn($arguments[1]);
 | 
			
		||||
      });
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -38,7 +38,7 @@ class TextFieldTest extends UnitTestCase {
 | 
			
		|||
    // process pipeline created by the plugin, we need to ensure that
 | 
			
		||||
    // getProcess() always returns the last input to setProcessOfProperty().
 | 
			
		||||
    $migration->setProcessOfProperty(Argument::type('string'), Argument::type('array'))
 | 
			
		||||
      ->will(function($arguments) use ($migration) {
 | 
			
		||||
      ->will(function ($arguments) use ($migration) {
 | 
			
		||||
        $migration->getProcess()->willReturn($arguments[1]);
 | 
			
		||||
      });
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -38,7 +38,7 @@ class TextCckTest extends UnitTestCase {
 | 
			
		|||
    // process pipeline created by the plugin, we need to ensure that
 | 
			
		||||
    // getProcess() always returns the last input to setProcessOfProperty().
 | 
			
		||||
    $migration->setProcessOfProperty(Argument::type('string'), Argument::type('array'))
 | 
			
		||||
      ->will(function($arguments) use ($migration) {
 | 
			
		||||
      ->will(function ($arguments) use ($migration) {
 | 
			
		||||
        $migration->getProcess()->willReturn($arguments[1]);
 | 
			
		||||
      });
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
Some files were not shown because too many files have changed in this diff Show More
		Loading…
	
		Reference in New Issue