Bound.php
1 year ago
Constraint.php
1 year ago
ConstraintInterface.php
1 year ago
MatchAllConstraint.php
1 year ago
MatchNoneConstraint.php
1 year ago
MultiConstraint.php
1 year ago
MatchNoneConstraint.php
84 lines
| 1 | <?php |
| 2 | |
| 3 | /* |
| 4 | * This file is part of composer/semver. |
| 5 | * |
| 6 | * (c) Composer <https://github.com/composer> |
| 7 | * |
| 8 | * For the full copyright and license information, please view |
| 9 | * the LICENSE file that was distributed with this source code. |
| 10 | */ |
| 11 | |
| 12 | namespace Composer\Semver\Constraint; |
| 13 | |
| 14 | /** |
| 15 | * Blackhole of constraints, nothing escapes it |
| 16 | */ |
| 17 | class MatchNoneConstraint implements ConstraintInterface |
| 18 | { |
| 19 | /** @var string|null */ |
| 20 | protected $prettyString; |
| 21 | |
| 22 | /** |
| 23 | * @param ConstraintInterface $provider |
| 24 | * |
| 25 | * @return bool |
| 26 | */ |
| 27 | public function matches(ConstraintInterface $provider) |
| 28 | { |
| 29 | return false; |
| 30 | } |
| 31 | |
| 32 | /** |
| 33 | * {@inheritDoc} |
| 34 | */ |
| 35 | public function compile($otherOperator) |
| 36 | { |
| 37 | return 'false'; |
| 38 | } |
| 39 | |
| 40 | /** |
| 41 | * {@inheritDoc} |
| 42 | */ |
| 43 | public function setPrettyString($prettyString) |
| 44 | { |
| 45 | $this->prettyString = $prettyString; |
| 46 | } |
| 47 | |
| 48 | /** |
| 49 | * {@inheritDoc} |
| 50 | */ |
| 51 | public function getPrettyString() |
| 52 | { |
| 53 | if ($this->prettyString) { |
| 54 | return $this->prettyString; |
| 55 | } |
| 56 | |
| 57 | return (string) $this; |
| 58 | } |
| 59 | |
| 60 | /** |
| 61 | * {@inheritDoc} |
| 62 | */ |
| 63 | public function __toString() |
| 64 | { |
| 65 | return '[]'; |
| 66 | } |
| 67 | |
| 68 | /** |
| 69 | * {@inheritDoc} |
| 70 | */ |
| 71 | public function getUpperBound() |
| 72 | { |
| 73 | return new Bound('0.0.0.0-dev', false); |
| 74 | } |
| 75 | |
| 76 | /** |
| 77 | * {@inheritDoc} |
| 78 | */ |
| 79 | public function getLowerBound() |
| 80 | { |
| 81 | return new Bound('0.0.0.0-dev', false); |
| 82 | } |
| 83 | } |
| 84 |