Skip to content

Commit

Permalink
fixes #535
Browse files Browse the repository at this point in the history
  • Loading branch information
irfan-dahir committed Oct 17, 2023
1 parent 7724731 commit f1d6258
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 9 deletions.
12 changes: 6 additions & 6 deletions src/Model/Common/Title.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,15 +19,15 @@ class Title
private string $type;

/**
* @var string
* @var string|null
*/
private string $title;
private ?string $title;

/**
* @param string $title
* @param string|null $title
* @param string $type
*/
public function __construct(string $type, string $title)
public function __construct(string $type, ?string $title)
{
$this->type = $type;
$this->title = $title;
Expand All @@ -42,9 +42,9 @@ public function getType(): string
}

/**
* @return string
* @return string|null
*/
public function getTitle(): string
public function getTitle(): ?string
{
return $this->title;
}
Expand Down
7 changes: 4 additions & 3 deletions src/Parser/Common/AlternativeTitleParser.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ class AlternativeTitleParser implements ParserInterface
/**
* @var Crawler
*/
private $crawler;
private Crawler $crawler;

/**
* EpisodeListItemParser constructor.
Expand All @@ -35,9 +35,10 @@ public function __construct(Crawler $crawler)
*/
public function getModel(): array
{
[$type, $title] = explode(': ', $this->crawler->text(), 2);
[$type, $title] = explode(':', $this->crawler->text(), 2);

if ($type !== 'Synonyms') {
return [new Title($type, $title)];
return [new Title($type, JString::cleanse($title))];
}

$titles = explode(', ', $title);
Expand Down

0 comments on commit f1d6258

Please sign in to comment.