Permalink
Browse files

unify and fix callable phpdoc throughout symfony

  • Loading branch information...
1 parent 8d85745 commit 6d5ddce9a49bc574e6da41fb7e344eb60f07e6a4 @Tobion Tobion committed Nov 20, 2013
@@ -31,8 +31,8 @@ private function __construct()
/**
* Loads an XML file.
*
- * @param string $file An XML file path
- * @param string|callable $schemaOrCallable An XSD schema file path or callable
+ * @param string $file An XML file path
+ * @param string|callable|null $schemaOrCallable An XSD schema file path, a callable, or null to disable validation
*
* @return \DOMDocument
*
@@ -154,9 +154,9 @@ public function removeSubscriber(EventSubscriberInterface $subscriber)
* This method can be overridden to add functionality that is executed
* for each listener.
*
- * @param array[callback] $listeners The event listeners.
- * @param string $eventName The name of the event to dispatch.
- * @param Event $event The event object to pass to the event handlers/listeners.
+ * @param callable[] $listeners The event listeners.
+ * @param string $eventName The name of the event to dispatch.
+ * @param Event $event The event object to pass to the event handlers/listeners.
*/
protected function doDispatch($listeners, $eventName, Event $event)
{
@@ -39,7 +39,7 @@ class Command
/**
* Constructor.
*
- * @param Command $parent Parent command
+ * @param Command|null $parent Parent command
*/
public function __construct(Command $parent = null)
{
@@ -61,7 +61,7 @@ public function __toString()
/**
* Creates a new Command instance.
*
- * @param Command $parent Parent command
+ * @param Command|null $parent Parent command
*
* @return Command New Command instance
*/
@@ -232,7 +232,7 @@ public function setErrorHandler(\Closure $errorHandler)
}
/**
- * @return callable|null
+ * @return \Closure|null
*/
public function getErrorHandler()
{
@@ -55,11 +55,11 @@ public static function create($data = null, $status = 200, $headers = array())
/**
* Sets the JSONP callback.
*
- * @param string $callback
+ * @param string|null $callback The JSONP callback or null to use none
*
* @return JsonResponse
*
- * @throws \InvalidArgumentException
+ * @throws \InvalidArgumentException When the callback name is not valid
*/
public function setCallback($callback = null)
{
@@ -188,7 +188,7 @@ class Response
/**
* Constructor.
*
- * @param string $content The response content
+ * @param mixed $content The response content, see setContent()
* @param integer $status The response status code
* @param array $headers An array of response headers
*
@@ -215,7 +215,7 @@ public function __construct($content = '', $status = 200, $headers = array())
* return Response::create($body, 200)
* ->setSharedMaxAge(300);
*
- * @param string $content The response content
+ * @param mixed $content The response content, see setContent()
* @param integer $status The response status code
* @param array $headers An array of response headers
*
@@ -403,9 +403,9 @@ public function send()
/**
* Sets the response content.
*
- * Valid types are strings, numbers, and objects that implement a __toString() method.
+ * Valid types are strings, numbers, null, and objects that implement a __toString() method.
*
- * @param mixed $content
+ * @param mixed $content Content that can be cast to string
*
* @return Response
*
@@ -34,9 +34,9 @@ class StreamedResponse extends Response
/**
* Constructor.
*
- * @param mixed $callback A valid PHP callback
- * @param integer $status The response status code
- * @param array $headers An array of response headers
+ * @param callable|null $callback A valid PHP callback or null to set it later
+ * @param integer $status The response status code
+ * @param array $headers An array of response headers
*
* @api
*/
@@ -51,7 +51,13 @@ public function __construct($callback = null, $status = 200, $headers = array())
}
/**
- * {@inheritDoc}
+ * Factory method for chainability
+ *
+ * @param callable|null $callback A valid PHP callback or null to set it later
+ * @param integer $status The response status code
+ * @param array $headers An array of response headers
+ *
+ * @return StreamedResponse
*/
public static function create($callback = null, $status = 200, $headers = array())
{
@@ -61,7 +67,7 @@ public static function create($callback = null, $status = 200, $headers = array(
/**
* Sets the PHP callback associated with this Response.
*
- * @param mixed $callback A valid PHP callback
+ * @param callable $callback A valid PHP callback
*
* @throws \LogicException
*/
@@ -40,18 +40,11 @@ public function __construct(LoggerInterface $logger = null)
}
/**
- * Returns the Controller instance associated with a Request.
+ * {@inheritdoc}
*
* This method looks for a '_controller' request attribute that represents
* the controller name (a string like ClassName::MethodName).
*
- * @param Request $request A Request instance
- *
- * @return mixed|Boolean A PHP callable representing the Controller,
- * or false if this resolver is not able to determine the controller
- *
- * @throws \InvalidArgumentException|\LogicException If the controller can't be found
- *
* @api
*/
public function getController(Request $request)
@@ -86,14 +79,7 @@ public function getController(Request $request)
}
/**
- * Returns the arguments to pass to the controller.
- *
- * @param Request $request A Request instance
- * @param mixed $controller A PHP callable
- *
- * @return array
- *
- * @throws \RuntimeException When value for argument given is not provided
+ * {@inheritdoc}
*
* @api
*/
@@ -38,10 +38,10 @@
*
* @param Request $request A Request instance
*
- * @return mixed|Boolean A PHP callable representing the Controller,
- * or false if this resolver is not able to determine the controller
+ * @return callable|false A PHP callable representing the Controller,
+ * or false if this resolver is not able to determine the controller
*
- * @throws \InvalidArgumentException|\LogicException If the controller can't be found
+ * @throws \LogicException If the controller can't be found
*
* @api
*/
@@ -50,8 +50,8 @@ public function getController(Request $request);
/**
* Returns the arguments to pass to the controller.
*
- * @param Request $request A Request instance
- * @param mixed $controller A PHP callable
+ * @param Request $request A Request instance
+ * @param callable $controller A PHP callable
*
* @return array An array of arguments to pass to the controller
*
@@ -184,7 +184,7 @@ public function __clone()
* The STDOUT and STDERR are also available after the process is finished
* via the getOutput() and getErrorOutput() methods.
*
- * @param callback|null $callback A PHP callback to run whenever there is some
+ * @param callable|null $callback A PHP callback to run whenever there is some
* output available on STDOUT or STDERR
*
* @return integer The exit status code
@@ -215,7 +215,7 @@ public function run($callback = null)
* with true as a second parameter then the callback will get all data occurred
* in (and since) the start call.
*
- * @param callback|null $callback A PHP callback to run whenever there is some
+ * @param callable|null $callback A PHP callback to run whenever there is some
* output available on STDOUT or STDERR
*
* @return Process The process itself
@@ -261,8 +261,8 @@ public function start($callback = null)
*
* Be warned that the process is cloned before being started.
*
- * @param callable $callback A PHP callback to run whenever there is some
- * output available on STDOUT or STDERR
+ * @param callable|null $callback A PHP callback to run whenever there is some
+ * output available on STDOUT or STDERR
*
* @return Process The new process
*
@@ -290,7 +290,7 @@ public function restart($callback = null)
* from the output in real-time while writing the standard input to the process.
* It allows to have feedback from the independent process during execution.
*
- * @param callback|null $callback A valid PHP callback
+ * @param callable|null $callback A valid PHP callback
*
* @return integer The exitcode of the process
*
@@ -1018,9 +1018,9 @@ private function getDescriptors()
* The callbacks adds all occurred output to the specific buffer and calls
* the user callback (if present) with the received output.
*
- * @param callback|null $callback The user defined PHP callback
+ * @param callable|null $callback The user defined PHP callback
*
- * @return callback A PHP callable
+ * @return callable A PHP callable
*/
protected function buildCallback($callback)
{
@@ -41,9 +41,9 @@ class GetSetMethodNormalizer extends SerializerAwareNormalizer implements Normal
protected $camelizedAttributes = array();
/**
- * Set normalization callbacks
+ * Set normalization callbacks.
*
- * @param array $callbacks help normalize the result
+ * @param callable[] $callbacks help normalize the result
*
* @throws InvalidArgumentException if a non-callable callback is set
*/

0 comments on commit 6d5ddce

Please sign in to comment.