public function getConstraintsForType($version, $type)
    {
        $cache = & $this->constraintsForTypeCache[$version.$type];

        if ($cache === null) {
            $cache = [];

            foreach ($this->getConstraints($version) as $constraint) {
                if ($constraint->supports($type)) {
                    $cache[] = $constraint;
                }
            }
        }

        return $cache;
    }