diff --git a/.travis.yml b/.travis.yml index 31a5f47e67..59034205bc 100644 --- a/.travis.yml +++ b/.travis.yml @@ -5,14 +5,17 @@ php: - 5.5 - 5.6 -script: VERBOSE=true ./tests/run-tests.sh -s tests/ +script: + - VERBOSE=true ./tests/run-tests.sh -s tests/ + - php code-checker/src/code-checker.php -d Nette services: - memcached before_script: - # Install Nette Tester + # Install Nette Tester & Code Checker - composer install --no-interaction --dev --prefer-source + - composer create-project nette/code-checker code-checker ~2.2 --no-interaction --prefer-source # Create databases.ini - cp ./tests/Nette/Database/databases.sample.ini ./tests/Nette/Database/databases.ini diff --git a/Nette/Application/Application.php b/Nette/Application/Application.php index 26adced3e3..eba28ca2e9 100644 --- a/Nette/Application/Application.php +++ b/Nette/Application/Application.php @@ -163,6 +163,9 @@ public function processRequest(Request $request) */ public function processException(\Exception $e) { + if (!$e instanceof BadRequestException) { + $this->httpResponse->warnOnBuffer = FALSE; + } if (!$this->httpResponse->isSent()) { $this->httpResponse->setCode($e instanceof BadRequestException ? ($e->getCode() ?: 404) : 500); } diff --git a/Nette/Application/Diagnostics/RoutingPanel.php b/Nette/Application/Diagnostics/RoutingPanel.php index b5282d658c..b7984006d3 100644 --- a/Nette/Application/Diagnostics/RoutingPanel.php +++ b/Nette/Application/Diagnostics/RoutingPanel.php @@ -67,6 +67,7 @@ public function getTab() { $this->analyse($this->router); ob_start(); + $request = $this->request; require __DIR__ . '/templates/RoutingPanel.tab.phtml'; return ob_get_clean(); } @@ -79,6 +80,10 @@ public function getTab() public function getPanel() { ob_start(); + $request = $this->request; + $routers = $this->routers; + $source = $this->source; + $url = $this->httpRequest->getUrl(); require __DIR__ . '/templates/RoutingPanel.panel.phtml'; return ob_get_clean(); } diff --git a/Nette/Application/Diagnostics/templates/RoutingPanel.panel.phtml b/Nette/Application/Diagnostics/templates/RoutingPanel.panel.phtml index 71d255e0dd..56a1a5fdee 100644 --- a/Nette/Application/Diagnostics/templates/RoutingPanel.panel.phtml +++ b/Nette/Application/Diagnostics/templates/RoutingPanel.panel.phtml @@ -34,17 +34,17 @@ use Nette,

-request)): ?> + no route - request->getPresenterName() . ':' . (isset($this->request->parameters[Presenter::ACTION_KEY]) ? $this->request->parameters[Presenter::ACTION_KEY] : Presenter::DEFAULT_ACTION) . (isset($this->request->parameters[Presenter::SIGNAL_KEY]) ? " {$this->request->parameters[Presenter::SIGNAL_KEY]}!" : '')) ?> + getPresenterName() . ':' . (isset($request->parameters[Presenter::ACTION_KEY]) ? $request->parameters[Presenter::ACTION_KEY] : Presenter::DEFAULT_ACTION) . (isset($request->parameters[Presenter::SIGNAL_KEY]) ? " {$request->parameters[Presenter::SIGNAL_KEY]}!" : '')) ?>

-

httpRequest->getUrl()) ?>

+

-routers)): ?> +

No routers defined.

@@ -61,7 +61,7 @@ use Nette, - routers as $router): ?> + @@ -91,6 +91,6 @@ use Nette, - source): ?>

source ?> in source->getFileName(), $this->source->getStartLine()) ?>

+

in getFileName(), $source->getStartLine()) ?>

