SeekerDiscovery.php 453 B

12345678910111213141516171819202122232425
  1. <?php
  2. declare(strict_types=1);
  3. namespace PHPHtmlParser\Discovery;
  4. use PHPHtmlParser\Contracts\Selector\SeekerInterface;
  5. use PHPHtmlParser\Selector\Seeker;
  6. class SeekerDiscovery
  7. {
  8. /**
  9. * @var SeekerInterface|null
  10. */
  11. private static $seeker = null;
  12. public static function find(): SeekerInterface
  13. {
  14. if (self::$seeker == null) {
  15. self::$seeker = new Seeker();
  16. }
  17. return self::$seeker;
  18. }
  19. }