@param Parser\Common\MangaCardParser $parser
@param MangaCard                     $instance

@throws \InvalidArgumentException
@throws \RuntimeException
5584
protected static function setProperties(Parser\Common\MangaCardParser $parser, $instance): void
    {
        $instance->malId = $parser->getMalId();
        $instance->url = $parser->getMangaUrl();
        $instance->title = $parser->getTitle();
        $instance->imageUrl = $parser->getMangaImage();
        $instance->synopsis = $parser->getDescription();
        $instance->type = $parser->getType();
        $instance->publishingStart = $parser->getPublishDates();
        $instance->volumes = $parser->getVolumes();
        $instance->members = $parser->getMembers();
        $instance->genres = $parser->getGenres();
        $instance->type = $parser->getType();
        $instance->authors = $parser->getAuthor();
        $instance->score = $parser->getMangaScore();
        $instance->serialization = $parser->getSerialization();
    }
903340
protected static function setCachedInstance(MessagePartFactory $instance)
    {
        if (self::$instances === null) {
            self::$instances = [];
        }
        $class = get_called_class();
        self::$instances[$class] = $instance;
    }
788
public function remove(TextParser $parser)
    {
        $parserHash = $this->objectHash($parser);

        $this->parsers = array_filter($this->parsers, function ($known) use ($parserHash) {
            return $this->objectHash($known) != $parserHash;
        });

        if (isset($this->parserIds[$parserHash])) {
            unset($this->parserIds[$parserHash]);
        }

        return $this;
    }
471817
public function setParser(Parser $parser)
    {
        if (!empty($this->statics) || !empty($this->dynamics)) {
            throw new \LogicException("You can't define a route parser after registering a route.");
        }

        $this->parser = $parser;
        return $this;
    }
1354217
public function card($card)
    {
        if ($card instanceof Card) {
            $this->card = $card;

            return $this;
        }

        if ($card instanceof Closure) {
            $card($new = new Card());
            $this->card = $new;

            return $this;
        }

        throw new InvalidArgumentException(
            'Invalid Card type. Expected '.Card::class.' or '.Closure::class.'.'
        );
    }
1093572
public static function fromParser(AnimeStatsParser $parser): self
    {
        $instance = new self();
        $instance->daysWatched = $parser->getDaysWatched();
        $instance->meanScore = $parser->getMeanScore();
        $instance->watching = $parser->getWatching();
        $instance->completed = $parser->getCompleted();
        $instance->onHold = $parser->getOnHold();
        $instance->dropped = $parser->getDropped();
        $instance->planToWatch = $parser->getPlanToWatch();
        $instance->totalEntries = $parser->getTotalEntries();
        $instance->rewatched = $parser->getRewatched();
        $instance->episodesWatched = $parser->getEpisodesWatched();


        return $instance;
    }
119026
public function add(TextParser $parser)
    {
        $objectHash = $this->objectHash($parser);

        if (isset($this->parserIds[$objectHash])) {
            return $this;
        }

        $this->parsers[] = $parser;

        $this->parserIds[$objectHash] = true;

        return $this;
    }
768652
protected function instantiate($file, $parser, $resolver)
    {
        $this->instantiateClass($file, 'file', File::class);

        $this->instantiateClass($parser, 'parser', Parser::class);

        $this->instantiateClass($resolver, 'resolver', Resolver::class);
    }
1010360
public static function fromParser(MangaStatsParser $parser): MangaStats
    {
        $instance = new self();
        $instance->daysRead = $parser->getDaysRead();
        $instance->meanScore = $parser->getMeanScore();
        $instance->reading = $parser->getReading();
        $instance->completed = $parser->getCompleted();
        $instance->onHold = $parser->getOnHold();
        $instance->dropped = $parser->getDropped();
        $instance->planToRead = $parser->getPlanToRead();
        $instance->totalEntries = $parser->getTotalEntries();
        $instance->reread = $parser->getReread();
        $instance->chaptersRead = $parser->getChaptersRead();
        $instance->volumesRead = $parser->getVolumesRead();

        return $instance;
    }
564761
public static function fromParser(Parser\Search\MangaSearchListItemParser $parser): self
    {
        $instance = new self();

        $instance->url = $parser->getUrl();
        $instance->malId = \Jikan\Helper\Parser::idFromUrl($instance->url);
        $instance->imageUrl = $parser->getImageUrl();
        $instance->title = $parser->getTitle();
        $instance->synopsis = $parser->getSynopsis();
        $instance->type = $parser->getType();
        $instance->volumes = $parser->getVolumes();
        $instance->chapters = $parser->getChapters();
        $instance->score = $parser->getScore();
        $instance->startDate = $parser->getStartDate();
        $instance->endDate = $parser->getEndDate();
        $instance->members = $parser->getMembers();
        $instance->publishing =
            null === $instance->endDate
            && null !== $instance->startDate
            &&
            (
                new \DateTimeImmutable(
                    'now',
                    new \DateTimeZone('UTC')
                ) > $instance->startDate
            );

        return $instance;
    }
689217
public static function fromParser(FavoritesParser $parser): Favorites
    {
        $instance = new self();
        $instance->anime = $parser->getAnime();
        $instance->manga = $parser->getManga();
        $instance->characters = $parser->getCharacters();
        $instance->people = $parser->getPeople();

        return $instance;
    }
291212
public static final Parser<Integer> instance() { // NOPMD it's thread save!
    if (IntegerParserWithoutSeparator.instanceParser == null) {
      synchronized (IntegerParserWithoutSeparator.class) {
        if (IntegerParserWithoutSeparator.instanceParser == null) {
          IntegerParserWithoutSeparator.instanceParser = new IntegerParserWithoutSeparator();
        }
      }
    }
    return IntegerParserWithoutSeparator.instanceParser;
  }
261884
public static function fromParser(StreamEpisodeListItemParser $parser): self
    {
        $instance = new self();
        $instance->title = $parser->getTitle();
        $instance->episode = $parser->getEpisode();
        $instance->url = $parser->getUrl();
        $instance->imageUrl = $parser->getImageUrl();

        return $instance;
    }
1180225
public static function fromParser(UserProfileParser $parser): self
    {
        $instance = new self();
        $instance->username = $parser->getUsername();
        $instance->imageUrl = $parser->getImage();
        $instance->url = $parser->getUrl();

        return $instance;
    }
162297
public static function fromParser(CharactersAndStaffParser $parser): self
    {
        $instance = new self();
        $instance->characters = $parser->getCharacters();
        $instance->staff = $parser->getStaff();

        return $instance;
    }
307235
public function setParser(ParserInterface $parser)
    {
        $this->parsed = false;
        $this->parser = $parser;
        return $this;
    }
1102319
protected static function setProperties(Parser\Common\AnimeCardParser $parser, $instance): void
    {
        $instance->malId = $parser->getMalId();
        $instance->url = $parser->getAnimeUrl();
        $instance->title = $parser->getTitle();
        $instance->imageUrl = $parser->getAnimeImage();
        $instance->synopsis = $parser->getDescription();
        $instance->type = $parser->getType();
        $instance->airingStart = $parser->getAirDates();
        $instance->episodes = $parser->getEpisodes();
        $instance->members = $parser->getMembers();
        $instance->genres = $parser->getGenres();
        $instance->source = $parser->getSource();
        $instance->producers = $parser->getProducer();
        $instance->score = $parser->getAnimeScore();
        $instance->licensors = $parser->getLicensors();
        $instance->r18 = $parser->isR18();
        $instance->kids = $parser->isKids();
    }