diff --git a/Nette/Application/Diagnostics/templates/RoutingPanel.tab.phtml b/Nette/Application/Diagnostics/templates/RoutingPanel.tab.phtml index 9edf58215f..70ce2fbe41 100644 --- a/Nette/Application/Diagnostics/templates/RoutingPanel.tab.phtml +++ b/Nette/Application/Diagnostics/templates/RoutingPanel.tab.phtml @@ -7,4 +7,4 @@ use Nette, ?> request)): ?>no routerequest->getPresenterName() . ':' . (isset($this->request->parameters[Presenter::ACTION_KEY]) ? $this->request->parameters[Presenter::ACTION_KEY] : Presenter::DEFAULT_ACTION) . (isset($this->request->parameters[Presenter::SIGNAL_KEY]) ? " {$this->request->parameters[Presenter::SIGNAL_KEY]}!" : '')); endif ?> +/>no routegetPresenterName() . ':' . (isset($request->parameters[Presenter::ACTION_KEY]) ? $request->parameters[Presenter::ACTION_KEY] : Presenter::DEFAULT_ACTION) . (isset($request->parameters[Presenter::SIGNAL_KEY]) ? " {$request->parameters[Presenter::SIGNAL_KEY]}!" : '')); endif ?> diff --git a/Nette/Application/MicroPresenter.php b/Nette/Application/MicroPresenter.php index abed12e26d..1bc8da8cbc 100644 --- a/Nette/Application/MicroPresenter.php +++ b/Nette/Application/MicroPresenter.php @@ -118,7 +118,7 @@ public function createTemplate($class = NULL, $latteFactory = NULL) $template->registerHelperLoader('Nette\Templating\Helpers::loader'); $template->setCacheStorage($context->getService('nette.templateCacheStorage')); - $template->onPrepareFilters[] = function($template) use ($latteFactory) { + $template->onPrepareFilters[] = function(Nette\Templating\ITemplate $template) use ($latteFactory) { $template->registerFilter($latteFactory ? $latteFactory() : new Nette\Latte\Engine); }; return $template; diff --git a/Nette/Application/PresenterFactory.php b/Nette/Application/PresenterFactory.php index 1b42214bbe..0948c8c3b9 100644 --- a/Nette/Application/PresenterFactory.php +++ b/Nette/Application/PresenterFactory.php @@ -147,6 +147,7 @@ public function setMapping(array $mapping) * Formats presenter class name from its name. * @param string * @return string + * @internal */ public function formatPresenterClass($presenter) { @@ -166,6 +167,7 @@ public function formatPresenterClass($presenter) * Formats presenter name from class name. * @param string * @return string + * @internal */ public function unformatPresenterClass($class) { diff --git a/Nette/Application/Routers/Route.php b/Nette/Application/Routers/Route.php index fb6f6f20f4..d4bb1948b8 100644 --- a/Nette/Application/Routers/Route.php +++ b/Nette/Application/Routers/Route.php @@ -401,7 +401,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; @@ -734,8 +734,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/Nette/Application/UI/Presenter.php b/Nette/Application/UI/Presenter.php index e070628047..2f2d11f102 100644 --- a/Nette/Application/UI/Presenter.php +++ b/Nette/Application/UI/Presenter.php @@ -221,7 +221,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(); @@ -287,7 +287,7 @@ protected function shutdown($response) public function checkRequirements($element) { $user = (array) $element->getAnnotation('User'); - if (in_array('loggedIn', $user) && !$this->user->isLoggedIn()) { + if (in_array('loggedIn', $user, TRUE) && !$this->user->isLoggedIn()) { throw new Application\ForbiddenRequestException; } } @@ -469,6 +469,7 @@ public function sendTemplate() /** * Finds layout template file name. * @return string + * @internal */ public function findLayoutTemplateFile() { @@ -691,6 +692,7 @@ public function error($message = NULL, $code = Http\IResponse::S404_NOT_FOUND) /** * Link to myself. * @return string + * @deprecated */ public function backlink() { @@ -701,6 +703,7 @@ public function backlink() /** * Returns the last created Request. * @return Nette\Application\Request + * @internal */ public function getLastCreatedRequest() { @@ -712,6 +715,7 @@ public function getLastCreatedRequest() * Returns the last created Request flag. * @param string * @return bool + * @internal */ public function getLastCreatedRequestFlag($flag) { @@ -867,7 +871,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 +902,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') { @@ -1255,6 +1259,7 @@ private function initGlobalParameters() * Pops parameters for specified component. * @param string component id * @return array + * @internal */ public function popGlobalParameters($id) { diff --git a/Nette/Application/UI/PresenterComponentReflection.php b/Nette/Application/UI/PresenterComponentReflection.php index c5d4a77c8c..438c1be759 100644 --- a/Nette/Application/UI/PresenterComponentReflection.php +++ b/Nette/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; diff --git a/Nette/Caching/Cache.php b/Nette/Caching/Cache.php index 3726e58e0a..158962fd62 100644 --- a/Nette/Caching/Cache.php +++ b/Nette/Caching/Cache.php @@ -154,7 +154,6 @@ private function completeDependencies($dp, $data) // convert FILES into CALLBACKS if (isset($dp[self::FILES])) { - //clearstatcache(); foreach (array_unique((array) $dp[self::FILES]) as $item) { $dp[self::CALLBACKS][] = array(array(__CLASS__, 'checkFile'), $item, @filemtime($item)); // @ - stat may fail } diff --git a/Nette/Caching/Storages/FileJournal.php b/Nette/Caching/Storages/FileJournal.php index 5cb805d1ae..89d9a6ee72 100644 --- a/Nette/Caching/Storages/FileJournal.php +++ b/Nette/Caching/Storages/FileJournal.php @@ -804,7 +804,7 @@ private function findIndexNode($type, $search, $childId = NULL, $prevId = NULL) $nodeId = $node[$search]; } else { foreach ($node as $key => $childNode) { - if ($key > $search and $key !== self::INFO) { + if ($key > $search && $key !== self::INFO) { $nodeId = $childNode; continue 2; } diff --git a/Nette/DI/Compiler.php b/Nette/DI/Compiler.php index 0fdbd67985..78fe94a8d9 100644 --- a/Nette/DI/Compiler.php +++ b/Nette/DI/Compiler.php @@ -93,6 +93,7 @@ public function compile(array $config, $className, $parentName) } + /** @internal */ public function processParameters() { if (isset($this->config['parameters'])) { @@ -101,6 +102,7 @@ public function processParameters() } + /** @internal */ public function processExtensions() { for ($i = 0; $slice = array_slice($this->extensions, $i, 1, TRUE); $i++) { @@ -118,6 +120,7 @@ public function processExtensions() } + /** @internal */ public function processServices() { $this->parseServices($this->builder, $this->config); @@ -130,6 +133,7 @@ public function processServices() } + /** @internal */ public function generateCode($className, $parentName) { foreach ($this->extensions as $extension) { @@ -169,7 +173,7 @@ public static function parseServices(ContainerBuilder $builder, array $config, $ $path = array(); while (Config\Helpers::isInheriting($def)) { $path[] = $def; - $def = $all[$def[Config\Helpers::EXTENDS_KEY]]; + $def = isset($all[$def[Config\Helpers::EXTENDS_KEY]]) ? $all[$def[Config\Helpers::EXTENDS_KEY]] : array(); if (in_array($def, $path, TRUE)) { throw new ServiceCreationException("Circular reference detected for service '$name'."); } diff --git a/Nette/DI/Container.php b/Nette/DI/Container.php index a666d88ee4..63f76323c3 100644 --- a/Nette/DI/Container.php +++ b/Nette/DI/Container.php @@ -252,7 +252,7 @@ public function callInjects($service) } } - foreach (Helpers::getInjectProperties(Nette\Reflection\ClassType::from($service)) as $property => $type) { + foreach (Helpers::getInjectProperties(Nette\Reflection\ClassType::from($service), $this) as $property => $type) { $service->$property = $this->getByType($type); } } diff --git a/Nette/DI/ContainerBuilder.php b/Nette/DI/ContainerBuilder.php index 3a1d3d6ef8..54655bf03d 100644 --- a/Nette/DI/ContainerBuilder.php +++ b/Nette/DI/ContainerBuilder.php @@ -179,6 +179,7 @@ public function autowireArguments($class, $method, array $arguments) /** * Generates $dependencies, $classes and normalizes class names. * @return array + * @internal */ public function prepareClassList() { @@ -191,7 +192,7 @@ public function prepareClassList() } if (!interface_exists($def->implement)) { - throw new ServiceCreationException("Interface $def->implement used in service '$name' has not been found."); + throw new ServiceCreationException("Interface $def->implement used in service '$name' not found."); } $rc = Reflection\ClassType::from($def->implement); $method = $rc->hasMethod('create') ? $rc->getMethod('create') : ($rc->hasMethod('get') ? $rc->getMethod('get') : NULL); @@ -204,7 +205,7 @@ public function prepareClassList() if (!$def->class && empty($def->factory->entity)) { $returnType = $method->getAnnotation('return'); if (!$returnType) { - throw new ServiceCreationException("Method $method used in service '$name' has not @return annotation."); + throw new ServiceCreationException("Method $method used in service '$name' has no @return annotation."); } $returnType = Reflection\AnnotationsParser::expandClassName(preg_replace('#[|\s].*#', '', $returnType), $rc); @@ -257,7 +258,7 @@ public function prepareClassList() if (is_string($factory) && preg_match('#^[\w\\\\]+\z#', $factory) && $factory !== self::THIS_SERVICE) { if (!class_exists($factory) || !Reflection\ClassType::from($factory)->isInstantiable()) { - throw new ServiceCreationException("Class $factory used in service '$name' has not been found or is not instantiable."); + throw new ServiceCreationException("Class $factory used in service '$name' not found or is not instantiable."); } } } @@ -269,7 +270,7 @@ public function prepareClassList() if (!$def->class) { continue; } elseif (!class_exists($def->class) && !interface_exists($def->class)) { - throw new ServiceCreationException("Class or interface $def->class used in service '$name' has not been found."); + throw new ServiceCreationException("Class or interface $def->class used in service '$name' not found."); } else { $def->class = Reflection\ClassType::from($def->class)->getName(); } @@ -322,8 +323,9 @@ private function resolveClass($name, $recursive = array()) try { $reflection = Nette\Utils\Callback::toReflection($factory); } catch (\ReflectionException $e) { - $name = array_slice(array_keys($recursive), -1); - throw new ServiceCreationException("Factory '" . Nette\Utils\Callback::toString($factory) . "' used in service '$name[0]' is not callable."); + } + if (isset($e) || !is_callable($factory)) { + throw new ServiceCreationException(sprintf("Factory '%s' used in service '%s' is not callable.", Nette\Utils\Callback::toString($factory), $name)); } $def->class = preg_replace('#[|\s].*#', '', $reflection->getAnnotation('return')); if ($def->class && $reflection instanceof \ReflectionMethod) { @@ -454,7 +456,7 @@ private function generateService($name) $setups = (array) $def->setup; if ($def->inject && $def->class) { $injects = array(); - foreach (Helpers::getInjectProperties(Reflection\ClassType::from($def->class)) as $property => $type) { + foreach (Helpers::getInjectProperties(Reflection\ClassType::from($def->class), $this) as $property => $type) { $injects[] = new Statement('$' . $property, array('@\\' . ltrim($type, '\\'))); } @@ -599,6 +601,7 @@ public function formatStatement(Statement $statement) /** * Formats PHP statement. * @return string + * @internal */ public function formatPhp($statement, $args) { @@ -681,6 +684,7 @@ public function normalizeEntity($entity) /** * Converts @service or @\Class -> service name and checks its existence. * @return string of FALSE, if argument is not service name + * @internal */ public function getServiceName($arg) { diff --git a/Nette/DI/Diagnostics/templates/ContainerPanel.panel.phtml b/Nette/DI/Diagnostics/templates/ContainerPanel.panel.phtml index 19643d9356..b233304b01 100644 --- a/Nette/DI/Diagnostics/templates/ContainerPanel.panel.phtml +++ b/Nette/DI/Diagnostics/templates/ContainerPanel.panel.phtml @@ -29,7 +29,7 @@ use Nette,
-

container) ?>

+

Services

@@ -45,7 +45,7 @@ use Nette, $class): ?> - findByType($class)); ?> + findByType($class), TRUE); ?> @@ -67,7 +67,7 @@ use Nette,

Parameters

- container->parameters); ?> + parameters); ?>
diff --git a/Nette/DI/Helpers.php b/Nette/DI/Helpers.php index 1dcaa17b42..dab273476f 100644 --- a/Nette/DI/Helpers.php +++ b/Nette/DI/Helpers.php @@ -14,6 +14,7 @@ * The DI helpers. * * @author David Grudl + * @internal */ class Helpers { @@ -107,8 +108,10 @@ public static function autowireArguments(\ReflectionFunctionAbstract $method, ar if ($res[$num] === NULL) { if ($parameter->allowsNull()) { $optCount++; + } elseif (class_exists($class) || interface_exists($class)) { + throw new ServiceCreationException("Service of type {$class} needed by $method not found. Did you register it in configuration file?"); } else { - throw new ServiceCreationException("No service of type {$class} found. Make sure the type hint in $method is written correctly and service of this type is registered."); + throw new ServiceCreationException("Class {$class} needed by $method not found. Check type hint and 'use' statements."); } } else { if ($container instanceof ContainerBuilder) { @@ -145,7 +148,7 @@ public static function autowireArguments(\ReflectionFunctionAbstract $method, ar * Generates list of properties with annotation @inject. * @return array */ - public static function getInjectProperties(Nette\Reflection\ClassType $class) + public static function getInjectProperties(Nette\Reflection\ClassType $class, $container = NULL) { $res = array(); foreach ($class->getProperties(\ReflectionProperty::IS_PUBLIC) as $property) { @@ -154,7 +157,7 @@ public static function getInjectProperties(Nette\Reflection\ClassType $class) continue; } elseif (!$type) { - throw new Nette\InvalidStateException("Property $property has not @var annotation."); + throw new Nette\InvalidStateException("Property $property has no @var annotation."); } elseif (!class_exists($type) && !interface_exists($type)) { if ($type[0] !== '\\') { @@ -164,6 +167,9 @@ public static function getInjectProperties(Nette\Reflection\ClassType $class) throw new Nette\InvalidStateException("Please use a fully qualified name of class/interface in @var annotation at $property property. Class '$type' cannot be found."); } } + if ($container && !$container->getByType($type, FALSE)) { + throw new ServiceCreationException("Service of type {$type} used in @var annotation at $property not found. Did you register it in configuration file?"); + } $res[$property->getName()] = $type; } return $res; diff --git a/Nette/Database/Drivers/MsSqlDriver.php b/Nette/Database/Drivers/MsSqlDriver.php index 6f4ffa72e1..1ff6819837 100644 --- a/Nette/Database/Drivers/MsSqlDriver.php +++ b/Nette/Database/Drivers/MsSqlDriver.php @@ -17,14 +17,6 @@ */ class MsSqlDriver extends Nette\Object implements Nette\Database\ISupplementalDriver { - /** @var Nette\Database\Connection */ - private $connection; - - - public function __construct(Nette\Database\Connection $connection, array $options) - { - $this->connection = $connection; - } /********************* SQL ****************d*g**/ diff --git a/Nette/Database/Drivers/MySqlDriver.php b/Nette/Database/Drivers/MySqlDriver.php index b550281436..ef1d0ce1bc 100644 --- a/Nette/Database/Drivers/MySqlDriver.php +++ b/Nette/Database/Drivers/MySqlDriver.php @@ -114,11 +114,6 @@ public function normalizeRow($row) */ public function getTables() { - /*$this->connection->query(" - SELECT TABLE_NAME as name, TABLE_TYPE = 'VIEW' as view - FROM INFORMATION_SCHEMA.TABLES - WHERE TABLE_SCHEMA = DATABASE() - ");*/ $tables = array(); foreach ($this->connection->query('SHOW FULL TABLES') as $row) { $tables[] = array( @@ -135,11 +130,6 @@ public function getTables() */ public function getColumns($table) { - /*$this->connection->query(" - SELECT * - FROM INFORMATION_SCHEMA.COLUMNS - WHERE TABLE_NAME = {$this->connection->quote($table)} AND TABLE_SCHEMA = DATABASE() - ");*/ $columns = array(); foreach ($this->connection->query('SHOW FULL COLUMNS FROM ' . $this->delimite($table)) as $row) { $type = explode('(', $row['Type']); @@ -165,12 +155,6 @@ public function getColumns($table) */ public function getIndexes($table) { - /*$this->connection->query(" - SELECT * - FROM INFORMATION_SCHEMA.KEY_COLUMN_USAGE - WHERE TABLE_NAME = {$this->connection->quote($table)} AND TABLE_SCHEMA = DATABASE() - AND REFERENCED_COLUMN_NAME IS NULL - ");*/ $indexes = array(); foreach ($this->connection->query('SHOW INDEX FROM ' . $this->delimite($table)) as $row) { $indexes[$row['Key_name']]['name'] = $row['Key_name']; diff --git a/Nette/Database/Drivers/OdbcDriver.php b/Nette/Database/Drivers/OdbcDriver.php index d7d0a622a8..009192731a 100644 --- a/Nette/Database/Drivers/OdbcDriver.php +++ b/Nette/Database/Drivers/OdbcDriver.php @@ -17,15 +17,6 @@ */ class OdbcDriver extends Nette\Object implements Nette\Database\ISupplementalDriver { - /** @var Nette\Database\Connection */ - private $connection; - - - public function __construct(Nette\Database\Connection $connection, array $options) - { - $this->connection = $connection; - } - /********************* SQL ****************d*g**/ diff --git a/Nette/Database/Drivers/SqliteDriver.php b/Nette/Database/Drivers/SqliteDriver.php index abf78cdc6b..07921fac0a 100644 --- a/Nette/Database/Drivers/SqliteDriver.php +++ b/Nette/Database/Drivers/SqliteDriver.php @@ -28,7 +28,6 @@ public function __construct(Nette\Database\Connection $connection, array $option { $this->connection = $connection; $this->fmtDateTime = isset($options['formatDateTime']) ? $options['formatDateTime'] : 'U'; - //$connection->query('PRAGMA foreign_keys = ON'); } diff --git a/Nette/Database/Helpers.php b/Nette/Database/Helpers.php index b7af9e271c..5050dd896f 100644 --- a/Nette/Database/Helpers.php +++ b/Nette/Database/Helpers.php @@ -56,7 +56,6 @@ public static function dumpResult(ResultSet $result) } echo "\t\n\t\t", $i, "\n"; foreach ($row as $col) { - //if (is_object($col)) $col = $col->__toString(); echo "\t\t", htmlSpecialChars($col), "\n"; } echo "\t\n"; diff --git a/Nette/Database/Table/ActiveRow.php b/Nette/Database/Table/ActiveRow.php index fffb3bc349..a1dbdb8939 100644 --- a/Nette/Database/Table/ActiveRow.php +++ b/Nette/Database/Table/ActiveRow.php @@ -29,9 +29,6 @@ class ActiveRow implements \IteratorAggregate, IRow /** @var bool */ private $dataRefreshed = FALSE; - /** @var bool */ - private $isModified = FALSE; - public function __construct(array $data, Selection $table) { @@ -175,7 +172,6 @@ public function update($data) ->wherePrimary($this->getPrimary()); if ($selection->update($data)) { - $this->isModified = TRUE; $selection->select('*'); if (($row = $selection->fetch()) === FALSE) { throw new Nette\InvalidStateException('Database refetch failed; row does not exist!'); diff --git a/Nette/Diagnostics/Debugger.php b/Nette/Diagnostics/Debugger.php index 1444d9b041..fefcb90016 100644 --- a/Nette/Diagnostics/Debugger.php +++ b/Nette/Diagnostics/Debugger.php @@ -394,7 +394,7 @@ public static function _shutdownHandler() } $error = error_get_last(); - if (in_array($error['type'], array(E_ERROR, E_CORE_ERROR, E_COMPILE_ERROR, E_PARSE))) { + if (in_array($error['type'], array(E_ERROR, E_CORE_ERROR, E_COMPILE_ERROR, E_PARSE), TRUE)) { self::_exceptionHandler(Helpers::fixStack(new ErrorException($error['message'], 0, $error['type'], $error['file'], $error['line'])), TRUE); } elseif (!connection_aborted() && !self::$productionMode && self::isHtmlMode()) { diff --git a/Nette/Diagnostics/OutputDebugger.php b/Nette/Diagnostics/OutputDebugger.php index 6f6baf6063..0cbf360727 100644 --- a/Nette/Diagnostics/OutputDebugger.php +++ b/Nette/Diagnostics/OutputDebugger.php @@ -62,7 +62,6 @@ private function renderHtml() { $res = ''; foreach ($this->list as $item) { - list($file, $line, $s) = $item; $res .= Helpers::editorLink($item[0], $item[1]) . ' ' . str_replace(self::BOM, 'BOM', Dumper::toHtml($item[2])) . "
\n"; } diff --git a/Nette/Diagnostics/templates/bluescreen.phtml b/Nette/Diagnostics/templates/bluescreen.phtml index fea7044b96..d3d7cd589b 100644 --- a/Nette/Diagnostics/templates/bluescreen.phtml +++ b/Nette/Diagnostics/templates/bluescreen.phtml @@ -85,7 +85,7 @@ $counter = 0; getTrace(); $expanded = NULL ?> - getSeverity(), array(E_USER_NOTICE, E_USER_WARNING, E_USER_DEPRECATED))) && $this->isCollapsed($ex->getFile())) { + getSeverity(), array(E_USER_NOTICE, E_USER_WARNING, E_USER_DEPRECATED), TRUE)) && $this->isCollapsed($ex->getFile())) { foreach ($stack as $key => $row) { if (isset($row['file']) && !$this->isCollapsed($row['file'])) { $expanded = $key; break; } } @@ -116,7 +116,7 @@ $counter = 0; inner-code - " class="nette-toggle-collapsed">source  + " class="nette-toggle">source  " ?> diff --git a/Nette/Diagnostics/templates/error.phtml b/Nette/Diagnostics/templates/error.phtml index 15094a3042..278dc75687 100644 --- a/Nette/Diagnostics/templates/error.phtml +++ b/Nette/Diagnostics/templates/error.phtml @@ -7,11 +7,10 @@ namespace Nette\Diagnostics; ?> - + -