8000 minor #21536 [TwigBridge] Add docblocks for Twig url and path functio… · dmaicher/symfony@85ae59a · GitHub
[go: up one dir, main page]

Skip to content

Commit 85ae59a

Browse files
committed
minor symfony#21536 [TwigBridge] Add docblocks for Twig url and path function to improve ide completion (Haehnchen)
This PR was merged into the 2.7 branch. Discussion ---------- [TwigBridge] Add docblocks for Twig url and path function to improve ide completion | Q | A | ------------- | --- | Branch? | 2.7 | Bug fix? | no | New feature? | no | BC breaks? | no | Deprecations? | no | Tests pass? | yes | License | MIT `RoutingExtension` missed docblock for Twig extension so `path` and `url` are not fully recognized by PhpStorm. Haehnchen/idea-php-symfony2-plugin#864 will add more smarter completion `{{ p<caret> }} -> {{ path('<caret>') }}`, but string parameter is not detected. This will add the minimal docs Commits ------- 93ab017 add docblocks for Twig url and path function to improve ide completion
2 parents be691d5 + 93ab017 commit 85ae59a

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

src/Symfony/Bridge/Twig/Extension/RoutingExtension.php

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,11 +40,25 @@ public function getFunctions()
4040
);
4141
}
4242

43+
/**
44+
* @param string $name
45+
* @param array $parameters
46+
* @param bool $relative
47+
*
48+
* @return string
49+
*/
4350
public function getPath($name, $parameters = array(), $relative = false)
4451
{
4552
return $this->generator->generate($name, $parameters, $relative ? UrlGeneratorInterface::RELATIVE_PATH : UrlGeneratorInterface::ABSOLUTE_PATH);
4653
}
4754

55+
/**
56+
* @param string $name
57+
* @param array $parameters
58+
* @param bool $schemeRelative
59+
*
60+
* @return string
61+
*/
4862
public function getUrl($name, $parameters = array(), $schemeRelative = false)
4963
{
5064
return $this->generator->generate($name, $parameters, $schemeRelative ? UrlGeneratorInterface::NETWORK_PATH : UrlGeneratorInterface::ABSOLUTE_URL);

0 commit comments

Comments
 (0)
0