Mercurial > hg > cmmr2012-drupal-site
comparison vendor/symfony/routing/Router.php @ 5:12f9dff5fda9 tip
Update to Drupal core 8.7.1
author | Chris Cannam |
---|---|
date | Thu, 09 May 2019 15:34:47 +0100 |
parents | a9cd425dd02b |
children |
comparison
equal
deleted
inserted
replaced
4:a9cd425dd02b | 5:12f9dff5fda9 |
---|---|
140 ]; | 140 ]; |
141 | 141 |
142 // check option names and live merge, if errors are encountered Exception will be thrown | 142 // check option names and live merge, if errors are encountered Exception will be thrown |
143 $invalid = []; | 143 $invalid = []; |
144 foreach ($options as $key => $value) { | 144 foreach ($options as $key => $value) { |
145 if (array_key_exists($key, $this->options)) { | 145 if (\array_key_exists($key, $this->options)) { |
146 $this->options[$key] = $value; | 146 $this->options[$key] = $value; |
147 } else { | 147 } else { |
148 $invalid[] = $key; | 148 $invalid[] = $key; |
149 } | 149 } |
150 } | 150 } |
162 * | 162 * |
163 * @throws \InvalidArgumentException | 163 * @throws \InvalidArgumentException |
164 */ | 164 */ |
165 public function setOption($key, $value) | 165 public function setOption($key, $value) |
166 { | 166 { |
167 if (!array_key_exists($key, $this->options)) { | 167 if (!\array_key_exists($key, $this->options)) { |
168 throw new \InvalidArgumentException(sprintf('The Router does not support the "%s" option.', $key)); | 168 throw new \InvalidArgumentException(sprintf('The Router does not support the "%s" option.', $key)); |
169 } | 169 } |
170 | 170 |
171 $this->options[$key] = $value; | 171 $this->options[$key] = $value; |
172 } | 172 } |
180 * | 180 * |
181 * @throws \InvalidArgumentException | 181 * @throws \InvalidArgumentException |
182 */ | 182 */ |
183 public function getOption($key) | 183 public function getOption($key) |
184 { | 184 { |
185 if (!array_key_exists($key, $this->options)) { | 185 if (!\array_key_exists($key, $this->options)) { |
186 throw new \InvalidArgumentException(sprintf('The Router does not support the "%s" option.', $key)); | 186 throw new \InvalidArgumentException(sprintf('The Router does not support the "%s" option.', $key)); |
187 } | 187 } |
188 | 188 |
189 return $this->options[$key]; | 189 return $this->options[$key]; |
190 } | 190 } |