Support from Acquia helps fund testing for Drupal Acquia logo

Comments

quietone created an issue. See original summary.

quietone’s picture

Status: Active » Needs review
FileSize
2.26 KB
phenaproxima’s picture

Assigned: Unassigned » phenaproxima

Self-assigning for review.

phenaproxima’s picture

Status: Needs review » Needs work
  1. +++ b/core/modules/migrate/src/Plugin/migrate/process/Concat.php
    @@ -8,9 +8,43 @@
    + * The concat process plugin is used to concatenate strings in the source. An
    

    Can we say "The concat process plugin is used to concatenate a set of strings", and drop "in the source"?

  2. +++ b/core/modules/migrate/src/Plugin/migrate/process/Concat.php
    @@ -8,9 +8,43 @@
    + * example use case would be when the source data contains an array of strings
    + * that should be imploded into a single value.
    

    Let's change this to "An example use case would be imploding a set of strings into a single value."

  3. +++ b/core/modules/migrate/src/Plugin/migrate/process/Concat.php
    @@ -8,9 +8,43 @@
    + * Available configuration keys
    

    Needs to end with a colon.

  4. +++ b/core/modules/migrate/src/Plugin/migrate/process/Concat.php
    @@ -8,9 +8,43 @@
    + * This will set new_text_field to foobar.
    

    This is not accurate. It will set new_text_field to the concatenation of the 'foo' and 'bar' source values. For example, if the 'foo' property is "wambooli" and the 'bar' property is "pastafazoul", new_text_field will be "wamboolipastafazoul". Let's use a concrete example like that here.

  5. +++ b/core/modules/migrate/src/Plugin/migrate/process/Concat.php
    @@ -8,9 +8,43 @@
    + * This will set new_text_field to foo/bar.
    

    Let's update this example for accuracy as well.

  6. +++ b/core/modules/migrate/src/Plugin/migrate/process/Concat.php
    @@ -20,9 +54,22 @@
    +   * Concatenates the strings in the source value.
    +   *
    +   * @param array $value
    +   *   The input array.
    +   * @param \Drupal\migrate\MigrateExecutableInterface $migrate_executable
    +   *   The migration in which this process is being executed.
    +   * @param \Drupal\migrate\Row $row
    +   *   The row from the source to process.
    +   * @param string $destination_property
    +   *   The destination property currently worked on. This is only used together
    +   *   with the $row above.
    +   *
    +   * @return string
    +   *   The imploded value.
        *
    -   * Concatenates the strings in the current value.
    +   * @throws \Drupal\migrate\MigrateException
    

    This should use {@inheritdoc}.

Version: 8.3.x-dev » 8.4.x-dev

Drupal 8.3.0-alpha1 will be released the week of January 30, 2017, which means new developments and disruptive changes should now be targeted against the 8.4.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

semiuniversal’s picture

I'll pick this up and incorporate the changes phenaproxima suggests

semiuniversal’s picture

quietone’s picture

Status: Needs work » Needs review
FileSize
2.49 KB

@semiuniversal, thanks for working on this. To make this easier to review please add an interdiff in the future. The handbook has instructions for creating an interdiff.
Setting to NR for the testbot.

Can we say "The concat process plugin is used to concatenate a set of strings", and drop "in the source"?

But the handbook states, "Use a third person verb to start the summary of a class, interface, or method. For example: "Represents a ..." or "Provides...". Which means that the summary is fine. Or do I have that wrong?

quietone’s picture

Just trying to get the testing done.

phenaproxima’s picture

Status: Needs review » Needs work

This is really close. Consider these nitpicks...

  1. +++ b/core/modules/migrate/src/Plugin/migrate/process/Concat.php
    @@ -8,9 +8,47 @@
    + * Concatenates the strings in the source.
    

    I'm not a huge fan of "in the source". Can we simply say "Concatenates a set of strings"?

  2. +++ b/core/modules/migrate/src/Plugin/migrate/process/Concat.php
    @@ -8,9 +8,47 @@
    + * The concat process plugin is used to concatenate strings.
    + * An example use case would be imploding a set of strings into a single value.
    

    Let's clean this up a little: "The concat plugin is used to concatenate strings. For example, imploding a set of strings into a single string."

  3. +++ b/core/modules/migrate/src/Plugin/migrate/process/Concat.php
    @@ -8,9 +8,47 @@
    + * property is "pastafazoul", new_text_field will be "wamboolipastafazoul".
    

    I smile upon pastafazoul :)

quietone’s picture

Status: Needs work » Needs review
FileSize
2.05 KB
767 bytes

1 and 2. Fixed.
3. Makes me hungry.

phenaproxima’s picture

Status: Needs review » Reviewed & tested by the community

Works for me.

cilefen’s picture

Status: Reviewed & tested by the community » Needs work
+++ b/core/modules/migrate/src/Plugin/migrate/process/Concat.php
@@ -8,9 +8,47 @@
+ * You can also specify a delimiter.

In implode() and explode() terms, this should be called "glue", not "delimiter".

quietone’s picture

Status: Needs work » Needs review
FileSize
2.08 KB
550 bytes

How about this, adding a reference to 'glue' at the first mention of delimiter.

phenaproxima’s picture

Status: Needs review » Reviewed & tested by the community

I like that. I am personally in favor of "delimiter", even though the PHP documentation uses "glue". I think the word "glue" makes huge sense in the context of explaining the implode() function, but less when explaining a process plugin that wraps around it. Therefore, this is a good compromise. Combined with the excellent examples, this documentation is now crystal-clear. And I'm so pleased to be, as far as I know, the person who originally incepted the term "pastafazoul" into core.

cilefen’s picture

We had to google "wambooli" to determine if it is an offensive word. It seems not. Pro tip: new nonsense words in core require more committer time ;-).

  • cilefen committed 5eb0425 on 8.4.x
    Issue #2845475 by quietone, semiuniversal, phenaproxima, cilefen: Add...

  • cilefen committed 4c93dc9 on 8.3.x
    Issue #2845475 by quietone, semiuniversal, phenaproxima, cilefen: Add...
cilefen’s picture

Committed 48ec916 and pushed to 8.4.x. As an API documentation improvement, it also goes in 8.3.x. Thanks!

cilefen’s picture

Version: 8.4.x-dev » 8.3.x-dev
phenaproxima’s picture

Wambooli is a nonsense word I picked up from C for Dummies, the best programming book ever written. ;-)

Status: Reviewed & tested by the community » Needs work

The last submitted patch, 14: add_documentation_to-2845475-14.patch, failed testing.

cilefen’s picture

Status: Needs work » Fixed

We're getting there...

xjm’s picture

Issue tags: +DrupalCampNJ2017

Status: Fixed » Closed (fixed)

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