1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950 |
- <?php
- namespace Fgm\ComposerCheck;
- class RequirementsLoader implements LoaderInterface {
- protected $dev = [];
- protected $run = [];
-
- public function __construct(string $directory) {
- $this->file = realpath("${directory}/composer.json");
- }
-
- public function getDev() {
- return $this->dev;
- }
-
- public function getRun() {
- return $this->run;
- }
-
- public function load() {
- $json = json_decode(file_get_contents($this->file), TRUE);
- $this->run = $json['require'] ?? [];
- $this->dev = $json['require-dev'] ?? [];
- }
- }
|