HEX
Server: Apache/2.4.46 (Win64) OpenSSL/1.1.1j PHP/8.4.25
System: Windows NT DESKTOP-4TAV2RJ 10.0 build 19045 (Windows 10) AMD64
User: fred (0)
PHP: 8.4.25
Disabled: NONE
Upload Files
File: C:/xampp/perl/vendor/lib/MooseX/Meta/TypeCoercion/Structured/Optional.pm
package ## Hide from PAUSE
  MooseX::Meta::TypeCoercion::Structured::Optional;

our $VERSION = '0.36';

use Moose;
extends 'Moose::Meta::TypeCoercion';

sub compile_type_coercion {
    my ($self) = @_;
    my $constraint = $self->type_constraint->type_parameter;

    $self->_compiled_type_coercion(sub {
        my ($value) = @_;
        return unless $constraint->has_coercion;
        return $constraint->coerce($value);
    });
}

sub has_coercion_for_type { 0 }

sub add_type_coercions {
    Moose->throw_error("Cannot add additional type coercions to Optional types");
}

no Moose;
__PACKAGE__->meta->make_immutable(inline_constructor => 0);

1;