Mercurial > hg > rc1
comparison vendor/composer/semver/src/Constraint/EmptyConstraint.php @ 0:1e000243b222
vanilla 1.3.3 distro, I hope
| author | Charlie Root |
|---|---|
| date | Thu, 04 Jan 2018 15:50:29 -0500 |
| parents | |
| children |
comparison
equal
deleted
inserted
replaced
| -1:000000000000 | 0:1e000243b222 |
|---|---|
| 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 * Defines the absence of a constraint. | |
| 16 */ | |
| 17 class EmptyConstraint implements ConstraintInterface | |
| 18 { | |
| 19 /** @var string */ | |
| 20 protected $prettyString; | |
| 21 | |
| 22 /** | |
| 23 * @param ConstraintInterface $provider | |
| 24 * | |
| 25 * @return bool | |
| 26 */ | |
| 27 public function matches(ConstraintInterface $provider) | |
| 28 { | |
| 29 return true; | |
| 30 } | |
| 31 | |
| 32 /** | |
| 33 * @param $prettyString | |
| 34 */ | |
| 35 public function setPrettyString($prettyString) | |
| 36 { | |
| 37 $this->prettyString = $prettyString; | |
| 38 } | |
| 39 | |
| 40 /** | |
| 41 * @return string | |
| 42 */ | |
| 43 public function getPrettyString() | |
| 44 { | |
| 45 if ($this->prettyString) { | |
| 46 return $this->prettyString; | |
| 47 } | |
| 48 | |
| 49 return $this->__toString(); | |
| 50 } | |
| 51 | |
| 52 /** | |
| 53 * @return string | |
| 54 */ | |
| 55 public function __toString() | |
| 56 { | |
| 57 return '[]'; | |
| 58 } | |
| 59 } |
