1
0
Fork 0

Add build-path to php-ext config options for PIE (#12206)

* Add build-path to php-ext config options

* Use phpstan- prefix for shape definitions
main
James Titcumb 2024-11-21 07:52:30 +00:00 committed by GitHub
parent 9fb833f97e
commit aee3bd14db
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 19 additions and 4 deletions

View File

@ -317,6 +317,12 @@
"example": false, "example": false,
"default": true "default": true
}, },
"build-path": {
"type": ["string", "null"],
"description": "If specified, this is the subdirectory that will be used to build the extension instead of the root of the project.",
"example": "my-extension-source",
"default": null
},
"configure-options": { "configure-options": {
"type": "array", "type": "array",
"description": "These configure options make up the flags that can be passed to ./configure when installing the extension.", "description": "These configure options make up the flags that can be passed to ./configure when installing the extension.",

View File

@ -23,6 +23,7 @@ use Composer\Util\ComposerMirror;
* *
* @phpstan-import-type AutoloadRules from PackageInterface * @phpstan-import-type AutoloadRules from PackageInterface
* @phpstan-import-type DevAutoloadRules from PackageInterface * @phpstan-import-type DevAutoloadRules from PackageInterface
* @phpstan-import-type PhpExtConfig from PackageInterface
*/ */
class Package extends BasePackage class Package extends BasePackage
{ {
@ -98,7 +99,10 @@ class Package extends BasePackage
protected $isDefaultBranch = false; protected $isDefaultBranch = false;
/** @var mixed[] */ /** @var mixed[] */
protected $transportOptions = []; protected $transportOptions = [];
/** @var array{priority?: int, configure-options?: list<array{name: string, description?: string}>}|null */ /**
* @var array|null
* @phpstan-var PhpExtConfig|null
*/
protected $phpExt = null; protected $phpExt = null;
/** /**
@ -593,9 +597,11 @@ class Package extends BasePackage
} }
/** /**
* Sets the list of paths added to PHP's include path. * Sets the settings for php extension packages
* *
* @param array{extension-name?: string, priority?: int, support-zts?: bool, support-nts?: bool, configure-options?: list<array{name: string, description?: string}>}|null $phpExt List of directories. * @param array|null $phpExt
*
* @phpstan-param PhpExtConfig|null $phpExt
*/ */
public function setPhpExt(?array $phpExt): void public function setPhpExt(?array $phpExt): void
{ {

View File

@ -23,6 +23,7 @@ use Composer\Repository\RepositoryInterface;
* *
* @phpstan-type AutoloadRules array{psr-0?: array<string, string|string[]>, psr-4?: array<string, string|string[]>, classmap?: list<string>, files?: list<string>, exclude-from-classmap?: list<string>} * @phpstan-type AutoloadRules array{psr-0?: array<string, string|string[]>, psr-4?: array<string, string|string[]>, classmap?: list<string>, files?: list<string>, exclude-from-classmap?: list<string>}
* @phpstan-type DevAutoloadRules array{psr-0?: array<string, string|string[]>, psr-4?: array<string, string|string[]>, classmap?: list<string>, files?: list<string>} * @phpstan-type DevAutoloadRules array{psr-0?: array<string, string|string[]>, psr-4?: array<string, string|string[]>, classmap?: list<string>, files?: list<string>}
* @phpstan-type PhpExtConfig array{extension-name?: string, priority?: int, support-zts?: bool, support-nts?: bool, build-path?: string|null, configure-options?: list<array{name: string, description?: string}>}
*/ */
interface PackageInterface interface PackageInterface
{ {
@ -326,7 +327,9 @@ interface PackageInterface
/** /**
* Returns the settings for php extension packages * Returns the settings for php extension packages
* *
* @return array{extension-name?: string, priority?: int, support-zts?: bool, support-nts?: bool, configure-options?: list<array{name: string, description?: string}>}|null * @return array|null
*
* @phpstan-return PhpExtConfig|null
*/ */
public function getPhpExt(): ?array; public function getPhpExt(): ?array;