Skip to content

Commit fc0b386

Browse files
committed
code styles
1 parent 0d47d1f commit fc0b386

File tree

2 files changed

+29
-28
lines changed

2 files changed

+29
-28
lines changed

demo/index.php

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -151,10 +151,10 @@ function printCode(?string $code, bool $asHtml = true): void
151151
pre { overflow: auto; background: #EEE; padding: 1em; }
152152

153153
/* form */
154-
form { background: #EEE; border-bottom: solid 1px #DDD; color: #666; padding: 3em 1.5em; }
155-
fieldset { border: none; padding: 0; }
154+
form { background: #EEE; border-bottom: solid 1px #DDD; color: #666; padding: 1em 1.5em; }
155+
fieldset { border: none; padding: 1em 0; }
156156
label { display: block; cursor: pointer; font-weight: bold; }
157-
input[type="url"], textarea { border: none; background: white; border-radius: 2px; box-sizing: border-box; min-width: 100%; margin: 5px 0; font-size: 1.3em; padding: 0.5em; color: #666; }
157+
input[type="url"], textarea { border: none; background: white; border-radius: 2px; box-sizing: border-box; min-width: 100%; margin: 5px 0; font-size: 1.3em; padding: 0.5em; color: #666; resize: vertical; }
158158
button, summary { font-size: 1.6rem; font-weight: bold; font-family: Arial; background: yellowgreen; border: none; border-radius: 3px; padding: 0.3em 1em; cursor: pointer; margin-top: 5px; }
159159
button:hover, summary:hover { background: black; color: white; }
160160
details {
@@ -184,21 +184,22 @@ function printCode(?string $code, bool $asHtml = true): void
184184
<span>Url to test:</span>
185185
<input type="url" name="url" autofocus placeholder="http://" value="<?php echo getEscapedUrl(); ?>">
186186
</label>
187+
<br>
187188
<label>
188189
<span>Settings:</span>
189190
<?php
190191
$placeholderJson = json_encode(['instagram:token' => null], JSON_PRETTY_PRINT);
191192
$currentJson = getJsonSettings();
192193
?>
193-
<textarea name="settings" rows="3" placeholder='<?php echo $placeholderJson; ?>'><?php
194+
<textarea name="settings" rows="2" placeholder='<?php echo $placeholderJson; ?>'><?php
194195
echo !empty($currentJson)
195196
? json_encode($currentJson, JSON_PRETTY_PRINT | JSON_FORCE_OBJECT)
196197
: '';
197198
?></textarea>
198-
<span class="helptext">Add settings like "instagram:token", "facebook:token", ...</span>
199+
<span class="helptext">Add settings in JSON like "instagram:token", "facebook:token", ...</span>
199200
</label>
200201
</fieldset>
201-
202+
202203
<fieldset class="action">
203204
<button type="submit">Test</button>
204205
&nbsp;&nbsp;&nbsp;

src/Extractor.php

Lines changed: 22 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -34,25 +34,25 @@
3434
/**
3535
* Class to extract the info
3636
*
37-
* @property-read string|null $authorName
38-
* @property-read UriInterface|null $authorUrl
39-
* @property-read string|null $cms
40-
* @property-read EmbedCode|null $code
41-
* @property-read string|null $description
42-
* @property-read UriInterface $favicon
43-
* @property-read array|UriInterface[] $feeds
44-
* @property-read UriInterface|null $icon
45-
* @property-read UriInterface|null $image
46-
* @property-read array|string[] $keywords
47-
* @property-read string|null $language
48-
* @property-read array|UriInterface[] $languages
49-
* @property-read string|null $license
50-
* @property-read string $providerName
51-
* @property-read UriInterface $providerUrl
52-
* @property-read DateTime|null $publishedTime
53-
* @property-read UriInterface|null $redirect
54-
* @property-read string|null $title
55-
* @property-read UriInterface $url
37+
* @property string|null $authorName
38+
* @property UriInterface|null $authorUrl
39+
* @property string|null $cms
40+
* @property EmbedCode|null $code
41+
* @property string|null $description
42+
* @property UriInterface $favicon
43+
* @property array|UriInterface[] $feeds
44+
* @property UriInterface|null $icon
45+
* @property UriInterface|null $image
46+
* @property array|string[] $keywords
47+
* @property string|null $language
48+
* @property array|UriInterface[] $languages
49+
* @property string|null $license
50+
* @property string $providerName
51+
* @property UriInterface $providerUrl
52+
* @property DateTime|null $publishedTime
53+
* @property UriInterface|null $redirect
54+
* @property string|null $title
55+
* @property UriInterface $url
5656
*/
5757
class Extractor
5858
{
@@ -61,10 +61,10 @@ class Extractor
6161
private UriInterface $uri;
6262
private Crawler $crawler;
6363

64-
private Document $document;
64+
protected Document $document;
6565
protected OEmbed $oembed;
66-
private LinkedData $linkedData;
67-
private Metas $metas;
66+
protected LinkedData $linkedData;
67+
protected Metas $metas;
6868

6969
private array $settings = [];
7070
private array $customDetectors = [];

0 commit comments

Comments
 (0)