TestableEnv.php 531 B

1234567891011121314151617181920212223242526272829
  1. <?php
  2. /*
  3. * This file is part of Psy Shell.
  4. *
  5. * (c) 2012-2023 Justin Hileman
  6. *
  7. * For the full copyright and license information, please view the LICENSE
  8. * file that was distributed with this source code.
  9. */
  10. namespace Psy\Test;
  11. use Psy\EnvInterface;
  12. class TestableEnv implements EnvInterface
  13. {
  14. private $env;
  15. public function __construct(array $env = [])
  16. {
  17. $this->env = $env;
  18. }
  19. public function get(string $name)
  20. {
  21. return isset($this->env[$name]) ? $this->env[$name] : null;
  22. }
  23. }