Copied!

Defines a constraint.

CloneableInstantiable
Constants
public Composer\Semver\Constraint\Constraint::OP_EQ = 0
public Composer\Semver\Constraint\Constraint::OP_GE = 4
public Composer\Semver\Constraint\Constraint::OP_GT = 3
public Composer\Semver\Constraint\Constraint::OP_LE = 2
public Composer\Semver\Constraint\Constraint::OP_LT = 1
public Composer\Semver\Constraint\Constraint::OP_NE = 5
public Composer\Semver\Constraint\Constraint::STR_OP_EQ = '=='
public Composer\Semver\Constraint\Constraint::STR_OP_EQ_ALT = '='
public Composer\Semver\Constraint\Constraint::STR_OP_GE = '>='
public Composer\Semver\Constraint\Constraint::STR_OP_GT = '>'
public Composer\Semver\Constraint\Constraint::STR_OP_LE = '<='
public Composer\Semver\Constraint\Constraint::STR_OP_LT = '<'
public Composer\Semver\Constraint\Constraint::STR_OP_NE = '!='
public Composer\Semver\Constraint\Constraint::STR_OP_NE_ALT = '<>'
Methods
public __construct( $operator, $version)
 

Sets operator and version to compare with.

  • param string $operator
  • param string $version
  • throws \InvalidArgumentException if invalid operator is given.
  • phpstan-param self::STR_OP_* $operator
public __toString() : string
 
  • return string
public compile( $otherOperator)
 
    public getLowerBound()
     
      public getOperator()
       
      • return string
      • phpstan-return self::STR_OP_*
      public static getOperatorConstant( $operator)
       
      • param string $operator
      • return int
      • phpstan-param self::STR_OP_* $operator
      • phpstan-return self::OP_*
      public getPrettyString()
       
        public static getSupportedOperators()
         

        Get all supported comparison operators.

        public getUpperBound()
         
          public getVersion()
           
          • return string
          public matches(Composer\Semver\Constraint\ConstraintInterface $provider)
           
          • param \ConstraintInterface $provider
          • return bool
          public matchSpecific(Composer\Semver\Constraint\Constraint $provider, $compareBranches = false)
           
          • param \Constraint $provider
          • param bool $compareBranches
          • return bool
          public setPrettyString( $prettyString)
           
            public versionCompare( $a, $b, $operator, $compareBranches = false)
             
            • param string $a
            • param string $b
            • param string $operator
            • param bool $compareBranches
            • throws \InvalidArgumentException if invalid operator is given.
            • return bool
            • phpstan-param self::STR_OP_* $operator
            Properties
            protected $lowerBound = NULL
             
            • var \Bound
            protected $operator = NULL
             
            • var int
            • phpstan-var self::OP_*
            protected $prettyString = NULL
             
            • var string|null
            protected $upperBound = NULL
             
            • var \Bound
            protected $version = NULL
             
            • var string
            Properties
            private static $transOpInt = ['==', '<', '<=', '>', '>=', '!=']
             

            Integer to operator translation table.

            • var array
            • phpstan-var array<self::OP_, self::STR_OP_>
            private static $transOpStr = ['=' => 0, '==' => 0, '<' => 1, '<=' => 2, '>' => 3, '>=' => 4, '<>' => 5, '!=' => 5]
             

            Operator to integer translation table.

            • var array
            • phpstan-var array<self::STR_OP_, self::OP_>
            Methods
            private extractBounds()
             
            • return void
            Properties
            private static $transOpInt = ['==', '<', '<=', '>', '>=', '!=']
             

            Integer to operator translation table.

            • var array
            • phpstan-var array<self::OP_, self::STR_OP_>
            private static $transOpStr = ['=' => 0, '==' => 0, '<' => 1, '<=' => 2, '>' => 3, '>=' => 4, '<>' => 5, '!=' => 5]
             

            Operator to integer translation table.

            • var array
            • phpstan-var array<self::STR_OP_, self::OP_>
            Methods
            public static getOperatorConstant( $operator)
             
            • param string $operator
            • return int
            • phpstan-param self::STR_OP_* $operator
            • phpstan-return self::OP_*
            public static getSupportedOperators()
             

            Get all supported comparison operators.

            © 2024 Bruce Wells
            Search Namespaces \ Classes
            Configuration