Get recurrence collection by given constraint

@param $constraint
@return Recurrence[]|\Recurr\RecurrenceCollection
@throws \Recurr\Exception\InvalidRRule
@throws \Recurr\Exception\InvalidWeekday
774323
private function getCollection($constraint)
    {
        $rRule = new RecurrRule($this->getRrule(), $this->getStartDate());
        $rRuleTransformer = new ArrayTransformer();
        return $rRuleTransformer->transform($rRule, $constraint);
    }
570761
public function setConstraints($constraints)
    {
        foreach ($constraints as $fieldName => $v) {
            if (is_array($v)) {
                foreach ($v as $constraintFromArray) {
                    $this->setConstraint($fieldName, $constraintFromArray);
                }
            } else {
                $this->setConstraint($fieldName, $v);
            }
        }

        return $this;
    }
115945
protected function compileConstraint($constraint)
    {
        return function ($value) use ($constraint) {

            if (!$value instanceof MatchesCollection) {
                return $this->checker->check($value, $constraint);
            }

            // Matching values against sequential arrays will result in
            // checking if ANY of the values matches the criteria.
            // This will allow normal sql like "WHERE categories.id = 13" queries
            foreach ($value as $item) {
                if ($this->checker->check($item, $constraint)) {
                    return true;
                }
            }

            return false;

        };
    }
882639
public function get(int $offset): Period
    {
        $period = $this->intervals[$offset] ?? null;
        if (null !== $period) {
            return $period;
        }

        throw new InvalidIndex(sprintf('%s is an invalid offset in the current sequence', $offset));
    }
1084864
protected function createIssue(ConstraintInterface $constraint)
    {
        list($value, $pointer) = $this->currentContext();

        return new Result\ValidationIssue(
            $constraint,
            $value,
            $pointer
        );
    }
119600
public function createRecurrenceType($type)
	{
		if (!isset($this->recurrenceTypes[$type])) {
			throw new \OutOfBoundsException("A recurrence type called {$type} does not exist within the factory.");
		}

		$recurrenceType = new $this->recurrenceTypes[$type]();

		return $recurrenceType;
	}
61466
Constraint getUniqueConstraintForColumns(int[] cols) {

        for (int i = 0, size = constraintList.length; i < size; i++) {
            Constraint c = constraintList[i];

            if (c.isUniqueWithColumns(cols)) {
                return c;
            }
        }

        return null;
    }
479569
public function visitMinimumDateTimeConstraint(DateTimeValue\MinimumDateTimeConstraint $constraint)
    {
        $value = $this->currentValue();
        if (
            !$value instanceof Value\DateTimeValue ||
            $value->value() >= $constraint->minimum()
        ) {
            return $this->createResult();
        }

        return $this->createSingleIssueResult($constraint);
    }
261332
public function visitMaximumConstraint(NumberValue\MaximumConstraint $constraint)
    {
        $value = $this->currentValue();
        if (
            !$value instanceof Value\NumberValueInterface ||
            $value->value() <= $constraint->maximum()
        ) {
            return $this->createResult();
        }

        return $this->createSingleIssueResult($constraint);
    }
340940
public function visitItemsConstraint(ArrayValue\ItemsConstraint $constraint)
    {
        $value = $this->currentValue();
        if (!$value instanceof Value\ArrayValue) {
            return $this->createResult();
        }

        $result = $this->createResult();
        $matchedIndices = array();

        // items
        foreach ($constraint->schemas() as $index => $schema) {
            if ($value->has($index)) {
                $matchedIndices[$index] = true;
                $result = $result->merge(
                    $this->validateArrayIndex($index, $schema)
                );
            } elseif (null !== $schema->defaultValue()) {
                $result = $result->merge(
                    $this->createResult(
                        array(),
                        array($this->createDefaultValueMatch($schema, $index))
                    )
                );
            }
        }

        // additional items
        foreach ($value->keys() as $index) {
            if (!array_key_exists($index, $matchedIndices)) {
                $result = $result->merge(
                    $this->validateArrayIndex(
                        $index,
                        $constraint->additionalSchema()
                    )
                );
            }
        }

        return $result;
    }
61577
public function visitDependencyConstraint(ObjectValue\DependencyConstraint $constraint)
    {
        return new ObjectValue\DependencyConstraint(
            $constraint->property(),
            $constraint->schema()->accept($this)
        );
    }
810023
public function visitRequiredConstraint(ObjectValue\RequiredConstraint $constraint)
    {
        $value = $this->currentValue();
        if (
            !$value instanceof Value\ObjectValue ||
            $value->has($constraint->property())
        ) {
            return $this->createResult();
        }

        return $this->createSingleIssueResult($constraint);
    }
143475
public function visitEnumConstraint(Generic\EnumConstraint $constraint)
    {
        $value = $this->currentValue();
        foreach ($constraint->values() as $enumValue) {
            if ($this->comparator()->equals($value, $enumValue)) {
                return $this->createResult();
            }
        }

        return $this->createSingleIssueResult($constraint);
    }
469844
public function retry(RetrySchedulerInterface $retryScheduler): array
    {
        if (!$this->isRetryable()) {
            throw new class('This job cannot be retried anymore.') extends \BadMethodCallException implements ExceptionInterface {};
        }

        $cloned = clone $this;
        $cloned->retries++;

        return [$cloned, $retryScheduler->scheduleNextRetry($cloned, $cloned->retries)];
    }
754899
public function guessPatternForConstraint(Constraint $constraint)
    {
        switch (\get_class($constraint)) {
            case 'Symfony\Component\Validator\Constraints\Length':
                if (is_numeric($constraint->min)) {
                    return new ValueGuess(sprintf('.{%s,}', (string) $constraint->min), Guess::LOW_CONFIDENCE);
                }
                break;

            case 'Symfony\Component\Validator\Constraints\Regex':
                $htmlPattern = $constraint->getHtmlPattern();

                if (null !== $htmlPattern) {
                    return new ValueGuess($htmlPattern, Guess::HIGH_CONFIDENCE);
                }
                break;

            case 'Symfony\Component\Validator\Constraints\Range':
                if (is_numeric($constraint->min)) {
                    return new ValueGuess(sprintf('.{%s,}', \strlen((string) $constraint->min)), Guess::LOW_CONFIDENCE);
                }
                break;

            case 'Symfony\Component\Validator\Constraints\Type':
                if (\in_array($constraint->type, ['double', 'float', 'numeric', 'real'])) {
                    return new ValueGuess(null, Guess::MEDIUM_CONFIDENCE);
                }
                break;
        }
    }
1009392
public function visitMinimumPropertiesConstraint(ObjectValue\MinimumPropertiesConstraint $constraint)
    {
        $value = $this->currentValue();
        if (
            !$value instanceof Value\ObjectValue ||
            $value->count() >= $constraint->minimum()
        ) {
            return $this->createResult();
        }

        return $this->createSingleIssueResult($constraint);
    }
391644
protected function parseConstraints(array $constraints)
    {
        $parsedConstraints = [];

        foreach ($constraints as $key=>$keyConstraints) {
            $parsedConstraints[$key] = $this->parseConstraint($keyConstraints);
        }

        return $parsedConstraints;
    }