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