Use native typing in more places and clean up 'FeedEnclosure' a bit.

This commit is contained in:
wn_
2024-12-10 20:31:16 +00:00
parent 333bab90a7
commit a1bd6cea1b
13 changed files with 71 additions and 115 deletions

View File

@@ -1,29 +1,23 @@
<?php
class FeedParser {
private DOMDocument $doc;
/** @var DOMDocument */
private $doc;
/** @var string|null */
private $error = null;
private ?string $error = null;
/** @var array<string> */
private $libxml_errors = [];
private array $libxml_errors = [];
/** @var array<FeedItem> */
private $items = [];
private array $items = [];
/** @var string|null */
private $link;
private ?string $link = null;
/** @var string|null */
private $title;
private ?string $title = null;
/** @var FeedParser::FEED_*|null */
private $type;
private ?int $type = null;
/** @var DOMXPath|null */
private $xpath;
private ?DOMXPath $xpath = null;
const FEED_UNKNOWN = -1;
const FEED_RDF = 0;