From 7fc9a04767f4c9f8be3530771990f7e74699068d Mon Sep 17 00:00:00 2001 From: David Grudl Date: Sun, 24 Aug 2014 19:45:10 +0200 Subject: [PATCH] typos & fixes --- src/Application/MicroPresenter.php | 6 +++--- src/Application/Routers/Route.php | 5 ++--- src/Application/UI/Presenter.php | 6 +++--- src/Application/UI/PresenterComponentReflection.php | 2 +- 4 files changed, 9 insertions(+), 10 deletions(-) diff --git a/src/Application/MicroPresenter.php b/src/Application/MicroPresenter.php index 636b3edee..903d2e195 100644 --- a/src/Application/MicroPresenter.php +++ b/src/Application/MicroPresenter.php @@ -28,14 +28,14 @@ class MicroPresenter extends Nette\Object implements Application\IPresenter /** @var Nette\Http\IRequest|NULL */ private $httpRequest; - /** @var IRouter|NULL */ + /** @var Application\IRouter|NULL */ private $router; /** @var Application\Request */ private $request; - public function __construct(Nette\DI\Container $context = NULL, Http\IRequest $httpRequest = NULL, IRouter $router = NULL) + public function __construct(Nette\DI\Container $context = NULL, Http\IRequest $httpRequest = NULL, Application\IRouter $router = NULL) { $this->context = $context; $this->httpRequest = $httpRequest; @@ -97,7 +97,7 @@ public function run(Application\Request $request) if ($response[0] instanceof \SplFileInfo) { $response->setFile($response[0]); } else { - $response->setSource($response[0]); // TODO + $response->setSource($response[0]); } } if ($response instanceof Application\UI\ITemplate) { diff --git a/src/Application/Routers/Route.php b/src/Application/Routers/Route.php index 2cec35623..86e9e6937 100644 --- a/src/Application/Routers/Route.php +++ b/src/Application/Routers/Route.php @@ -404,7 +404,7 @@ public function constructUrl(Application\Request $appRequest, Nette\Http\Url $re } if (strpos($url, '//', 2) !== FALSE) { - return NULL; // TODO: implement counterpart in match() ? + return NULL; } $url = ($this->flags & self::SECURED ? 'https:' : 'http:') . $url; @@ -740,8 +740,7 @@ private static function path2action($s) { $s = strtolower($s); $s = preg_replace('#-(?=[a-z])#', ' ', $s); - $s = substr(ucwords('x' . $s), 1); - //$s = lcfirst(ucwords($s)); + $s = lcfirst(ucwords($s)); $s = str_replace(' ', '', $s); return $s; } diff --git a/src/Application/UI/Presenter.php b/src/Application/UI/Presenter.php index 06291ea54..d36125e32 100644 --- a/src/Application/UI/Presenter.php +++ b/src/Application/UI/Presenter.php @@ -227,7 +227,7 @@ public function run(Application\Request $request) // continue with shutting down if ($this->isAjax()) try { $hasPayload = (array) $this->payload; unset($hasPayload['state']); - if ($this->response instanceof Responses\TextResponse && $this->isControlInvalid()) { // snippets - TODO + if ($this->response instanceof Responses\TextResponse && $this->isControlInvalid()) { $this->snippetMode = TRUE; $this->response->send($this->httpRequest, $this->httpResponse); $this->sendPayload(); @@ -867,7 +867,7 @@ protected function createRequest($component, $destination, array $args, $mode) throw new InvalidLinkException("Unable to pass parameters to 'this!' signal."); } - } elseif (strpos($signal, self::NAME_SEPARATOR) === FALSE) { // TODO: AppForm exception + } elseif (strpos($signal, self::NAME_SEPARATOR) === FALSE) { // counterpart of signalReceived() & tryCall() $method = $component->formatSignalMethod($signal); if (!$reflection->hasCallableMethod($method)) { @@ -898,7 +898,7 @@ protected function createRequest($component, $destination, array $args, $mode) $action = self::DEFAULT_ACTION; } - $current = ($action === '*' || strcasecmp($action, $this->action) === 0) && $presenterClass === get_class($this); // TODO + $current = ($action === '*' || strcasecmp($action, $this->action) === 0) && $presenterClass === get_class($this); $reflection = new PresenterComponentReflection($presenterClass); if ($args || $destination === 'this') { diff --git a/src/Application/UI/PresenterComponentReflection.php b/src/Application/UI/PresenterComponentReflection.php index c5d4a77c8..438c1be75 100644 --- a/src/Application/UI/PresenterComponentReflection.php +++ b/src/Application/UI/PresenterComponentReflection.php @@ -35,7 +35,7 @@ class PresenterComponentReflection extends Nette\Reflection\ClassType */ public function getPersistentParams($class = NULL) { - $class = $class === NULL ? $this->getName() : $class; // TODO + $class = $class === NULL ? $this->getName() : $class; $params = & self::$ppCache[$class]; if ($params !== NULL) { return $params;