Files
pyrodactyl/app/Extensions/Hashids.php
2024-11-17 12:05:08 +00:00

20 lines
467 B
PHP

<?php
namespace Pterodactyl\Extensions;
use Hashids\Hashids as VendorHashids;
use Pterodactyl\Contracts\Extensions\HashidsInterface;
class Hashids extends VendorHashids implements HashidsInterface
{
public function decodeFirst(string $encoded, ?string $default = null): mixed
{
$result = $this->decode($encoded);
if (!is_array($result)) {
return $default;
}
return array_first($result, null, $default);
}
}