From 9ec1f42d377ac383360bd25ad1c261a0eae4417d Mon Sep 17 00:00:00 2001 From: Alex Pott Date: Sat, 30 Apr 2016 21:18:20 +0100 Subject: [PATCH] Issue #2711537 by chgasparoto, kostyashupenko: Syntax errors (un-quoted or mis-quoted strings) in various code examples in docs --- core/lib/Drupal/Component/Datetime/DateTimePlus.php | 2 +- core/lib/Drupal/Component/Render/FormattableMarkup.php | 4 ++-- .../Drupal/Core/Config/Entity/ConfigDependencyManager.php | 8 ++++---- core/lib/Drupal/Core/Database/Log.php | 4 ++-- .../Core/Entity/Display/EntityFormDisplayInterface.php | 2 +- core/lib/Drupal/Core/Render/Element/Password.php | 2 +- 6 files changed, 11 insertions(+), 11 deletions(-) diff --git a/core/lib/Drupal/Component/Datetime/DateTimePlus.php b/core/lib/Drupal/Component/Datetime/DateTimePlus.php index 6c8dcd0b12e..1d8bbb77ff4 100644 --- a/core/lib/Drupal/Component/Datetime/DateTimePlus.php +++ b/core/lib/Drupal/Component/Datetime/DateTimePlus.php @@ -116,7 +116,7 @@ class DateTimePlus { * date even if some values are missing. * * @param array $date_parts - * An array of date parts, like ('year' => 2014, 'month => 4). + * An array of date parts, like ('year' => 2014, 'month' => 4). * @param mixed $timezone * (optional) \DateTimeZone object, time zone string or NULL. NULL uses the * default system time zone. Defaults to NULL. diff --git a/core/lib/Drupal/Component/Render/FormattableMarkup.php b/core/lib/Drupal/Component/Render/FormattableMarkup.php index f8274ee47d1..d9fbf2f4393 100644 --- a/core/lib/Drupal/Component/Render/FormattableMarkup.php +++ b/core/lib/Drupal/Component/Render/FormattableMarkup.php @@ -163,9 +163,9 @@ class FormattableMarkup implements MarkupInterface, \Countable { * wrapped in quotes: * @code * // Secure (with quotes): - * $this->placeholderFormat('@variable', [':url' => $url, @variable => $variable]); + * $this->placeholderFormat('@variable', [':url' => $url, '@variable' => $variable]); * // Insecure (without quotes): - * $this->placeholderFormat('@variable', [':url' => $url, @variable => $variable]); + * $this->placeholderFormat('@variable', [':url' => $url, '@variable' => $variable]); * @endcode * When ":variable" comes from arbitrary user input, the result is secure, * but not guaranteed to be a valid URL (which means the resulting output diff --git a/core/lib/Drupal/Core/Config/Entity/ConfigDependencyManager.php b/core/lib/Drupal/Core/Config/Entity/ConfigDependencyManager.php index 88e4de18ce1..bca31f42bb1 100644 --- a/core/lib/Drupal/Core/Config/Entity/ConfigDependencyManager.php +++ b/core/lib/Drupal/Core/Config/Entity/ConfigDependencyManager.php @@ -17,10 +17,10 @@ use Drupal\Component\Utility\SortArray; * The configuration dependency value is structured like this: * @code * array( - * 'config => array( + * 'config' => array( * // An array of configuration entity object names. Recalculated on save. * ), - * 'content => array( + * 'content' => array( * // An array of content entity configuration dependency names. The default * // format is "ENTITY_TYPE_ID:BUNDLE:UUID". Recalculated on save. * ), @@ -291,10 +291,10 @@ class ConfigDependencyManager { * The configuration dependencies. The array is structured like this: * @code * array( - * 'config => array( + * 'config' => array( * // An array of configuration entity object names. * ), - * 'content => array( + * 'content' => array( * // An array of content entity configuration dependency names. The default * // format is "ENTITY_TYPE_ID:BUNDLE:UUID". * ), diff --git a/core/lib/Drupal/Core/Database/Log.php b/core/lib/Drupal/Core/Database/Log.php index 9c4714c8ba1..84f55cba694 100644 --- a/core/lib/Drupal/Core/Database/Log.php +++ b/core/lib/Drupal/Core/Database/Log.php @@ -22,8 +22,8 @@ class Log { * * array( * $logging_key = array( - * array(query => '', args => array(), caller => '', target => '', time => 0), - * array(query => '', args => array(), caller => '', target => '', time => 0), + * array('query' => '', 'args' => array(), 'caller' => '', 'target' => '', 'time' => 0), + * array('query' => '', 'args' => array(), 'caller' => '', 'target' => '', 'time' => 0), * ), * ); * diff --git a/core/lib/Drupal/Core/Entity/Display/EntityFormDisplayInterface.php b/core/lib/Drupal/Core/Entity/Display/EntityFormDisplayInterface.php index 6c8578970e3..ba6117d90e4 100644 --- a/core/lib/Drupal/Core/Entity/Display/EntityFormDisplayInterface.php +++ b/core/lib/Drupal/Core/Entity/Display/EntityFormDisplayInterface.php @@ -55,7 +55,7 @@ interface EntityFormDisplayInterface extends EntityDisplayInterface { * // For 'single-value' widgets: * '#theme' => 'field_multiple_value_form', * '#cardinality' => The field cardinality, - * '#cardinality_multiple => TRUE if the field can contain multiple + * '#cardinality_multiple' => TRUE if the field can contain multiple * items, FALSE otherwise. * // One sub-array per copy of the widget, keyed by delta. * 0 => array( diff --git a/core/lib/Drupal/Core/Render/Element/Password.php b/core/lib/Drupal/Core/Render/Element/Password.php index 4c3e6c84246..e16e8bb436c 100644 --- a/core/lib/Drupal/Core/Render/Element/Password.php +++ b/core/lib/Drupal/Core/Render/Element/Password.php @@ -12,7 +12,7 @@ use Drupal\Core\Render\Element; * @code * $form['pass'] = array( * '#type' => 'password', - * '#title => $this->t('Password'), + * '#title' => $this->t('Password'), * '#size' => 25, * ); * @endcode