Code Coverage |
||||||||||
Lines |
Functions and Methods |
Classes and Traits |
||||||||
| Total | |
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
CRAP | |
100.00% |
1 / 1 |
| Extension | |
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
1 | |
100.00% |
1 / 1 |
| isLoaded | |
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
1 | |||
| 1 | <?php |
| 2 | |
| 3 | declare(strict_types=1); |
| 4 | |
| 5 | /** |
| 6 | * Fast Forward Development Tools for PHP projects. |
| 7 | * |
| 8 | * This file is part of fast-forward/dev-tools project. |
| 9 | * |
| 10 | * @author Felipe Sayão Lobato Abreu <github@mentordosnerds.com> |
| 11 | * @license https://opensource.org/licenses/MIT MIT License |
| 12 | * |
| 13 | * @see https://github.com/php-fast-forward/ |
| 14 | * @see https://github.com/php-fast-forward/dev-tools |
| 15 | * @see https://github.com/php-fast-forward/dev-tools/issues |
| 16 | * @see https://php-fast-forward.github.io/dev-tools/ |
| 17 | * @see https://datatracker.ietf.org/doc/html/rfc2119 |
| 18 | */ |
| 19 | |
| 20 | namespace FastForward\DevTools\Php; |
| 21 | |
| 22 | /** |
| 23 | * Checks PHP runtime extension availability through PHP's native runtime. |
| 24 | */ |
| 25 | class Extension implements ExtensionInterface |
| 26 | { |
| 27 | /** |
| 28 | * Determines whether a PHP extension is loaded in the current runtime. |
| 29 | * |
| 30 | * @param string $name the extension name |
| 31 | * |
| 32 | * @return bool true when the extension is loaded |
| 33 | */ |
| 34 | public function isLoaded(string $name): bool |
| 35 | { |
| 36 | return \extension_loaded($name); |
| 37 | } |
| 38 | } |