LoaderBase.php 603 B

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. <?php
  2. namespace Fgm\ComposerCheck;
  3. /**
  4. * Class LockLoader loads a composer.lock file.
  5. */
  6. abstract class LoaderBase implements LoaderInterface {
  7. protected $contents;
  8. protected $file;
  9. protected $platform = [];
  10. protected $dev = [];
  11. protected $run = [];
  12. /**
  13. * {@inheritdoc}
  14. */
  15. public function getDev() {
  16. return $this->dev;
  17. }
  18. /**
  19. * {@inheritdoc}
  20. */
  21. public function getRun() {
  22. return $this->run;
  23. }
  24. /**
  25. * {@inheritdoc}
  26. */
  27. public function load(string $file = NULL) {
  28. $this->contents = json_decode(file_get_contents($this->file), TRUE);
  29. }
  30. }