final public static function box($plainValue): self
    {
        foreach (static::valueNames() as $name) {
            if (self::constant($name) === $plainValue) {
                return self::__callStatic($name, []);
            }
        }

        $message = sprintf('Value %s is not within %s enumeration.', $plainValue, static::class);
        throw new InvalidArgumentException($message);
    }
final public static function box($plainValue): self
    {
        foreach (static::valueNames() as $name) {
            if (self::constant($name) === $plainValue) {
                return self::__callStatic($name, []);
            }
        }

        $message = sprintf('Value %s is not within %s enumeration.', $plainValue, static::class);
        throw new InvalidArgumentException($message);
    }
final public static function box ( $ plainValue ) : self { foreach ( static :: valueNames ( ) as $ name ) { if ( self :: constant ( $ name ) === $ plainValue ) { return self :: __callStatic ( $ name , [ ] ) ; } } $ message = sprintf ( 'Value %s is not within %s enumeration.' , $ plainValue , static :: class ) ; throw new InvalidArgumentException ( $ message ) ; }
Box the given plain value.

@param mixed $plainValue The plain value to be boxed.

@return static The boxed value.

@throws InvalidArgumentException If the given plain value is not within the enumeration.
Box the given plain value .