ArrayLoader: handle invalid support value (#11440)
parent
e0c1ad1448
commit
11879ea737
|
@ -282,7 +282,7 @@ class ArrayLoader implements LoaderInterface
|
|||
$package->setAuthors($config['authors']);
|
||||
}
|
||||
|
||||
if (isset($config['support'])) {
|
||||
if (isset($config['support']) && \is_array($config['support'])) {
|
||||
$package->setSupport($config['support']);
|
||||
}
|
||||
|
||||
|
|
|
@ -429,4 +429,16 @@ class ArrayLoaderTest extends TestCase
|
|||
$package = $this->loader->load($config);
|
||||
$this->assertCount(0, $package->getReplaces());
|
||||
}
|
||||
|
||||
public function testSupportStringValue(): void
|
||||
{
|
||||
$config = array(
|
||||
'name' => 'acme/package',
|
||||
'version' => 'dev-1',
|
||||
'support' => 'https://example.org',
|
||||
);
|
||||
|
||||
$package = $this->loader->load($config);
|
||||
$this->assertSame([], $package->getSupport());
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue