src/Micrometa/Domain/Item/ItemSetupTrait.php
protected function valTypes(array $types)
    {
        $nonEmptyTypes = array_filter(array_map([$this, 'valType'], $types));

        // If there are no valid types
        if (!count($nonEmptyTypes)) {
            throw new InvalidArgumentException(
                InvalidArgumentException::EMPTY_TYPES_STR,
                InvalidArgumentException::EMPTY_TYPES
            );
        }

        return array_values($nonEmptyTypes);
    }
protected function valTypes(array $types)
    {
        $nonEmptyTypes = array_filter(array_map([$this, 'valType'], $types));

        // If there are no valid types
        if (!count($nonEmptyTypes)) {
            throw new InvalidArgumentException(
                InvalidArgumentException::EMPTY_TYPES_STR,
                InvalidArgumentException::EMPTY_TYPES
            );
        }

        return array_values($nonEmptyTypes);
    }
protected function valTypes ( array $ types ) { $ nonEmptyTypes = array_filter ( array_map ( [ $ this , 'valType' ] , $ types ) ) ; // If there are no valid types if ( ! count ( $ nonEmptyTypes ) ) { throw new InvalidArgumentException ( InvalidArgumentException :: EMPTY_TYPES_STR , InvalidArgumentException :: EMPTY_TYPES ) ; } return array_values ( $ nonEmptyTypes ) ; }
Validate and sanitize the item types

@param string[]|\stdClass[] $types Item types

@return array Validated item types
@throws InvalidArgumentException If there are no valid types
Validate and sanitize the item types