DefaultDriver.php 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  1. <?php
  2. /**
  3. * This file is part of the ForkBB <https://github.com/forkbb>.
  4. *
  5. * @copyright (c) Visman <mio.visman@yandex.ru, https://github.com/MioVisman>
  6. * @license The MIT License (MIT)
  7. */
  8. declare(strict_types=1);
  9. namespace ForkBB\Core\Image;
  10. use ForkBB\Core\Files;
  11. use ForkBB\Core\Exceptions\FileException;
  12. class DefaultDriver
  13. {
  14. const DEFAULT = true;
  15. /**
  16. * @var bool
  17. */
  18. protected $ready;
  19. /**
  20. * @var Files
  21. */
  22. protected $files;
  23. public function __construct(Files $files)
  24. {
  25. $this->ready = true;
  26. $this->files = $files;
  27. }
  28. public function ready(): bool
  29. {
  30. return $this->ready;
  31. }
  32. public function readFromStr(string $data) /* : mixed|false */
  33. {
  34. return false;
  35. }
  36. public function readFromPath(string $path) /* : mixed|false */
  37. {
  38. return false;
  39. }
  40. public function writeToPath(/* mixed */ $image, string $path, int $quality): ?bool
  41. {
  42. return null;
  43. }
  44. public function resize(/* mixed */ $image, int $maxW, int $maxH) /* : mixed */
  45. {
  46. return $image;
  47. }
  48. public function destroy(/* mixed */ $image): void
  49. {
  50. }
  51. }