Files
pterodactyl-panel/app/Extensions/Hashids.php
T

20 lines
467 B
PHP
Raw Normal View History

2017-09-09 23:55:21 -05:00
<?php
namespace Pterodactyl\Extensions;
use Hashids\Hashids as VendorHashids;
use Pterodactyl\Contracts\Extensions\HashidsInterface;
class Hashids extends VendorHashids implements HashidsInterface
{
2024-10-21 19:18:20 -06:00
public function decodeFirst(string $encoded, ?string $default = null): mixed
2017-09-09 23:55:21 -05:00
{
$result = $this->decode($encoded);
2021-01-23 12:33:34 -08:00
if (!is_array($result)) {
2017-09-09 23:55:21 -05:00
return $default;
}
return array_first($result, null, $default);
}
}