Copied!

Defines a conjunctive or disjunctive set of constraints.

CloneableInstantiable
Methods
public __construct(array $constraints, $conjunctive = true)
 
  • param \ConstraintInterface[] $constraints A set of constraints
  • param bool $conjunctive Whether the constraints should be treated as conjunctive or disjunctive
  • throws \InvalidArgumentException If less than 2 constraints are passed
public __toString() : string
 
    public compile( $otherOperator)
     
      public static create(array $constraints, $conjunctive = true)
       

      Tries to optimize the constraints as much as possible, meaning reducing/collapsing congruent constraints etc.

      Does not necessarily return a MultiConstraint instance if things can be reduced to a simple constraint

      • param \ConstraintInterface[] $constraints A set of constraints
      • param bool $conjunctive Whether the constraints should be treated as conjunctive or disjunctive
      • return \ConstraintInterface
      public getConstraints()
       
      • return \ConstraintInterface[]
      public getLowerBound()
       
        public getPrettyString()
         
          public getUpperBound()
           
            public isConjunctive()
             
            • return bool
            public isDisjunctive()
             
            • return bool
            public matches(Composer\Semver\Constraint\ConstraintInterface $provider)
             
            • param \ConstraintInterface $provider
            • return bool
            public setPrettyString( $prettyString)
             
              Properties
              protected $conjunctive = NULL
               
              • var bool
              protected $constraints = NULL
               
              • var \ConstraintInterface[]
              • phpstan-var non-empty-array<ConstraintInterface>
              protected $lowerBound = NULL
               
              • var \Bound|null
              protected $prettyString = NULL
               
              • var string|null
              protected $string = NULL
               
              • var string|null
              protected $upperBound = NULL
               
              • var \Bound|null
              Methods
              private extractBounds()
               
              • return void
              private static optimizeConstraints(array $constraints, $conjunctive)
               
              • param \ConstraintInterface[] $constraints
              • param bool $conjunctive
              • return ?array
              • phpstan-return array{0: list<ConstraintInterface>, 1: bool}|null
              Methods
              public static create(array $constraints, $conjunctive = true)
               

              Tries to optimize the constraints as much as possible, meaning reducing/collapsing congruent constraints etc.

              Does not necessarily return a MultiConstraint instance if things can be reduced to a simple constraint

              • param \ConstraintInterface[] $constraints A set of constraints
              • param bool $conjunctive Whether the constraints should be treated as conjunctive or disjunctive
              • return \ConstraintInterface
              private static optimizeConstraints(array $constraints, $conjunctive)
               
              • param \ConstraintInterface[] $constraints
              • param bool $conjunctive
              • return ?array
              • phpstan-return array{0: list<ConstraintInterface>, 1: bool}|null
              © 2024 Bruce Wells
              Search Namespaces \ Classes
              Configuration