File.php 702 B

12345678910111213141516171819202122232425262728293031323334353637
  1. <?php
  2. declare(strict_types=1);
  3. /**
  4. * @package Grav\Framework\File
  5. *
  6. * @copyright Copyright (C) 2015 - 2019 Trilby Media, LLC. All rights reserved.
  7. * @license MIT License; see LICENSE file for details.
  8. */
  9. namespace Grav\Framework\File;
  10. class File extends AbstractFile
  11. {
  12. /**
  13. * {@inheritdoc}
  14. * @see FileInterface::load()
  15. */
  16. public function load()
  17. {
  18. return parent::load();
  19. }
  20. /**
  21. * {@inheritdoc}
  22. * @see FileInterface::save()
  23. */
  24. public function save($data): void
  25. {
  26. if (!\is_string($data)) {
  27. throw new \RuntimeException('Cannot save data, string required');
  28. }
  29. parent::save($data);
  30. }
  31. }