ArrayableStubObject.php 413 B

12345678910111213141516171819202122232425
  1. <?php
  2. namespace Illuminate\Tests\Testing\Stubs;
  3. use Illuminate\Contracts\Support\Arrayable;
  4. class ArrayableStubObject implements Arrayable
  5. {
  6. protected $data;
  7. public function __construct($data = [])
  8. {
  9. $this->data = $data;
  10. }
  11. public static function make($data = [])
  12. {
  13. return new self($data);
  14. }
  15. public function toArray()
  16. {
  17. return $this->data;
  18. }
  19. }