File tree Expand file tree Collapse file tree 1 file changed +24
-0
lines changed
src/Symfony/Component/Routing Expand file tree Collapse file tree 1 file changed +24
-0
lines changed Original file line number Diff line number Diff line change @@ -233,6 +233,18 @@ public function getOption($name)
233
233
return isset ($ this ->options [$ name ]) ? $ this ->options [$ name ] : null ;
234
234
}
235
235
236
+ /**
237
+ * Checks if a an option has been set
238
+ *
239
+ * @param string $name An option name
240
+ *
241
+ * @return Boolean true if the option is set, false otherwise
242
+ */
243
+ public function hasOption ($ name )
244
+ {
245
+ return array_key_exists ($ name , $ this ->options );
246
+ }
247
+
236
248
/**
237
249
* Returns the defaults.
238
250
*
@@ -377,6 +389,18 @@ public function getRequirement($key)
377
389
return isset ($ this ->requirements [$ key ]) ? $ this ->requirements [$ key ] : null ;
378
390
}
379
391
392
+ /**
393
+ * Checks if a requirement is set for the given key.
394
+ *
395
+ * @param string $name A variable name
396
+ *
397
+ * @return Boolean true if a requirement is specified, false otherwise
398
+ */
399
+ public function hasRequirement ($ key )
400
+ {
401
+ return array_key_exists ($ key , $ this ->requirements );
402
+ }
403
+
380
404
/**
381
405
* Sets a requirement for the given key.
382
406
*
You can’t perform that action at this time.
0 commit comments