Commit 7c4ca8fc authored by jrockowitz's avatar jrockowitz Committed by jrockowitz

Issue #2982679 by jrockowitz: Release 8.x-5.0-rc16

parent a930d6e4
......@@ -89,7 +89,7 @@ function _webform_update_webform_settings() {
* Update webform setting to reflect changes in the default settings.
*
* @param array $data
* A webform's raw configuration data from webform.webform.*.yml
* A webform's raw configuration data from webform.webform.*.yml.
*
* @return array
* Updated raw configuration data.
......@@ -280,7 +280,7 @@ function _webform_update_webform_submission_storage_schema() {
}
/**
* Replace string in webform.settings.yml and webform.webform.*.yml
* Replace string in webform.settings.yml and webform.webform.*.yml.
*
* @param string $search
* String to be search for.
......
......@@ -2138,7 +2138,7 @@ function webform_update_8117() {
$config = \Drupal::configFactory()->getEditable('webform.settings');
$names = Yaml::decode($config->get('test.names'));
$names += [
'postal_code' => ['11111', '12345', '12345-6789']
'postal_code' => ['11111', '12345', '12345-6789'],
];
$config->set('test.names', WebformYaml::tidy(Yaml::encode($names)));
$config->save();
......@@ -2186,7 +2186,7 @@ function webform_update_8121() {
}
/**
* Issue #2952419: Attached files are deleted without usage checking
* Issue #2952419: Attached files are deleted without usage checking.
*/
function webform_update_8122() {
_webform_update_admin_settings();
......
......@@ -54,7 +54,6 @@ class WebformExampleElement extends WebformElementBase {
// @see \Drupal\webform_example_element\Element\WebformExampleElement::processWebformElementExample
}
/**
* {@inheritdoc}
*/
......
......@@ -88,7 +88,7 @@ class WebformImageSelectImagesListBuilder extends ConfigEntityListBuilder {
/**
* Build images for a webform image select images entity.
*
* @param \Drupal\webform_image_select\WebformImageSelectImagesInterface $webform_images
* @param \Drupal\webform_image_select\WebformImageSelectImagesInterface $entity
* A webform image select images entity.
*
* @return array
......
......@@ -55,7 +55,7 @@ abstract class WebformNodeTestBase extends WebformTestBase {
* @return \Drupal\node\NodeInterface
* A webform node.
*/
protected function createWebformNode($webform_id, $settings = []) {
protected function createWebformNode($webform_id, array $settings = []) {
$settings += ['type' => 'webform'];
$node = $this->drupalCreateNode($settings);
$node->webform->target_id = $webform_id;
......
......@@ -35,7 +35,6 @@ class WebformUiElementTypeChangeForm extends WebformUiElementTypeFormBase {
}
$elements = $this->elementManager->getInstances();
$definitions = $this->getDefinitions();
$form = parent::buildForm($form, $form_state, $webform);
......
......@@ -1093,8 +1093,8 @@ class WebformCliService implements WebformCliServiceInterface {
/******************************************************************************/";
// Validate.
$validate_method = 'drush_' . str_replace('-','_', $command_key) . '_validate';
$validate_hook = 'drush_' . str_replace('-','_', $command_key) . '_validate';
$validate_method = 'drush_' . str_replace('-', '_', $command_key) . '_validate';
$validate_hook = 'drush_' . str_replace('-', '_', $command_key) . '_validate';
if (method_exists($this, $validate_method)) {
$functions[] = "
/**
......@@ -1106,8 +1106,8 @@ function $validate_hook() {
}
// Commands.
$command_method = 'drush_' . str_replace('-','_', $command_key);
$command_hook = 'drush_' . str_replace('-','_', $command_key);
$command_method = 'drush_' . str_replace('-', '_', $command_key);
$command_hook = 'drush_' . str_replace('-', '_', $command_key);
if (method_exists($this, $command_method)) {
$functions[] = "
/**
......@@ -1119,7 +1119,7 @@ function $command_hook() {
}
}
// Build commands
// Build commands.
$commands = Variable::export($this->webform_drush_command());
// Remove [datatypes] which are only needed for Drush 9.x.
$commands = preg_replace('/\[(boolean)\]\s+/', '', $commands);
......@@ -1162,7 +1162,7 @@ $functions
$methods = [];
foreach ($items as $command_key => $command_item) {
$command_name = str_replace('-',':', $command_key);
$command_name = str_replace('-', ':', $command_key);
// Set defaults.
$command_item += [
......@@ -1179,7 +1179,7 @@ $functions
/****************************************************************************/";
// Validate.
$validate_method = 'drush_' . str_replace('-','_', $command_key) . '_validate';
$validate_method = 'drush_' . str_replace('-', '_', $command_key) . '_validate';
if (method_exists($this, $validate_method)) {
$methods[] = "
/**
......@@ -1193,7 +1193,7 @@ $functions
}
// Command.
$command_method = 'drush_' . str_replace('-','_', $command_key);
$command_method = 'drush_' . str_replace('-', '_', $command_key);
if (method_exists($this, $command_method)) {
$command_params = [];
$command_arguments = [];
......@@ -1222,7 +1222,7 @@ $functions
}
$command_annotations[] = "@option $option_name $option_description";
$command_options[$option_name] = $option_default ;
$command_options[$option_name] = $option_default;
}
if ($command_options) {
$command_options = Variable::export($command_options);
......@@ -1338,10 +1338,11 @@ $methods
// editorial.
// @see \Drupal\webform_editorial\Controller\WebformEditorialController::drush
if (!function_exists('dt')) {
/**
* Rudimentary replacement for Drupal API t() function.
*
* @param string
* @param string $string
* String to process, possibly with replacement item.
*
* @return string
......@@ -1350,5 +1351,5 @@ if (!function_exists('dt')) {
function dt($string) {
return $string;
}
}
}
......@@ -38,6 +38,7 @@ class WebformContributeController extends ControllerBase implements ContainerInj
* @var \Drupal\webform\WebformContributeManagerInterface
*/
protected $contributeManager;
/**
* Constructs a WebfomrContributeController object.
*
......
......@@ -246,12 +246,14 @@ class WebformPluginElementController extends ControllerBase implements Container
$dependencies ? ['data' => ['#markup' => '• ' . implode('<br />• ', $dependencies)], 'nowrap' => 'nowrap'] : '',
$element_plugin_definition['provider'],
$webform_element_plugin_definition['provider'],
$operations ? ['data' => [
'#type' => 'operations',
'#links' => $operations,
'#prefix' => '<div class="webform-dropbutton">',
'#suffix' => '</div>',
]] : '',
$operations ? [
'data' => [
'#type' => 'operations',
'#links' => $operations,
'#prefix' => '<div class="webform-dropbutton">',
'#suffix' => '</div>',
],
] : '',
],
];
if (isset($excluded_elements[$element_plugin_id])) {
......
......@@ -88,7 +88,7 @@ class WebformPluginHandlerController extends ControllerBase implements Container
$build = [];
// Settings
// Settings.
$build['settings'] = [
'#type' => 'link',
'#title' => $this->t('Edit configuration'),
......
......@@ -219,7 +219,6 @@ class WebformCodeMirror extends Textarea {
* @return array|null
* An array of error messages.
*/
protected static function validateHtml($element, FormStateInterface $form_state, $complete_form) {
// @see: http://stackoverflow.com/questions/3167074/which-function-in-php-validate-if-the-string-is-valid-html
// @see: http://stackoverflow.com/questions/5030392/x-html-validator-in-php
......
......@@ -428,7 +428,7 @@ class WebformSubmission extends ContentEntityBase implements WebformSubmissionIn
$source_entity = $this->entityTypeManager()->getStorage($entity_type)->load($entity_id);
// If translated is set, get the translated source entity.
if ($translate && $source_entity instanceof ContentEntityInterface ) {
if ($translate && $source_entity instanceof ContentEntityInterface) {
$langcode = $this->language()->getId();
if ($source_entity->hasTranslation($langcode)) {
$source_entity = $source_entity->getTranslation($langcode);
......
......@@ -92,7 +92,7 @@ class WebformAdminConfigExportersForm extends WebformAdminConfigBaseForm {
'#required' => TRUE,
'#default_value' => $config->get('export.temp_directory') ?: file_directory_temp(),
];
// Export.
$form['export_default_settings'] = [
'#type' => 'details',
......@@ -120,7 +120,6 @@ class WebformAdminConfigExportersForm extends WebformAdminConfigBaseForm {
return parent::buildForm($form, $form_state);
}
/**
* {@inheritdoc}
*/
......
......@@ -62,8 +62,6 @@ class WebformEntityReferenceEntityFormatter extends WebformEntityReferenceFormat
* The formatter label display setting.
* @param string $view_mode
* The view mode.
* @param \Drupal\Core\Render\RendererInterface $renderer
* The renderer.
* @param array $third_party_settings
* Third party settings.
* @param \Drupal\Core\Render\RendererInterface $renderer
......
......@@ -3,7 +3,6 @@
namespace Drupal\webform\Plugin\WebformElement;
use CommerceGuys\Addressing\AddressFormat\FieldOverride;
use CommerceGuys\Addressing\AddressFormat\AddressField;
use Drupal\address\FieldHelper;
use Drupal\address\LabelHelper;
use Drupal\Component\Utility\Html;
......@@ -91,6 +90,7 @@ class Address extends WebformCompositeBase {
$element['#element_validate'][] = [get_class($this), 'validateAddress'];
}
/**
* {@inheritdoc}
*/
......@@ -220,7 +220,7 @@ class Address extends WebformCompositeBase {
* @see \Drupal\address\Plugin\Field\FieldFormatter\AddressDefaultFormatter::viewElements
* @see \Drupal\address\Plugin\Field\FieldFormatter\AddressDefaultFormatter::viewElement
*/
protected function buildAddress(array $element, WebformSubmissionInterface $webform_submission, $options) {
protected function buildAddress(array $element, WebformSubmissionInterface $webform_submission, array $options) {
/** @var \CommerceGuys\Addressing\AddressFormat\AddressFormatRepositoryInterface $address_format_repository */
$address_format_repository = \Drupal::service('address.address_format_repository');
/** @var \CommerceGuys\Addressing\Country\CountryRepositoryInterface $country_repository */
......@@ -356,7 +356,7 @@ class Address extends WebformCompositeBase {
FieldOverride::REQUIRED => t('Required'),
],
'#empty_option' => $this->t('- No override -'),
'#parents' => ['properties', 'field_overrides', $field_name]
'#parents' => ['properties', 'field_overrides', $field_name],
],
];
}
......
......@@ -76,4 +76,5 @@ class Checkbox extends BooleanBase {
return $form;
}
}
......@@ -67,7 +67,7 @@ class Checkboxes extends OptionsBase {
list($text) = explode(WebformOptionsHelper::DESCRIPTION_DELIMITER, $text);
// Append element type to text.
$text .= ' [' . $this->t('Checkbox') . ']';
$selectors[$index] = $text ;
$selectors[$index] = $text;
}
return $selectors;
}
......
......@@ -106,7 +106,7 @@ abstract class WebformManagedFileBase extends WebformElementBase {
* @param \Drupal\Core\Language\LanguageManagerInterface $language_manager
* The language manager.
*/
public function __construct(array $configuration, $plugin_id, $plugin_definition,LoggerInterface $logger, ConfigFactoryInterface $config_factory, AccountInterface $current_user, EntityTypeManagerInterface $entity_type_manager, ElementInfoManagerInterface $element_info, WebformElementManagerInterface $element_manager, WebformTokenManagerInterface $token_manager, WebformLibrariesManagerInterface $libraries_manager, FileSystemInterface $file_system, $file_usage, TransliterationInterface $transliteration, LanguageManagerInterface $language_manager) {
public function __construct(array $configuration, $plugin_id, $plugin_definition, LoggerInterface $logger, ConfigFactoryInterface $config_factory, AccountInterface $current_user, EntityTypeManagerInterface $entity_type_manager, ElementInfoManagerInterface $element_info, WebformElementManagerInterface $element_manager, WebformTokenManagerInterface $token_manager, WebformLibrariesManagerInterface $libraries_manager, FileSystemInterface $file_system, $file_usage, TransliterationInterface $transliteration, LanguageManagerInterface $language_manager) {
parent::__construct($configuration, $plugin_id, $plugin_definition, $logger, $config_factory, $current_user, $entity_type_manager, $element_info, $element_manager, $token_manager, $libraries_manager);
$this->fileSystem = $file_system;
......@@ -952,7 +952,7 @@ abstract class WebformManagedFileBase extends WebformElementBase {
// Return file content headers.
$headers = file_get_content_headers($file);
/** @var \Drupal\Core\File\FileSystemInterface $file_system */
/** @var \Drupal\Core\File\FileSystemInterface $file_system */
$file_system = \Drupal::service('file_system');
$filename = $file_system->basename($uri);
// Force blacklisted files to be downloaded instead of opening in the browser.
......
......@@ -344,7 +344,7 @@ interface WebformElementInterface extends PluginInspectionInterface, PluginFormI
*
* @param array $element
* An element.
* @param \Drupal\Core\Entity\EntityInterface|null$entity
* @param \Drupal\Core\Entity\EntityInterface|null $entity
* A webform or webform submission entity.
*/
public function replaceTokens(array &$element, EntityInterface $entity = NULL);
......
......@@ -1347,7 +1347,7 @@ class EmailWebformHandler extends WebformHandlerBase implements WebformHandlerMe
* @return array
* A select other element.
*/
protected function buildElement($name, $title, $label, $required = FALSE, array $element_options, array $options_options = NULL, array $role_options = NULL, array $other_options = NULL) {
protected function buildElement($name, $title, $label, $required = FALSE, array $element_options, array $options_options = NULL, array $role_options = NULL, array $other_options = NULL) {
list($element_name, $element_type) = (strpos($name, '_') !== FALSE) ? explode('_', $name) : [$name, 'text'];
$default_option = $this->getDefaultConfigurationValue($name);
......
......@@ -254,7 +254,7 @@ class WebformAccessRulesTest extends WebformTestBase {
$webform->save();
// Check enable user submission duplicate.
$this->drupalGet( "webform/$webform_id/submissions/$sid/duplicate");
$this->drupalGet("webform/$webform_id/submissions/$sid/duplicate");
$this->assertResponse(200);
// Check disabled previous submissions messages.
......
......@@ -2,7 +2,6 @@
namespace Drupal\webform\Tests\Element;
use Drupal\address\LabelHelper;
use Drupal\field\Entity\FieldStorageConfig;
use Drupal\webform\Entity\Webform;
......@@ -142,7 +141,7 @@ address_multiple:
$element_plugin->initializeCompositeElements($element);;
// Check composite elements against address schema.
$composite_elements = $element['#webform_composite_elements'] ;
$composite_elements = $element['#webform_composite_elements'];
$diff_composite_elements = array_diff_key($composite_elements, $schema['columns']);
$this->debug($diff_composite_elements);
$this->assert(empty($diff_composite_elements));
......
......@@ -48,7 +48,7 @@ class WebformSettingsArchivedTest extends WebformTestBase {
// Check that archived webform displays archive message.
$this->drupalGet('/form/test-form-archived');
$this->assertRaw('This webform is <a href="' . $base_path. 'admin/structure/webform/manage/test_form_archived/settings">archived</a>');
$this->assertRaw('This webform is <a href="' . $base_path . 'admin/structure/webform/manage/test_form_archived/settings">archived</a>');
// Check that archived webform is remove webform select menu.
$this->drupalGet('/node/add/webform');
......
......@@ -12,7 +12,6 @@ use Drupal\webform\Tests\WebformTestBase;
*/
class WebformSettingsPreviousTest extends WebformTestBase {
/**
* Test webform submission form previous submission(s).
*/
......
......@@ -192,7 +192,7 @@ class TwigExtension extends \Twig_Extension {
* (optional) Template and token options.
*
* @return array
* A renderable containing an inline twig template.
* A renderable containing an inline twig template.
*/
public static function buildTwigTemplate(WebformSubmissionInterface $webform_submission, $template, array $options = []) {
$options += [
......
......@@ -13,8 +13,8 @@ class WebformObjectHelper {
* @param object $object
* An object.
*
* @return object $object
* An object.
* @return object
* Object sorted by properties.
*/
public static function sortByProperty($object) {
$array = (array) $object;
......
......@@ -160,7 +160,7 @@ class WebformAddonsManager implements WebformAddonsManagerInterface {
'url' => Url::fromUri('https://www.drupal.org/project/webform_composite'),
'category' => 'element',
];
// Element: Webform Checkboxes Table.
$projects['webform_checkboxes_table'] = [
'title' => $this->t('Webform Checkboxes Table'),
......@@ -536,7 +536,6 @@ class WebformAddonsManager implements WebformAddonsManagerInterface {
'category' => 'utility',
];
// Utility: Webform Ip Track.
$projects['webform_ip_track'] = [
'title' => $this->t('Webform Ip Track'),
......
......@@ -3,7 +3,6 @@
namespace Drupal\webform;
use Drupal\Core\Ajax\AjaxResponse;
use Drupal\Core\Ajax\ReplaceCommand;
use Drupal\Core\Entity\EntityForm;
use Drupal\Core\Form\FormStateInterface;
use Drupal\Core\Url;
......@@ -293,7 +292,7 @@ class WebformEntityHandlersForm extends EntityForm {
$response->addCommand(new WebformRefreshCommand($url));
return $response;
}
// Otherwise, redirect back to the webform handlers form.
return new RedirectResponse($url);
}
......
......@@ -370,7 +370,7 @@ class WebformMessageManager implements WebformMessageManagerInterface {
* @return array|bool
* Renderable array or FALSE if custom message does not exist.
*/
protected function getCustomMessage($key, $arguments = []) {
protected function getCustomMessage($key, array $arguments = []) {
$setting = $this->getSetting($key);
if (!$setting) {
return FALSE;
......
......@@ -334,8 +334,9 @@ interface WebformSubmissionInterface extends ContentEntityInterface, EntityOwner
/**
* Gets the webform submission's source entity.
*
* @param boolean
* @param boolean $translate
* (optional) If TRUE the source entity will be translated.
*
* @return \Drupal\Core\Entity\EntityInterface|null
* The entity that this webform submission was created from.
*/
......
......@@ -19,14 +19,14 @@ class WebformObjectHelperTest extends UnitTestCase {
*
* @param object $object
* The object to run through WebformObjectHelper::sortByProperty().
* @param array $array
* @param array $expected
* The expected result from calling the function.
*
* @see WebformObjectHelper::sortByProperty()
*
* @dataProvider providerSortByProperty
*/
public function testSortByProperty($object, $expected) {
public function testSortByProperty($object, array $expected) {
$result = (array) WebformObjectHelper::sortByProperty($object);
$this->assertEquals(
implode('|', array_keys($expected)),
......
......@@ -297,6 +297,7 @@ function hook_webform_help_info_alter(array &$help) {
*
* @param string $id
* The message id.
*
* @return mixed|bool
* TRUE if message is closed, else NULL
*
......
......@@ -27,6 +27,3 @@ entity.webform.handler:
class: '\Drupal\webform\Plugin\Menu\LocalAction\WebformDialogLocalAction'
appears_on:
- entity.webform.handlers
......@@ -217,7 +217,7 @@ function webform_token_info() {
];
// Append link to token help to source-entity and submitted-to description.
if (\Drupal::moduleHandler()->moduleExists('token') && \Drupal::moduleHandler()->moduleExists('help')) {
if (\Drupal::moduleHandler()->moduleExists('token') && \Drupal::moduleHandler()->moduleExists('help')) {
$t_args = [':href' => Url::fromRoute('help.page', ['name' => 'token'])->toString()];
$token_help = t('For a list of the currently available source entity related tokens, please see <a href=":href">token help</a>.', $t_args);
$webform_submission['source-entity']['description'] = Markup::create($webform_submission['source-entity']['description'] . '<br/>' . $token_help);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment