🚀 Advanced Web Server Manager
Complete File Manager & Terminal - Standalone Version
By Sid Gifari | Gifari Industries
Current path:
/
/
home2
/
birthday
/
event.krishivgroups.in
/
vendor
/
intervention
/
gif
/
src
/
Traits
✏️
Editing: CanDecode.php
<?php declare(strict_types=1); namespace Intervention\Gif\Traits; use Intervention\Gif\Decoders\AbstractDecoder; use Intervention\Gif\Exceptions\DecoderException; trait CanDecode { /** * Decode current instance * * @param resource $source * @param null|int $length * @throws DecoderException * @return mixed */ public static function decode($source, ?int $length = null): mixed { return self::getDecoder($source, $length)->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()); } }
💾 Save Changes
❌ Cancel