decode(); } /** * Get decoder for current instance * * @param resource $source * @param null|int $length * @throws DecoderException * @return AbstractDecoder */ protected static function getDecoder($source, ?int $length = null): AbstractDecoder { $classname = self::getDecoderClassname(); if (!class_exists($classname)) { throw new DecoderException("Decoder for '" . static::class . "' not found."); } return new $classname($source, $length); } /** * Get classname of decoder for current classname * * @return string */ protected static function getDecoderClassname(): string { return sprintf('Intervention\Gif\Decoders\%sDecoder', self::getShortClassname()); } }