Skip to content
Snippets Groups Projects

Issue #3266572: Fix coding standards

1 file
+ 9
7
Compare changes
  • Side-by-side
  • Inline
@@ -65,13 +65,13 @@ class TransformDndAtomsToMedias extends MigrationLookup {
@@ -65,13 +65,13 @@ class TransformDndAtomsToMedias extends MigrationLookup {
return $value;
return $value;
}
}
$DOM = new \DOMDocument('1.0', 'utf-8');
$dom = new \DOMDocument('1.0', 'utf-8');
@$DOM->loadHTML('<?xml version="1.0" encoding="utf-8"?>' . $value);
@$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):
// Get each atom wrappers data (sid, type, align, context):
foreach ($items AS $item) {
foreach ($items as $item) {
$sid = $item->getAttribute('data-scald-sid');
$sid = $item->getAttribute('data-scald-sid');
if ($sid) {
if ($sid) {
$type = $item->getAttribute('data-scald-type');
$type = $item->getAttribute('data-scald-type');
@@ -81,7 +81,7 @@ class TransformDndAtomsToMedias extends MigrationLookup {
@@ -81,7 +81,7 @@ class TransformDndAtomsToMedias extends MigrationLookup {
if (is_null($uuid)) {
if (is_null($uuid)) {
continue;
continue;
}
}
$drupalMedia = $DOM->createElement('drupal-media', '');
$drupalMedia = $dom->createElement('drupal-media', '');
$drupalMedia->setAttribute('data-entity-type', 'media');
$drupalMedia->setAttribute('data-entity-type', 'media');
$drupalMedia->setAttribute('data-entity-uuid', $uuid);
$drupalMedia->setAttribute('data-entity-uuid', $uuid);
$drupalMedia->setAttribute('data-align', $align);
$drupalMedia->setAttribute('data-align', $align);
@@ -100,7 +100,7 @@ class TransformDndAtomsToMedias extends MigrationLookup {
@@ -100,7 +100,7 @@ class TransformDndAtomsToMedias extends MigrationLookup {
foreach ($replacements as $data) {
foreach ($replacements as $data) {
$data['source']->parentNode->replaceChild($data['target'], $data['source']);
$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;
return $value;
}
}
@@ -111,7 +111,8 @@ class TransformDndAtomsToMedias extends MigrationLookup {
@@ -111,7 +111,8 @@ class TransformDndAtomsToMedias extends MigrationLookup {
* Atom ID.
* Atom ID.
* @param string $mediaType
* @param string $mediaType
* Media bundle.
* Media bundle.
* @return string|NULL
*
 
* @return string|null
* Media entity uuid.
* Media entity uuid.
*/
*/
protected function sidToUuid($sid, $mediaType) {
protected function sidToUuid($sid, $mediaType) {
@@ -148,4 +149,5 @@ class TransformDndAtomsToMedias extends MigrationLookup {
@@ -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);
throw new MigrateException(sprintf('A %s was thrown while processing this migration lookup', gettype($e)), $e->getCode(), $e);
}
}
}
}
 
}
}
Loading