Skip to content

Commit 1b73b49

Browse files
committed
used PhpStorm Language attribute
So that the addRoute() mask is not interpreted as HTML.
1 parent 3e86bb6 commit 1b73b49

File tree

2 files changed

+9
-4
lines changed

2 files changed

+9
-4
lines changed

composer.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,8 @@
3434
"latte/latte": "^2.10.2 || ^3.0.3",
3535
"tracy/tracy": "^2.6",
3636
"mockery/mockery": "^1.0",
37-
"phpstan/phpstan-nette": "^0.12"
37+
"phpstan/phpstan-nette": "^0.12",
38+
"jetbrains/phpstorm-attributes": "dev-master"
3839
},
3940
"conflict": {
4041
"nette/caching": "<3.1",

src/Application/Routers/RouteList.php

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99

1010
namespace Nette\Application\Routers;
1111

12+
use JetBrains\PhpStorm\Language;
1213
use Nette;
1314

1415

@@ -64,12 +65,15 @@ public function constructUrl(array $params, Nette\Http\UrlScript $refUrl): ?stri
6465

6566

6667
/**
67-
* @param string $mask e.g. '<presenter>/<action>/<id \d{1,3}>'
6868
* @param array|string|\Closure $metadata default values or metadata or callback for NetteModule\MicroPresenter
6969
* @return static
7070
*/
71-
public function addRoute(string $mask, $metadata = [], int $flags = 0)
72-
{
71+
public function addRoute(
72+
#[Language('TEXT')]
73+
string $mask,
74+
$metadata = [],
75+
int $flags = 0
76+
) {
7377
$this->add(new Route($mask, $metadata), $flags);
7478
return $this;
7579
}

0 commit comments

Comments
 (0)