Skip to content

Commit 13eaa8b

Browse files
committed
removed old code
1 parent 2b8887f commit 13eaa8b

File tree

1 file changed

+3
-45
lines changed

1 file changed

+3
-45
lines changed

src/Document.php

Lines changed: 3 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -78,51 +78,9 @@ public function select(string $query, array $attributes = null, DOMNode $context
7878
return new QueryResult($this->xpath->query($query, $context), $this->extractor);
7979
}
8080

81-
public function meta(string ...$types): ?string
82-
{
83-
$metas = $this->getMetas();
84-
85-
foreach ($types as $type) {
86-
$values = $metas[$type] ?? null;
87-
$value = !empty($values[0]) ? clean($values[0]) : null;
88-
89-
if ($value) {
90-
return $value;
91-
}
92-
}
93-
94-
return null;
95-
}
96-
97-
public function metaUrl(string ...$types): ?UriInterface
98-
{
99-
$value = $this->meta(...$types);
100-
101-
if (!$value) {
102-
return null;
103-
}
104-
105-
return $this->extractor->resolveUri($value);
106-
}
107-
108-
public function metas(string ...$types): array
109-
{
110-
$metas = $this->getMetas();
111-
112-
foreach ($types as $type) {
113-
$values = $metas[$type] ?? [];
114-
115-
return array_values(
116-
array_filter(
117-
array_map(
118-
fn ($value) => clean($value),
119-
$values
120-
)
121-
)
122-
);
123-
}
124-
}
125-
81+
/**
82+
* Shortcut to select a <link> element and return the href
83+
*/
12684
public function link(string $rel, array $extra = []): ?UriInterface
12785
{
12886
return $this->select('.//link', ['rel' => $rel] + $extra)->url('href');

0 commit comments

Comments
 (0)