Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
pterodactyl
GitHub Repository: pterodactyl/panel
Path: blob/1.0-develop/app/Extensions/Hashids.php
7432 views
1
<?php
2
3
namespace Pterodactyl\Extensions;
4
5
use Hashids\Hashids as VendorHashids;
6
use Pterodactyl\Contracts\Extensions\HashidsInterface;
7
8
class Hashids extends VendorHashids implements HashidsInterface
9
{
10
public function decodeFirst(string $encoded, ?string $default = null): mixed
11
{
12
$result = $this->decode($encoded);
13
if (!is_array($result)) {
14
return $default;
15
}
16
17
return array_first($result, null, $default);
18
}
19
}
20
21