misc_pterodactyl-panel/app/Extensions/Hashids.php

23 lines
503 B
PHP
Raw Normal View History

<?php
namespace Pterodactyl\Extensions;
use Hashids\Hashids as VendorHashids;
use Pterodactyl\Contracts\Extensions\HashidsInterface;
class Hashids extends VendorHashids implements HashidsInterface
{
/**
* {@inheritdoc}
*/
public function decodeFirst(string $encoded, string $default = null): mixed
{
$result = $this->decode($encoded);
2021-01-23 20:33:34 +00:00
if (!is_array($result)) {
return $default;
}
return array_first($result, null, $default);
}
}