| 1 | <?php |
||
| 7 | class CrawlUrl |
||
| 8 | { |
||
| 9 | /** @var \Psr\Http\Message\UriInterface */ |
||
| 10 | public $url; |
||
| 11 | |||
| 12 | /** @var \Psr\Http\Message\UriInterface */ |
||
| 13 | public $foundOnUrl; |
||
| 14 | |||
| 15 | /** @var mixed */ |
||
| 16 | protected $id; |
||
| 17 | |||
| 18 | /** @var int */ |
||
| 19 | protected $attempts = 0; |
||
| 20 | |||
| 21 | public static function create(UriInterface $url, ?UriInterface $foundOnUrl = null, $id = null) |
||
| 31 | |||
| 32 | protected function __construct(UriInterface $url, $foundOnUrl = null) |
||
| 37 | |||
| 38 | /** |
||
| 39 | * @return mixed|null |
||
| 40 | */ |
||
| 41 | public function getId() |
||
| 45 | |||
| 46 | public function setId($id) |
||
| 50 | |||
| 51 | /** |
||
| 52 | * Returns the number of attempts to load this URL. |
||
| 53 | * |
||
| 54 | * @return int |
||
| 55 | */ |
||
| 56 | public function getAttempts() : int |
||
| 60 | |||
| 61 | /** |
||
| 62 | * @return void |
||
| 63 | */ |
||
| 64 | public function incrementAttempts() |
||
| 68 | } |
||
| 69 |