forked from php-embed/Embed
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathExtractor.php
More file actions
45 lines (39 loc) · 1.13 KB
/
Extractor.php
File metadata and controls
45 lines (39 loc) · 1.13 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
<?php
declare(strict_types = 1);
namespace Embed\Adapters\Archive;
use Embed\Extractor as Base;
use Embed\Http\Crawler;
use Psr\Http\Message\RequestInterface;
use Psr\Http\Message\ResponseInterface;
use Psr\Http\Message\UriInterface;
/**
* @template-extends Base<\Embed\Detectors\Detector<self>>
*/
class Extractor extends Base
{
private Api $api;
public function __construct(
UriInterface $uri,
RequestInterface $request,
ResponseInterface $response,
Crawler $crawler
) {
parent::__construct($uri, $request, $response, $crawler);
$this->api = new Api($this);
}
public function getApi(): Api
{
return $this->api;
}
public function createCustomDetectors(): array
{
return [
'title' => new Detectors\Title($this),
'description' => new Detectors\Description($this),
'code' => new Detectors\Code($this),
'authorName' => new Detectors\AuthorName($this),
'providerName' => new Detectors\ProviderName($this),
'publishedTime' => new Detectors\PublishedTime($this),
];
}
}