Code Coverage |
||||||||||
Lines |
Functions and Methods |
Classes and Traits |
||||||||
| Total | |
0.00% |
0 / 5 |
|
0.00% |
0 / 2 |
CRAP | |
0.00% |
0 / 1 |
| RequiresPhpVersion | |
0.00% |
0 / 5 |
|
0.00% |
0 / 2 |
6 | |
0.00% |
0 / 1 |
| __construct | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
2 | |||
| applies | |
0.00% |
0 / 4 |
|
0.00% |
0 / 1 |
2 | |||
| 1 | <?php |
| 2 | namespace Apie\Core\Attributes; |
| 3 | |
| 4 | use Apie\Core\Context\ApieContext; |
| 5 | use Composer\Semver\Semver; |
| 6 | |
| 7 | /** |
| 8 | * Tell Apie you can only pick this option if the server is a specific php version. |
| 9 | */ |
| 10 | final class RequiresPhpVersion implements ApieContextAttribute |
| 11 | { |
| 12 | public function __construct( |
| 13 | public string $constraints |
| 14 | ) { |
| 15 | } |
| 16 | public function applies(ApieContext $context): bool |
| 17 | { |
| 18 | return Semver::satisfies( |
| 19 | PHP_VERSION, |
| 20 | $this->constraints |
| 21 | ); |
| 22 | } |
| 23 | } |