PermissionInfo.php 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  1. <?php
  2. /**
  3. * Copyright © 2013-2017 Magento, Inc. All rights reserved.
  4. * See COPYING.txt for license details.
  5. */
  6. namespace Magento\Update;
  7. /**
  8. * Class PermissionInfo
  9. *
  10. * Data object for returning lists of non-writable, non-readable paths found by cron readiness permission's check
  11. */
  12. class PermissionInfo
  13. {
  14. /** @var string[] */
  15. private $nonWritablePaths;
  16. /** @var string[] */
  17. private $nonReadablePaths;
  18. /**
  19. * PermissionInfo constructor.
  20. *
  21. * @param string[] $nonWritablePaths List of paths which are not writable
  22. * @param string[] $nonReadablePaths List of paths which are not readable
  23. */
  24. public function __construct($nonWritablePaths, $nonReadablePaths)
  25. {
  26. $this->nonWritablePaths = $nonWritablePaths;
  27. $this->nonReadablePaths = $nonReadablePaths;
  28. }
  29. /**
  30. * Get array of non-writable paths
  31. *
  32. * @return \string[]
  33. */
  34. public function getNonWritablePaths() {
  35. return $this->nonWritablePaths;
  36. }
  37. /**
  38. * Get array of non-readable paths
  39. *
  40. * @return \string[]
  41. */
  42. public function getNonReadablePaths() {
  43. return $this->nonReadablePaths;
  44. }
  45. /**
  46. * See if there are any non-writable or non-readable
  47. * @return bool
  48. */
  49. public function containsPaths() {
  50. return !empty($this->nonWritablePaths) || !empty($this->nonReadablePaths);
  51. }
  52. }