Mercurial > hg > isophonics-drupal-site
comparison vendor/symfony/css-selector/XPath/XPathExpr.php @ 14:1fec387a4317
Update Drupal core to 8.5.2 via Composer
author | Chris Cannam |
---|---|
date | Mon, 23 Apr 2018 09:46:53 +0100 |
parents | 4c8ae668cc8c |
children | c2387f117808 |
comparison
equal
deleted
inserted
replaced
13:5fb285c0d0e3 | 14:1fec387a4317 |
---|---|
21 * | 21 * |
22 * @internal | 22 * @internal |
23 */ | 23 */ |
24 class XPathExpr | 24 class XPathExpr |
25 { | 25 { |
26 /** | |
27 * @var string | |
28 */ | |
29 private $path; | 26 private $path; |
30 | |
31 /** | |
32 * @var string | |
33 */ | |
34 private $element; | 27 private $element; |
35 | |
36 /** | |
37 * @var string | |
38 */ | |
39 private $condition; | 28 private $condition; |
40 | 29 |
41 /** | 30 /** |
42 * @param string $path | 31 * @param string $path |
43 * @param string $element | 32 * @param string $element |
68 * | 57 * |
69 * @return $this | 58 * @return $this |
70 */ | 59 */ |
71 public function addCondition($condition) | 60 public function addCondition($condition) |
72 { | 61 { |
73 $this->condition = $this->condition ? sprintf('%s and (%s)', $this->condition, $condition) : $condition; | 62 $this->condition = $this->condition ? sprintf('(%s) and (%s)', $this->condition, $condition) : $condition; |
74 | 63 |
75 return $this; | 64 return $this; |
76 } | 65 } |
77 | 66 |
78 /** | 67 /** |
112 * @param string $combiner | 101 * @param string $combiner |
113 * @param XPathExpr $expr | 102 * @param XPathExpr $expr |
114 * | 103 * |
115 * @return $this | 104 * @return $this |
116 */ | 105 */ |
117 public function join($combiner, XPathExpr $expr) | 106 public function join($combiner, self $expr) |
118 { | 107 { |
119 $path = $this->__toString().$combiner; | 108 $path = $this->__toString().$combiner; |
120 | 109 |
121 if ('*/' !== $expr->path) { | 110 if ('*/' !== $expr->path) { |
122 $path .= $expr->path; | 111 $path .= $expr->path; |