Skip to content

Commit c30d177

Browse files
committed
php 8.1 Compitability issues
1 parent e5662c8 commit c30d177

File tree

3 files changed

+11
-9
lines changed

3 files changed

+11
-9
lines changed

src/Migration/Handler/CleanMultiselect.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ public function handle(Record $recordToHandle, Record $oppositeRecord)
5151
{
5252
$attributeIds = $this->getAttributeIds();
5353
if ($attributeIds && in_array($recordToHandle->getValue('attribute_id'), $attributeIds)) {
54-
$value = $recordToHandle->getValue($this->field);
54+
$value = $recordToHandle->getValue($this->field) ? $recordToHandle->getValue($this->field) : '';
5555
$value = explode(',', $value);
5656
$value = array_filter($value);
5757
$value = implode(',', $value);

src/Migration/Handler/Placeholder.php

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -61,8 +61,10 @@ protected function processContent($content)
6161
$classSource = [];
6262
$classDestination = [];
6363
foreach ($this->classMap->getMap() as $classOldFashion => $classNewStyle) {
64-
$classSource[] = sprintf('type="%s"', $classOldFashion);
65-
$classDestination[] = sprintf('type="%s"', str_replace('\\', '\\\\', $classNewStyle));
64+
if ($classNewStyle !== null) {
65+
$classSource[] = sprintf('type="%s"', $classOldFashion);
66+
$classDestination[] = sprintf('type="%s"', str_replace('\\', '\\\\', $classNewStyle));
67+
}
6668
}
6769
$content = str_replace($classSource, $classDestination, $content);
6870
// cut off name of a module from template path

src/Migration/ResourceModel/AbstractCollection.php

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -32,47 +32,47 @@ public function __construct(array $data = [])
3232
/**
3333
* @inheritdoc
3434
*/
35-
public function current()
35+
public function current() : mixed
3636
{
3737
return $this->data[$this->position];
3838
}
3939

4040
/**
4141
* @inheritdoc
4242
*/
43-
public function key()
43+
public function key() : mixed
4444
{
4545
return $this->position;
4646
}
4747

4848
/**
4949
* @inheritdoc
5050
*/
51-
public function next()
51+
public function next() : void
5252
{
5353
$this->position++;
5454
}
5555

5656
/**
5757
* @inheritdoc
5858
*/
59-
public function rewind()
59+
public function rewind() :void
6060
{
6161
$this->position = 0;
6262
}
6363

6464
/**
6565
* @inheritdoc
6666
*/
67-
public function valid()
67+
public function valid() : bool
6868
{
6969
return $this->key() < count($this->data);
7070
}
7171

7272
/**
7373
* @inheritdoc
7474
*/
75-
public function count()
75+
public function count() : int
7676
{
7777
return count($this->data);
7878
}

0 commit comments

Comments
 (0)