Files

23 lines
503 B
PHP
Raw Permalink 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
{
/**
* {@inheritdoc}
*/
2022-10-14 10:59: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);
}
}