1 | <?php |
||
19 | class Constraint |
||
20 | { |
||
21 | /** |
||
22 | * Merges two constraints. |
||
23 | * Doesn't resolve version conflicts. |
||
24 | * @param $a |
||
25 | * @param $b |
||
26 | * @return string |
||
27 | */ |
||
28 | static public function merge($a, $b) |
||
42 | |||
43 | /** |
||
44 | * Check if $a is weaker condition then $b, like: |
||
45 | * - a="*" b="2.2" |
||
46 | * - a="2.2 | 3.3" b="2.2" |
||
47 | * - a="1.1 | 2.2" b="2.2" |
||
48 | * Possible optimization. |
||
49 | * // TODO Rename and implement. |
||
50 | * @param string $a |
||
51 | * @param string $b |
||
52 | * @return boolean |
||
53 | */ |
||
54 | static public function isWeaker($a, $b) |
||
58 | |||
59 | static public function startsWith($haystack, $needle) { |
||
62 | |||
63 | static public function endsWith($haystack, $needle) { |
||
66 | |||
67 | /** |
||
68 | * Checks whether the $version represents any possible version. |
||
69 | * |
||
70 | * @param string $version |
||
71 | * @return boolean |
||
72 | */ |
||
73 | static public function isEmpty($version) |
||
77 | 1 | ||
78 | static public function findMax(array $versions) |
||
97 | 1 | ||
98 | static public function toNum($version) |
||
108 | 2 | ||
109 | } |
||
110 |