Parser
in package
Class Parser
Table of Contents
Constants
- ALLOWED_NODES = ['p', 'i', 'b', 'br', 'strong', 'u']
Methods
- clubIdFromUrl() : int
- Extract club ID from MAL URl
- idFromUrl() : int
- Extract the id from a mal url
- parseDate() : DateTimeImmutable|null
- parseDateDMY() : DateTimeImmutable|null
- parseDateMDY() : DateTimeImmutable|null
- parseDateMDYReadable() : DateTimeImmutable|null
- parseDateTimePST() : DateTimeImmutable|null
- parseDurationToSeconds() : int|null
- parseForumDate() : DateTimeImmutable|null
- parseImageQuality() : string
- parseImageThumbToHQ() : string
- removeChildNodes() : Crawler
- Removes all html elements so the text is left over
- stringIdFromUrl() : string
- Extract a string id from a mal url
- suffixIdFromUrl() : int
- Extract the last property id from a mal url (e.g episode ID)
- textOrNull() : null|string
Constants
ALLOWED_NODES
private
mixed
ALLOWED_NODES
= ['p', 'i', 'b', 'br', 'strong', 'u']
Methods
clubIdFromUrl()
Extract club ID from MAL URl
public
static clubIdFromUrl(string $url) : int
Parameters
- $url : string
Return values
intidFromUrl()
Extract the id from a mal url
public
static idFromUrl(string $url) : int
Parameters
- $url : string
Return values
intparseDate()
public
static parseDate(string $date) : DateTimeImmutable|null
Parameters
- $date : string
Return values
DateTimeImmutable|nullparseDateDMY()
public
static parseDateDMY(string|null $date) : DateTimeImmutable|null
Parameters
- $date : string|null
Return values
DateTimeImmutable|nullparseDateMDY()
public
static parseDateMDY(string|null $date) : DateTimeImmutable|null
Parameters
- $date : string|null
Return values
DateTimeImmutable|nullparseDateMDYReadable()
public
static parseDateMDYReadable(string $date) : DateTimeImmutable|null
Parameters
- $date : string
Tags
Return values
DateTimeImmutable|nullparseDateTimePST()
public
static parseDateTimePST(string $dateTime) : DateTimeImmutable|null
Parameters
- $dateTime : string
Return values
DateTimeImmutable|nullparseDurationToSeconds()
public
static parseDurationToSeconds(string $duration) : int|null
Parameters
- $duration : string
Return values
int|nullparseForumDate()
public
static parseForumDate(string $date) : DateTimeImmutable|null
Parameters
- $date : string
Return values
DateTimeImmutable|nullparseImageQuality()
public
static parseImageQuality(string $imageUrl) : string
Parameters
- $imageUrl : string
Tags
Return values
stringparseImageThumbToHQ()
public
static parseImageThumbToHQ(string $imageUrl) : string
Parameters
- $imageUrl : string
Tags
Return values
stringremoveChildNodes()
Removes all html elements so the text is left over
public
static removeChildNodes(Crawler $crawler) : Crawler
Parameters
- $crawler : Crawler
Tags
Return values
CrawlerstringIdFromUrl()
Extract a string id from a mal url
public
static stringIdFromUrl(string $url) : string
Parameters
- $url : string
Return values
stringsuffixIdFromUrl()
Extract the last property id from a mal url (e.g episode ID)
public
static suffixIdFromUrl(string $url) : int
Parameters
- $url : string
Return values
inttextOrNull()
public
static textOrNull(Crawler $crawler) : null|string
Parameters
- $crawler : Crawler