Skip to content

Commit

Permalink
Validate php-ext is only set for php-ext or php-ext-zend packages
Browse files Browse the repository at this point in the history
  • Loading branch information
Seldaek committed Mar 20, 2024
1 parent 87b8d0d commit 4997b9e
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/Composer/Package/Loader/ValidatingArrayLoader.php
Original file line number Diff line number Diff line change
Expand Up @@ -248,6 +248,10 @@ public function load(array $config, string $class = 'Composer\Package\CompletePa
}

$this->validateArray('php-ext');
if (isset($this->config['php-ext']) && !in_array($this->config['type'] ?? '', ['php-ext', 'php-ext-zend'], true)) {
$this->errors[] = 'php-ext can only be set by packages of type "php-ext" or "php-ext-zend" which must be C extensions';
unset($this->config['php-ext']);
}

$unboundConstraint = new Constraint('=', '10000000-dev');

Expand Down

0 comments on commit 4997b9e

Please sign in to comment.