1<?php
2/**
3 * This file is part of the FreeDSx ASN1 package.
4 *
5 * (c) Chad Sikorra <Chad.Sikorra@gmail.com>
6 *
7 * For the full copyright and license information, please view the LICENSE
8 * file that was distributed with this source code.
9 */
10
11namespace FreeDSx\Asn1\Type;
12
13use function is_float;
14use function is_int;
15
16/**
17 * Functionality needed between integer / enums for big int validation / checking.
18 *
19 * @author Chad Sikorra <Chad.Sikorra@gmail.com>
20 */
21trait BigIntTrait
22{
23    /**
24     * Whether or not the contained value is larger than the PHP_INT_MAX value (represented as a string value).
25     *
26     * @return bool
27     */
28    public function isBigInt(): bool
29    {
30        if (is_int($this->value)) {
31            return false;
32        }
33
34        return is_float($this->value + 0);
35    }
36}
37