@param HistoryItemParser $parser

@return History
@throws \InvalidArgumentException
@throws \Exception
438871
public static function fromParser(HistoryItemParser $parser): self
    {
        $instance = new self();
        $instance->malUrl = $parser->getUrl();
        $instance->increment = $parser->getIncrement();
        $instance->date = $parser->getDate();

        return $instance;
    }
230606
public static function fromParser(MangaReviewParser $parser): MangaReview
    {
        $instance = new self();

        $instance->malId = $parser->getId();
        $instance->url = $parser->getUrl();
        $instance->helpfulCount= $parser->getHelpfulCount();
        $instance->date = $parser->getDate();
        $instance->reviewer = $parser->getReviewer();
        $instance->content = $parser->getContent();

        return $instance;
    }
305859
public function actionHistory()
    {
        $history = $this->wrappedObject->actions()->get();

        return $this->presenter->decorate($history);
    }
185084
public function clearHistory()
    {
        $this->historyLines = array();
        $this->historyPosition = null;

        if ($this->historyUnsaved !== null) {
            $this->setInput($this->historyUnsaved);
            $this->historyUnsaved = null;
        }

        return $this;
    }
1050742
public function setHistoryRowClass($historyRowClass)
    {
        if (!in_array('Zend_Db_Table_Row_Abstract', class_parents($historyRowClass))) {
            throw new \InvalidArgumentException(sprintf('History job row class must be instance of Zend_Db_Table_Row_Abstract, given %s.', get_class($historyRowClass)));
        }
        
        $this->historyRowClass = $historyRowClass;
        return $this;
    }
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;
    }
42868
public static function fromParser(Parser\Search\AnimeSearchListItemParser $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->episodes = $parser->getEpisodes();
        $instance->score = $parser->getScore();
        $instance->startDate = $parser->getStartDate();
        $instance->endDate = $parser->getEndDate();
        $instance->members = $parser->getMembers();
        $instance->rated = $parser->getRated();
        $instance->airing = $parser->isAiring();

        return $instance;
    }
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;
    }
225951
public function history($status, JobInterface $job, $message = null)
    {
        $history = $this->createHistoryRowObject();
        if (!$history instanceof HistoryInterface) {
            throw new \InvalidArgumentException(sprintf('History must be an instance of "Extlib\Cron\Adapter\Job\HistoryInterface", "%s" given.', get_class($history)));
        }

        if (!in_array($status, array(HistoryInterface::STATUS_OK, HistoryInterface::STATUS_WARNING, HistoryInterface::STATUS_ERROR))) {
            throw new \InvalidArgumentException(sprintf('Unknown status - "%s".', $status));
        }

        $history->setJob($job);
        $history->setStatus($status);
        $history->setRunDate($this->date);

        if (null !== $message) {
            $history->setMessage($message);
        }

        $history->save();
        return $this;
    }
967049
public function setParser($parser) {
        switch ($parser) {
            case self::PARSER_XML:
            case self::PARSER_XMLDTD:
            case self::PARSER_HTML:
            case self::PARSER_HTML5:
            case self::PARSER_HTML4:
            case self::PARSER_HTML4TR:
                $this->parser = $parser;
                return $this;
            default:
                throw new UnknownParserException('Unknown parser "' . $parser . '"');
        }
    }
395476
public static JobHistoryFileParser createJobHistoryFileParser(
      byte[] historyFileContents, Configuration jobConf) throws IllegalArgumentException {

    if (historyFileContents == null) {
      throw new IllegalArgumentException(
          "Job history contents should not be null");
    }

    HadoopVersion version = getVersion(historyFileContents);

    switch (version) {
    case TWO:
      return new JobHistoryFileParserHadoop2(jobConf);

    default:
      throw new IllegalArgumentException(
          " Unknown format of job history file ");
    }
  }
304516
public function disableParser($parser)
    {
        if ($parser instanceof ValueParserInterface) {
            $parser = $parser->getName();
        }

        if (is_string($parser)) {
            $this->disabledParsers[] = $parser;
        }

        return $this;
    }
716049
public function removeParser($parser)
    {
        if ($parser instanceof ValueParserInterface) {
            $parser = $parser->getName();
        }

        if (is_string($parser) && $this->hasParser($parser)) {
            unset($this->parsers[$parser]);
        }

        return $this;
    }
534192
public static function fromParser(MangaGenreParser $parser): self
    {
        $instance = new self();
        $instance->itemCount = $parser->getCount();
        $instance->manga = $parser->getGenreManga();
        $instance->malUrl = new MalUrl(
            $parser->getName(),
            $parser->getUrl()
        );

        return $instance;
    }
1318582
public function init($parts, $parser = LinkUtil::class)
    {

        if (is_string($parts) && filter_var($parts, FILTER_VALIDATE_URL)) {
            $parts = $parser::parse($parts);
        }

        /**@var $Property \ReflectionProperty */
        foreach((new \ReflectionObject($this))->getProperties(\ReflectionProperty::IS_PUBLIC) as $Property) {
            if ((!$Property->getValue($this)) && isset($parts[$Property->getName()])) {
                $Property->setValue($this, $parts[$Property->getName()]);
            }
        }

        return $this;
    }
1197725
public static function fromParser(VideosParser $parser): self
    {
        $instance = new self();
        $instance->episodes = $parser->getEpisodes();
        $instance->promo = $parser->getPromos();

        return $instance;
    }
902261
public function init(Parser $parser, Renderer $renderer) {
        foreach ($this->ruleRenderers as $ruleRenderer) {
            $renderer->registerRenderer($ruleRenderer, $this->name);
        }

        $parser->setRenderer($renderer);

        return $this;
    }