diff --git a/.travis.yml b/.travis.yml index 34c2d1303..19955db09 100644 --- a/.travis.yml +++ b/.travis.yml @@ -4,6 +4,7 @@ php: - 5.4 - 5.5 - 5.6 + - 7.0 - hhvm env: diff --git a/composer.json b/composer.json index 770ab4411..67e99a63f 100644 --- a/composer.json +++ b/composer.json @@ -1,16 +1,16 @@ { "name": "nette/application", "description": "Nette Application MVC Component", - "homepage": "http://nette.org", + "homepage": "https://nette.org", "license": ["BSD-3-Clause", "GPL-2.0", "GPL-3.0"], "authors": [ { "name": "David Grudl", - "homepage": "http://davidgrudl.com" + "homepage": "https://davidgrudl.com" }, { "name": "Nette Community", - "homepage": "http://nette.org/contributors" + "homepage": "https://nette.org/contributors" } ], "require": { diff --git a/contributing.md b/contributing.md index a1cbbd533..860882bf7 100644 --- a/contributing.md +++ b/contributing.md @@ -5,7 +5,7 @@ The issue tracker is the preferred channel for bug reports, features requests and submitting pull requests, but please respect the following restrictions: * Please **do not** use the issue tracker for personal support requests (use - [Nette forum](http://forum.nette.org) or [Stack Overflow](http://stackoverflow.com)). + [Nette forum](https://forum.nette.org) or [Stack Overflow](http://stackoverflow.com)). * Please **do not** derail or troll issues. Keep the discussion on topic and respect the opinions of others. @@ -21,7 +21,7 @@ fits with the scope and aims of the project. It's up to *you* to make a strong case to convince the project's developers of the merits of this feature. Nette welcomes **pull requests**. If you'd like to contribute, please take a moment -to [read the guidelines](http://nette.org/en/contributing) in order to make +to [read the guidelines](https://nette.org/en/contributing) in order to make the contribution process easy and effective for everyone involved. Thanks! diff --git a/license.md b/license.md index af571d592..cf741bd05 100644 --- a/license.md +++ b/license.md @@ -21,7 +21,7 @@ If your stuff is good, it will not take long to establish a reputation for yours New BSD License --------------- -Copyright (c) 2004, 2014 David Grudl (http://davidgrudl.com) +Copyright (c) 2004, 2014 David Grudl (https://davidgrudl.com) All rights reserved. Redistribution and use in source and binary forms, with or without modification, diff --git a/readme.md b/readme.md index 5accd72f0..47bd4b6de 100644 --- a/readme.md +++ b/readme.md @@ -6,4 +6,4 @@ Nette Application MVC Model-View-Controller is a software architecture that was created to satisfy the need to separate utility code (controller) from application logic code (model) and from code for displaying data (view) in applications with graphical user interface. With this approach we make the application better understandable, simplify future development and enable testing each unit of the application separately. -Please, [see documentation](http://doc.nette.org/en/presenters). +Please, [see documentation](https://doc.nette.org/en/presenters). diff --git a/src/Application/Application.php b/src/Application/Application.php index 34350f399..827a598e6 100644 --- a/src/Application/Application.php +++ b/src/Application/Application.php @@ -1,8 +1,8 @@ //' - * @param array|string default values or metadata + * @param array|string|\Closure default values or metadata or callback for NetteModule\MicroPresenter * @param int flags */ public function __construct($mask, $metadata = array(), $flags = 0) { if (is_string($metadata)) { - $a = strrpos($metadata, ':'); + $a = strrpos($tmp = $metadata, ':'); if (!$a) { throw new Nette\InvalidArgumentException("Second argument must be array or string in format Presenter:action, '$metadata' given."); } - $metadata = array( - self::PRESENTER_KEY => substr($metadata, 0, $a), - 'action' => $a === strlen($metadata) - 1 ? NULL : substr($metadata, $a + 1), - ); + $metadata = array(self::PRESENTER_KEY => substr($tmp, 0, $a)); + if ($a < strlen($tmp) - 1) { + $metadata['action'] = substr($tmp, $a + 1); + } } elseif ($metadata instanceof \Closure || $metadata instanceof Nette\Callback) { $metadata = array( self::PRESENTER_KEY => 'Nette:Micro', diff --git a/src/Application/Routers/RouteList.php b/src/Application/Routers/RouteList.php index 3af9bb80b..8c14dfd99 100644 --- a/src/Application/Routers/RouteList.php +++ b/src/Application/Routers/RouteList.php @@ -1,8 +1,8 @@ component->link($this->destination, $this->params); + } catch (\Throwable $e) { } catch (\Exception $e) { + } + if (isset($e)) { if (func_num_args()) { throw $e; } diff --git a/src/Application/UI/Multiplier.php b/src/Application/UI/Multiplier.php index 0f39a2575..ef486de28 100644 --- a/src/Application/UI/Multiplier.php +++ b/src/Application/UI/Multiplier.php @@ -1,8 +1,8 @@ latte->renderToString($this->file, $this->params); + } catch (\Throwable $e) { } catch (\Exception $e) { + } + if (isset($e)) { if (func_num_args()) { throw $e; } diff --git a/src/Bridges/ApplicationLatte/TemplateFactory.php b/src/Bridges/ApplicationLatte/TemplateFactory.php index b58588a7e..73e6f29b8 100644 --- a/src/Bridges/ApplicationLatte/TemplateFactory.php +++ b/src/Bridges/ApplicationLatte/TemplateFactory.php @@ -1,12 +1,8 @@