src/SellerLabs/Nucleus/Meditation/Spec.php
public function getFieldConstraints($fieldName)
    {
        $maybeConstraints = $this->annotations->lookupIn(
            [$fieldName, static::ANNOTATION_CONSTRAINTS]
        );

        if ($maybeConstraints->isNothing()) {
            return ArrayList::zero();
        }

        $constraints = Maybe::fromJust($maybeConstraints);

        if (is_array($constraints)) {
            return ArrayList::of($constraints);
        } elseif ($constraints instanceof IterableType) {
            return $constraints;
        }

        return ArrayList::of([$constraints]);
    }
public function getFieldConstraints($fieldName)
    {
        $maybeConstraints = $this->annotations->lookupIn(
            [$fieldName, static::ANNOTATION_CONSTRAINTS]
        );

        if ($maybeConstraints->isNothing()) {
            return ArrayList::zero();
        }

        $constraints = Maybe::fromJust($maybeConstraints);

        if (is_array($constraints)) {
            return ArrayList::of($constraints);
        } elseif ($constraints instanceof IterableType) {
            return $constraints;
        }

        return ArrayList::of([$constraints]);
    }
public function getFieldConstraints ( $ fieldName ) { $ maybeConstraints = $ this -> annotations -> lookupIn ( [ $ fieldName , static :: ANNOTATION_CONSTRAINTS ] ) ; if ( $ maybeConstraints -> isNothing ( ) ) { return ArrayList :: zero ( ) ; } $ constraints = Maybe :: fromJust ( $ maybeConstraints ) ; if ( is_array ( $ constraints ) ) { return ArrayList :: of ( $ constraints ) ; } elseif ( $ constraints instanceof IterableType ) { return $ constraints ; } return ArrayList :: of ( [ $ constraints ] ) ; }
Get all the constraints for a single field.

@param string $fieldName

@return IterableType
Get all the constraints for a single field .