Commit 8ceb2db7 authored by sylvainm's avatar sylvainm
Browse files

Issue #3266572: Fix coding standards

parent 0aa02bc2
Loading
Loading
Loading
Loading
+9 −7
Changes for src/Plugin/migrate/process/TransformDndAtomsToMedias.php: 9 added lines, 7 removed lines.
Original line number Diff line number Diff line
@@ -65,13 +65,13 @@ class TransformDndAtomsToMedias extends MigrationLookup {
      return $value;
    }

    $DOM = new \DOMDocument('1.0', 'utf-8');
    @$DOM->loadHTML('<?xml version="1.0" encoding="utf-8"?>' . $value);
    $dom = new \DOMDocument('1.0', 'utf-8');
    @$dom->loadHTML('<?xml version="1.0" encoding="utf-8"?>' . $value);

    $items = $DOM->getElementsByTagName('div');
    $items = $dom->getElementsByTagName('div');

    // Get each atom wrappers data (sid, type, align, context):
    foreach ($items AS $item) {
    foreach ($items as $item) {
      $sid = $item->getAttribute('data-scald-sid');
      if ($sid) {
        $type = $item->getAttribute('data-scald-type');
@@ -81,7 +81,7 @@ class TransformDndAtomsToMedias extends MigrationLookup {
        if (is_null($uuid)) {
          continue;
        }
        $drupalMedia = $DOM->createElement('drupal-media', '');
        $drupalMedia = $dom->createElement('drupal-media', '');
        $drupalMedia->setAttribute('data-entity-type', 'media');
        $drupalMedia->setAttribute('data-entity-uuid', $uuid);
        $drupalMedia->setAttribute('data-align', $align);
@@ -100,7 +100,7 @@ class TransformDndAtomsToMedias extends MigrationLookup {
    foreach ($replacements as $data) {
      $data['source']->parentNode->replaceChild($data['target'], $data['source']);
    }
    $value = preg_replace('/(<\/?body>|<\/?html>)/', '', $DOM->saveXML($DOM->documentElement));
    $value = preg_replace('/(<\/?body>|<\/?html>)/', '', $dom->saveXML($dom->documentElement));
    return $value;
  }

@@ -111,7 +111,8 @@ class TransformDndAtomsToMedias extends MigrationLookup {
   *   Atom ID.
   * @param string $mediaType
   *   Media bundle.
   * @return string|NULL
   *
   * @return string|null
   *   Media entity uuid.
   */
  protected function sidToUuid($sid, $mediaType) {
@@ -148,4 +149,5 @@ class TransformDndAtomsToMedias extends MigrationLookup {
      throw new MigrateException(sprintf('A %s was thrown while processing this migration lookup', gettype($e)), $e->getCode(), $e);
    }
  }

}