Skip to content
Browse files

Define "magic" methods of \Silex\Controller

This makes IDEs (PHPStorm, in particular) a bit happier about route-definitions.
see http://manual.phpdoc.org/HTMLSmartyConverter/PHP/phpDocumentor/tutorial_tags.method.pkg.html
  • Loading branch information...
1 parent 404264b commit 4174a76875cdc5de675b145904156179b18acecb @indeyets indeyets committed Nov 9, 2012
Showing with 11 additions and 0 deletions.
  1. +11 −0 src/Silex/Controller.php
View
11 src/Silex/Controller.php
@@ -16,6 +16,17 @@
/**
* A wrapper for a controller, mapped to a route.
*
+ * __call() forwards method-calls to Route, but returns instance of Controller
+ * listing Route's methods below, so that IDEs know they are valid
+ *
+ * @method \Silex\Controller assert(string $variable, string $regexp)
+ * @method \Silex\Controller value(string $variable, mixed $default)
+ * @method \Silex\Controller convert(string $variable, mixed $callback)
+ * @method \Silex\Controller method(string $method)
+ * @method \Silex\Controller requireHttp()
+ * @method \Silex\Controller requireHttps()
+ * @method \Silex\Controller before(mixed $callback)
+ * @method \Silex\Controller after(mixed $callback)
* @author Igor Wiedler <igor@wiedler.ch>
*/
class Controller

0 comments on commit 4174a76

Please sign in to comment.
Something went wrong with that request. Please try again.