Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Compitability with php 8.1 #897

Open
wants to merge 1 commit into
base: 2.4-develop
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/Migration/Handler/CleanMultiselect.php
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ public function handle(Record $recordToHandle, Record $oppositeRecord)
{
$attributeIds = $this->getAttributeIds();
if ($attributeIds && in_array($recordToHandle->getValue('attribute_id'), $attributeIds)) {
$value = $recordToHandle->getValue($this->field);
$value = $recordToHandle->getValue($this->field) ? $recordToHandle->getValue($this->field) : '';
$value = explode(',', $value);
$value = array_filter($value);
$value = implode(',', $value);
Expand Down
10 changes: 7 additions & 3 deletions src/Migration/Handler/Placeholder.php
Original file line number Diff line number Diff line change
Expand Up @@ -61,9 +61,13 @@ protected function processContent($content)
$classSource = [];
$classDestination = [];
foreach ($this->classMap->getMap() as $classOldFashion => $classNewStyle) {
$classSource[] = sprintf('type="%s"', $classOldFashion);
$classNewStyle = $classNewStyle ?? '';
$classDestination[] = sprintf('type="%s"', str_replace('\\', '\\\\', $classNewStyle));
if($classNewStyle !== null) {
$classSource[] = sprintf('type="%s"', $classOldFashion);
$classDestination[] = sprintf('type="%s"', str_replace('\\', '\\\\', $classNewStyle));
} else {
continue;
}

}
$content = str_replace($classSource, $classDestination, $content);
// cut off name of a module from template path
Expand Down
12 changes: 6 additions & 6 deletions src/Migration/ResourceModel/AbstractCollection.php
Original file line number Diff line number Diff line change
Expand Up @@ -32,47 +32,47 @@ public function __construct(array $data = [])
/**
* @inheritdoc
*/
public function current(): mixed
public function current():mixed
{
return $this->data[$this->position];
}

/**
* @inheritdoc
*/
public function key(): mixed
public function key():mixed
{
return $this->position;
}

/**
* @inheritdoc
*/
public function next(): void
public function next():void
{
$this->position++;
}

/**
* @inheritdoc
*/
public function rewind(): void
public function rewind():void
{
$this->position = 0;
}

/**
* @inheritdoc
*/
public function valid(): bool
public function valid():bool
{
return $this->key() < count($this->data);
}

/**
* @inheritdoc
*/
public function count(): int
public function count():int
{
return count($this->data);
}
Expand Down