TestCommand.php 868 B

123456789101112131415161718192021222324252627282930313233343536373839
  1. <?php
  2. namespace App\Console\Commands;
  3. use Illuminate\Console\Command;
  4. use Nerd\CartesianProduct\CartesianProduct;
  5. class TestCommand extends Command
  6. {
  7. /**
  8. * The name and signature of the console command.
  9. *
  10. * @var string
  11. */
  12. protected $signature = 'test';
  13. /**
  14. * The console command description.
  15. *
  16. * @var string
  17. */
  18. protected $description = 'Command description';
  19. /**
  20. * Execute the console command.
  21. *
  22. * @return int
  23. */
  24. public function handle()
  25. {
  26. $cartesianProduct = new CartesianProduct();
  27. $cartesianProduct->appendSet(["a"]);
  28. dump($cartesianProduct->compute());
  29. $cartesianProduct = new CartesianProduct();
  30. $cartesianProduct->appendSet(["a"]);
  31. $cartesianProduct->appendSet(["b"]);
  32. dump($cartesianProduct->compute());
  33. }
  34. }