}
sub create_child_type {
- my ($self, %opts) = @_;
- my $class = ref $self;
- my $constraint = Moose::Meta::TypeConstraint->new(%opts, parent => $self);
-
+ my ( $self, %opts ) = @_;
+
+ my $constraint
+ = Moose::Meta::TypeConstraint->new( %opts, parent => $self );
+
# if we have a type constraint union, and no
# type check, this means we are just aliasing
# the union constraint, which means we need to
# handle this differently.
# - SL
- if (
- not(defined $opts{constraint})
- && $self->has_coercion
- ) {
- $constraint->coercion(Moose::Meta::TypeCoercion::Union->new(
- type_constraint => $self,
- ));
+ if ( not( defined $opts{constraint} )
+ && $self->has_coercion ) {
+ $constraint->coercion(
+ Moose::Meta::TypeCoercion::Union->new(
+ type_constraint => $self,
+ )
+ );
}
-
+
return $constraint;
}