mirror of
https://github.com/crazywhalecc/static-php-cli.git
synced 2026-07-09 01:45:36 +08:00
Refactor package stage handling and update class structures for improved flexibility
This commit is contained in:
@@ -10,5 +10,5 @@ namespace StaticPHP\Attribute\Package;
|
||||
#[\Attribute(\Attribute::TARGET_METHOD | \Attribute::IS_REPEATABLE)]
|
||||
readonly class AfterStage
|
||||
{
|
||||
public function __construct(public string $package_name, public string $stage, public ?string $only_when_package_resolved = null) {}
|
||||
public function __construct(public string $package_name, public array|string $stage, public ?string $only_when_package_resolved = null) {}
|
||||
}
|
||||
|
||||
@@ -8,7 +8,12 @@ namespace StaticPHP\Attribute\Package;
|
||||
* Indicates that the annotated method should be executed before a specific stage of the build process for a given package.
|
||||
*/
|
||||
#[\Attribute(\Attribute::TARGET_METHOD | \Attribute::IS_REPEATABLE)]
|
||||
readonly class BeforeStage
|
||||
class BeforeStage
|
||||
{
|
||||
public function __construct(public string $package_name, public string $stage, public ?string $only_when_package_resolved = null) {}
|
||||
public readonly array|string $stage;
|
||||
|
||||
public function __construct(public string $package_name = '', array|callable|string $stage = '', public ?string $only_when_package_resolved = null)
|
||||
{
|
||||
$this->stage = $stage;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -10,5 +10,5 @@ namespace StaticPHP\Attribute\Package;
|
||||
#[\Attribute(\Attribute::TARGET_METHOD | \Attribute::IS_REPEATABLE)]
|
||||
readonly class Stage
|
||||
{
|
||||
public function __construct(public string $name) {}
|
||||
public function __construct(public ?string $function = null) {}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user