@param FriendParser $parser

@return Friend
@throws \Exception
192152
public static function fromParser(FriendParser $parser): Friend
    {
        $instance = new self();
        $instance->url = $parser->getUrl();
        $instance->username = $parser->getName();
        $instance->imageUrl = $parser->getAvatar();
        $instance->friendsSince = $parser->getFriendsSince();
        $instance->lastOnline = $parser->getLastOnline();

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

        $instance->results = $parser->getResults();
        $instance->lastPage = $parser->getLastPage();

        return $instance;
    }
571489
public static function fromParser(Parser\Character\CharacterParser $parser): self
    {
        $instance = new self();
        $instance->animeography = $parser->getAnimeography();
        $instance->mangaography = $parser->getMangaography();
        $instance->voiceActors = $parser->getVoiceActors();
        $instance->malId = $parser->getMalId();
        $instance->url = $parser->getCharacterUrl();
        $instance->name = $parser->getName();
        $instance->nameKanji = $parser->getNameKanji();
        $instance->nicknames = $parser->getNameNicknames();
        $instance->about = $parser->getAbout();
        $instance->memberFavorites = $parser->getMemberFavorites();
        $instance->imageUrl = $parser->getImage();

        return $instance;
    }
85644
private function buildFromParser(SwaggerParser $parser)
    {
        $context = new DeserializationContext();

        $context->setVersion(
            $parser->getVersion()
        );

        return $this->serializer->deserialize($parser, Swagger::class, 'json', $context);
    }
1222866
public static function fromPersonParser(Parser\Person\PersonParser $parser): self
    {
        $instance = new self();

        $instance->url = $parser->getPersonURL();
        $instance->malId = \Jikan\Helper\Parser::idFromUrl($instance->url);
        $instance->imageUrl = $parser->getPersonImageUrl();
        $instance->name = $parser->getPersonName();
        $instance->alternativeNames = $parser->getPersonAlternateNames();

        return $instance;
    }
507251
protected function startup($parser)
    {
        $reflect = new ReflectionClass($parser);

        $this->configBase = 'parsers.' . $reflect->getShortName();

        if (empty(config("{$this->configBase}.parser.name"))) {
            $this->failed("Required parser.name is missing in parser configuration");
        }

        Log::info(
            get_class($this) . ': ' .
            'Received message from: ' . $this->parsedMail->getHeader('from') . " with subject: '" .
            $this->parsedMail->getHeader('subject') . "' arrived at parser: " .
            config("{$this->configBase}.parser.name")
        );

    }
803594
public function getFriendDetail(Entity\Friend $friend)
    {
        $request = new Request\GetFriendDetailRequest($friend, $this->getCredential());
        $response = $this->sendRequest($request);

        return Request\GetFriendDetailRequest::parseResponse($response);
    }
1256483
public static function parseMangaCard(Parser\Common\MangaCardParser $parser): MangaCard
    {
        $instance = new self();
        self::setProperties($parser, $instance);

        return $instance;
    }
562660
public static function fromParser(PersonParser $parser): self
    {
        $instance = new self();
        $instance->malId = $parser->getPersonId();
        $instance->url = $parser->getPersonURL();
        $instance->imageUrl = $parser->getPersonImageUrl();
        $instance->name = $parser->getPersonName();
        $instance->givenName = $parser->getPersonGivenName();
        $instance->familyName = $parser->getPersonFamilyName();
        $instance->alternateNames = $parser->getPersonAlternateNames();
        $instance->websiteUrl = $parser->getPersonWebsite();
        $instance->birthday = $parser->getPersonBirthday();
        $instance->about = $parser->getPersonAbout();
        $instance->memberFavorites = $parser->getPersonFavorites();
        $instance->voiceActingRoles = $parser->getPersonVoiceActingRoles();
        $instance->animeStaffPositions = $parser->getPersonAnimeStaffPositions();
        $instance->publishedManga = $parser->getPersonPublishedManga();

        return $instance;
    }
668481
public static function fromParser(SeasonListItemParser $parser): self
    {
        $instance = new self();
        $instance->year = $parser->getYear();
        $instance->seasons = $parser->getSeasons();

        return $instance;
    }
822489
public function getParser() : ParserInterface
    {
        if (null === $this->parser) {
            $patternHelper = new Parser\Helper\GetPattern($this->cache, $this->logger);
            $dataHelper = new Parser\Helper\GetData($this->cache, $this->logger, new Quoter());

            $this->parser = new Parser\Ini($patternHelper, $dataHelper, $this->formatter);
        }

        return $this->parser;
    }
195144
public static function fromParser(TopListItemParser $parser): self
    {
        $instance = new self();
        $instance->rank = $parser->getRank();
        $instance->malId = $parser->getMalUrl()->getMalId();
        $instance->title = $parser->getMalUrl()->getTitle();
        $instance->url = $parser->getMalUrl()->getUrl();
        $instance->nameKanji = $parser->getKanjiName();
        $instance->animeography = $parser->getAnimeography();
        $instance->mangaography = $parser->getMangaography();
        $instance->favorites = $parser->getFavorites();
        $instance->imageUrl = $parser->getImage();

        return $instance;
    }
522073
public static function parseAnimeCard(Parser\Common\AnimeCardParser $parser): AnimeCard
    {
        $instance = new self();
        self::setProperties($parser, $instance);

        return $instance;
    }
228567
public static function fromParser(EpisodesParser $parser): self
    {
        $instance = new self();
        $instance->episodes = $parser->getEpisodes();
        $instance->episodesLastPage = $parser->getEpisodesLastPage();

        return $instance;
    }
57361
public static function fromParser(ProducerParser $parser): self
    {
        $instance = new self();
        $instance->malUrl = $parser->getUrl();
        $instance->anime = $parser->getProducerAnime();

        return $instance;
    }
1174812
public static function fromParser(NewsListItemParser $parser): self
    {
        $instance = new self();
        $instance->url = $parser->getUrl();
        $instance->title = $parser->getTitle();
        $instance->date = $parser->getDate();
        $instance->authorName = $parser->getAuthor()->getName();
        $instance->authorUrl = $parser->getAuthor()->getUrl();
        $instance->forumUrl = $parser->getDiscussionLink();
        $instance->imageUrl = $parser->getImage();
        $instance->comments = $parser->getComments();
        $instance->intro = $parser->getIntro();

        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;
    }