Skip to content

Commit

Permalink
[BUGFIX] Fix issue with collection type conversion
Browse files Browse the repository at this point in the history
  • Loading branch information
s2b committed Jan 27, 2023
1 parent f640a9c commit aecf146
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion Classes/Utility/ComponentArgumentConverter.php
Original file line number Diff line number Diff line change
Expand Up @@ -179,7 +179,7 @@ public function canTypeBeConvertedToType(string $givenType, string $toType): arr
) {
$conversionInfo = $this->conversionInterfaces[$givenType];
} elseif ($this->isCollectionType($toType) && $this->isAccessibleArray($givenType)) {
$conversionInfo = $this->conversionInterfaces[$givenType];
$conversionInfo = $this->conversionInterfaces['array'] ?? [];
}

if (!$conversionInfo && class_exists($givenType)) {
Expand Down
2 changes: 1 addition & 1 deletion Tests/Unit/Utility/ComponentArgumentConverterTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@ public function canTypeBeConvertedToType()
$this->converter->canTypeBeConvertedToType('array', DummyValue::class . '[]')
);
$this->assertEquals(
[DummyConversionInterface::class, 'fromString'],
[ConstructibleFromArray::class, 'fromArray'],
$this->converter->canTypeBeConvertedToType(\ArrayIterator::class, DummyValue::class . '[]')
);
$this->assertEquals(
Expand Down

0 comments on commit aecf146

Please sign in to comment.