+ } elseif ( substr( $dependency, 0, 4 ) === 'ext-' ) {
+ // PHP extensions
+ $phpExtension = substr( $dependency, 4 );
+ if ( $constraint !== '*' ) {
+ throw new UnexpectedValueException( 'Version constraints for '
+ . 'PHP extensions are not supported in ' . $extension );
+ }
+ if ( !in_array( $phpExtension, $this->phpExtensions, true ) ) {
+ $errors[] = [
+ 'msg' =>
+ "{$extension} requires {$phpExtension} PHP extension "
+ . "to be installed."
+ ,
+ 'type' => 'missing-phpExtension',
+ 'missing' => $phpExtension,
+ ];
+ }