bug #21800 [2.7] Fix issues reported by static analyze (romainneutron)
This PR was merged into the 2.7 branch.
Discussion
----------
[2.7] Fix issues reported by static analyze
| Q | A
| ------------- | ---
| Branch? | 2.7
| Bug fix? | yes
| New feature? | no
| BC breaks? | no
| Deprecations? | no
| Tests pass? | yes
| License | MIT
This PR fixes invalid doc blocks (typo or missing use) and a `sprintf` issue
Commits
-------
e473aa8
[2.7] Fix issues reported by static analyse
This commit is contained in:
commit
4597768377
@ -112,7 +112,7 @@ class TwigEngine implements EngineInterface, StreamingEngineInterface
|
|||||||
* @param string|TemplateReferenceInterface|\Twig_Template $name A template name or an instance of
|
* @param string|TemplateReferenceInterface|\Twig_Template $name A template name or an instance of
|
||||||
* TemplateReferenceInterface or \Twig_Template
|
* TemplateReferenceInterface or \Twig_Template
|
||||||
*
|
*
|
||||||
* @return \Twig_TemplateInterface A \Twig_TemplateInterface instance
|
* @return \Twig_Template A \Twig_Template instance
|
||||||
*
|
*
|
||||||
* @throws \InvalidArgumentException if the template does not exist
|
* @throws \InvalidArgumentException if the template does not exist
|
||||||
*/
|
*/
|
||||||
|
@ -67,7 +67,7 @@ class TemplateManager
|
|||||||
*
|
*
|
||||||
* @param Profile $profile
|
* @param Profile $profile
|
||||||
*
|
*
|
||||||
* @return Twig_Template[]
|
* @return \Twig_Template[]
|
||||||
*
|
*
|
||||||
* @deprecated not used anymore internally
|
* @deprecated not used anymore internally
|
||||||
*/
|
*/
|
||||||
|
@ -12,6 +12,7 @@
|
|||||||
namespace Symfony\Component\HttpKernel\EventListener;
|
namespace Symfony\Component\HttpKernel\EventListener;
|
||||||
|
|
||||||
use Symfony\Component\HttpFoundation\Cookie;
|
use Symfony\Component\HttpFoundation\Cookie;
|
||||||
|
use Symfony\Component\HttpFoundation\Session\SessionInterface;
|
||||||
use Symfony\Component\HttpKernel\KernelEvents;
|
use Symfony\Component\HttpKernel\KernelEvents;
|
||||||
use Symfony\Component\HttpKernel\Event\FilterResponseEvent;
|
use Symfony\Component\HttpKernel\Event\FilterResponseEvent;
|
||||||
use Symfony\Component\HttpKernel\Event\GetResponseEvent;
|
use Symfony\Component\HttpKernel\Event\GetResponseEvent;
|
||||||
|
@ -79,12 +79,12 @@ class YamlFileLoader extends FileLoader
|
|||||||
|
|
||||||
if (isset($data['groups'])) {
|
if (isset($data['groups'])) {
|
||||||
if (!is_array($data['groups'])) {
|
if (!is_array($data['groups'])) {
|
||||||
throw new MappingException('The "groups" key must be an array of strings in "%s" for the attribute "%s" of the class "%s".', $this->file, $attribute, $classMetadata->getName());
|
throw new MappingException(sprintf('The "groups" key must be an array of strings in "%s" for the attribute "%s" of the class "%s".', $this->file, $attribute, $classMetadata->getName()));
|
||||||
}
|
}
|
||||||
|
|
||||||
foreach ($data['groups'] as $group) {
|
foreach ($data['groups'] as $group) {
|
||||||
if (!is_string($group)) {
|
if (!is_string($group)) {
|
||||||
throw new MappingException('Group names must be strings in "%s" for the attribute "%s" of the class "%s".', $this->file, $attribute, $classMetadata->getName());
|
throw new MappingException(sprintf('Group names must be strings in "%s" for the attribute "%s" of the class "%s".', $this->file, $attribute, $classMetadata->getName()));
|
||||||
}
|
}
|
||||||
|
|
||||||
$attributeMetadata->addGroup($group);
|
$attributeMetadata->addGroup($group);
|
||||||
|
Reference in New Issue
Block a user