mirror of
https://github.com/crazywhalecc/static-php-cli.git
synced 2026-03-18 04:44:53 +08:00
Auto-append prefix for php-extension packages
This commit is contained in:
parent
e9d3f7e7eb
commit
20892ab194
@ -8,7 +8,12 @@ namespace StaticPHP\Attribute\Package;
|
|||||||
* Indicates that the annotated class defines a PHP extension.
|
* Indicates that the annotated class defines a PHP extension.
|
||||||
*/
|
*/
|
||||||
#[\Attribute(\Attribute::TARGET_CLASS | \Attribute::IS_REPEATABLE)]
|
#[\Attribute(\Attribute::TARGET_CLASS | \Attribute::IS_REPEATABLE)]
|
||||||
readonly class Extension
|
class Extension
|
||||||
{
|
{
|
||||||
public function __construct(public string $name) {}
|
public function __construct(public string $name)
|
||||||
|
{
|
||||||
|
if (!str_starts_with($name, 'ext-')) {
|
||||||
|
$this->name = "ext-{$name}";
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user