Problem/Motivation

the argument to the constructor is really a set of values for properties. options is a misname.

Proposed resolution

rename $options to $values

Remaining tasks

User interface changes

No

API changes

No

Related issues

Comments

yesct’s picture

Status: Needs work » Active

looked to verify values is more common:

ag "function __construct[(].*values" core/modules | wc -l
15

ag "function __construct[(].*options" core/modules | wc -l
1

also:

Core/Entity/Entity

  /**
   * Constructs an Entity object.
   *
   * @param array $values
   *   An array of values to set, keyed by property name. If the entity type
   *   has bundles, the bundle key has to be specified.
   * @param string $entity_type
   *   The type of the entity to create.
   */
  public function __construct(array $values, $entity_type) {
yesct’s picture

Category: Bug report » Task
yesct’s picture

Status: Active » Needs review
StatusFileSize
new1.65 KB

here we go. will conflict with #2246721: Language class should use property 'label' to be consistent with entities. but that is ok, either one can go in first and we will just re-roll the other.

dawehner’s picture

Priority: Normal » Minor
Status: Needs review » Reviewed & tested by the community

Let's be honest :)

tstoeckler’s picture

Yes, RTBC++. Thanks @YesCT

Status: Reviewed & tested by the community » Needs work

The last submitted patch, 3: 2246657-options_values-3.patch, failed testing.

tstoeckler’s picture

Status: Needs work » Needs review
StatusFileSize
new1.65 KB

Strange error. Let's see if it's random.

yesct’s picture

Issue tags: +Quick fix

(still applies :) )

cordoval’s picture

+++ b/core/lib/Drupal/Core/Language/Language.php
@@ -91,22 +91,23 @@ class Language implements LanguageInterface {
+    // If some values were not set, set sane defaults of a predefined language.

sane -> sensitive?

tim.plunkett’s picture

Status: Needs review » Reviewed & tested by the community

Sane is fine.

  • Commit 0947b0f on 8.x by alexpott:
    Issue #2246657 by tstoeckler, YesCT: $options is misnamed in Language::...
alexpott’s picture

Status: Reviewed & tested by the community » Fixed

Committed 0947b0f and pushed to 8.x. Thanks!

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.