Fix #41 - Various PHPDoc & CS fixes

This commit is contained in:
filp
2013-07-15 20:09:43 +01:00
parent e93281891e
commit 5307eba8eb
10 changed files with 48 additions and 25 deletions
+1
View File
@@ -159,6 +159,7 @@ class Frame implements Serializable
* Get one line for this file, starting at line 10 (zero-indexed, remember!)
* $frame->getFileLines(9, 1); // array( 10 => '...', 11 => '...')
*
* @throws InvalidArgumentException if $length is less than or equal to 0
* @param int $start
* @param int $length
* @return string[]|null
+1
View File
@@ -21,6 +21,7 @@ class CallbackHandler extends Handler
protected $callable;
/**
* @throws InvalidArgumentException If argument is not callable
* @param callable $callable
*/
public function __construct($callable)
+6 -6
View File
@@ -25,12 +25,12 @@ abstract class Handler implements HandlerInterface
const QUIT = 0x30;
/**
* @var Whoops\Run
* @var Run
*/
private $run;
/**
* @var Whoops\Exception\Inspector $inspector
* @var Inspector $inspector
*/
private $inspector;
@@ -40,7 +40,7 @@ abstract class Handler implements HandlerInterface
private $exception;
/**
* @param Whoops\Run $run
* @param Run $run
*/
public function setRun(Run $run)
{
@@ -48,7 +48,7 @@ abstract class Handler implements HandlerInterface
}
/**
* @return Whoops\Run
* @return Run
*/
protected function getRun()
{
@@ -56,7 +56,7 @@ abstract class Handler implements HandlerInterface
}
/**
* @param Whoops\Exception\Inspector $inspector
* @param Inspector $inspector
*/
public function setInspector(Inspector $inspector)
{
@@ -64,7 +64,7 @@ abstract class Handler implements HandlerInterface
}
/**
* @return Whoops\Run
* @return Run
*/
protected function getInspector()
{
+2 -2
View File
@@ -17,7 +17,7 @@ interface HandlerInterface
public function handle();
/**
* @param Whoops\Run $run
* @param Run $run
*/
public function setRun(Run $run);
@@ -27,7 +27,7 @@ interface HandlerInterface
public function setException(Exception $exception);
/**
* @param Whoops\Exception\Inspector $run
* @param Inspector $inspector
*/
public function setInspector(Inspector $inspector);
}
+2 -1
View File
@@ -52,7 +52,8 @@ class JsonResponseHandler extends Handler
/**
* Check, if possible, that this execution was triggered by an AJAX request.
* @param bool
*
* @return bool
*/
private function isAjaxRequest()
{
+6 -1
View File
@@ -164,6 +164,8 @@ class PrettyPageHandler extends Handler
* The supplied callback argument will be called when the error is rendered,
* it should produce a simple associative array. Any nested arrays will
* be flattened with print_r.
*
* @throws InvalidArgumentException If $callback is not callable
* @param string $label
* @param callable $callback Callable returning an associative array
*/
@@ -235,6 +237,7 @@ class PrettyPageHandler extends Handler
* @example
* $run->setEditor('sublime');
*
* @throws InvalidArgumentException If invalid argument identifier provided
* @param string|callable $editor
*/
public function setEditor($editor)
@@ -255,9 +258,10 @@ class PrettyPageHandler extends Handler
* a string that may be used as the href property for that
* file reference.
*
* @throws InvalidArgumentException If editor resolver does not return a string
* @param string $filePath
* @param int $line
* @return string|false
* @return string|bool
*/
public function getEditorHref($filePath, $line)
{
@@ -313,6 +317,7 @@ class PrettyPageHandler extends Handler
}
/**
* @throws InvalidArgumentException If argument is not a valid directory
* @param string $resourcesPath
*/
public function setResourcesPath($resourcesPath)
@@ -14,7 +14,7 @@ use Phalcon\DI\Exception;
class WhoopsServiceProvider
{
/**
* @param Phalcon\DI $di
* @param DI $di
*/
public function __construct(DI $di = null)
{
@@ -14,8 +14,7 @@ use RuntimeException;
class WhoopsServiceProvider implements ServiceProviderInterface
{
/**
* @see Silex\ServiceProviderInterface::register
* @param Silex\Application $app
* @param Application $app
*/
public function register(Application $app)
{
+11 -2
View File
@@ -3,7 +3,9 @@
* Template file for Whoops's pretty error output.
* Check the $v global variable (stdClass) for what's available
* to work with.
* @var $v
* @var stdClass $v
* @var callable $e
* @var callable $slug
*/
?>
<!DOCTYPE html>
@@ -97,7 +99,14 @@
?>
<div class="frame-comments <?php echo empty($comments) ? 'empty' : '' ?>">
<?php foreach($comments as $commentNo => $comment): ?>
<?php extract($comment) ?>
<?php
extract($comment)
/**
* @var string $context
* @var string $comment
*/
?>
<div class="frame-comment" id="comment-<?php echo $i . '-' . $commentNo ?>">
<span class="frame-comment-context"><?php echo $e($context) ?></span>
<?php echo $e($comment, true) ?>
+17 -10
View File
@@ -24,16 +24,18 @@ class Run
protected $sendOutput = true;
/**
* @var Whoops\Handler\HandlerInterface[]
* @var HandlerInterface[]
*/
protected $handlerStack = array();
protected $silencedPatterns = array();
/**
* Pushes a handler to the end of the stack.
* @param Whoops\HandlerInterface $handler
* @return Whoops\Run
* Pushes a handler to the end of the stack
*
* @throws InvalidArgumentException If argument is not callable or instance of HandlerInterface
* @param HandlerInterface $handler
* @return Run
*/
public function pushHandler($handler)
{
@@ -55,7 +57,7 @@ class Run
/**
* Removes the last handler in the stack and returns it.
* Returns null if there's nothing else to pop.
* @return null|Whoops\Handler\HandlerInterface
* @return null|HandlerInterface
*/
public function popHandler()
{
@@ -75,7 +77,7 @@ class Run
/**
* Clears all handlers in the handlerStack, including
* the default PrettyPage handler.
* @return Whoops\Run
* @return Run
*/
public function clearHandlers()
{
@@ -85,7 +87,7 @@ class Run
/**
* @param Exception $exception
* @return Whoops\Exception\Inspector
* @return Inspector
*/
protected function getInspector(Exception $exception)
{
@@ -94,7 +96,7 @@ class Run
/**
* Registers this instance as an error handler.
* @return Whoops\Run
* @return Run
*/
public function register()
{
@@ -111,7 +113,7 @@ class Run
/**
* Unregisters all handlers registered by this Whoops\Run instance
* @return Whoops\Run
* @return Run
*/
public function unregister()
{
@@ -165,7 +167,7 @@ class Run
/**
* Should Whoops push output directly to the client?
* If this is false, output will be returned by handleException
* @param bool|num $send
* @param bool|int $send
* @return bool
*/
public function writeToOutput($send = null)
@@ -195,6 +197,9 @@ class Run
// or return it silently.
ob_start();
// Just in case there are no handlers:
$handlerResponse = null;
for($i = count($this->handlerStack) - 1; $i >= 0; $i--) {
$handler = $this->handlerStack[$i];
@@ -249,6 +254,8 @@ class Run
* @param string $message
* @param string $file
* @param int $line
*
* @return bool
*/
public function handleError($level, $message, $file = null, $line = null)
{