Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 51fabbe

Browse filesBrowse files
committed
[3.2] Fix issues reported by static analyse
1 parent f03e933 commit 51fabbe
Copy full SHA for 51fabbe

File tree

12 files changed

+16
-24
lines changed
Filter options

12 files changed

+16
-24
lines changed

‎src/Symfony/Bridge/Doctrine/ManagerRegistry.php

Copy file name to clipboardExpand all lines: src/Symfony/Bridge/Doctrine/ManagerRegistry.php
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ protected function resetService($name)
4545
$manager = $this->container->get($name);
4646

4747
if (!$manager instanceof LazyLoadingInterface) {
48-
@trigger_error(sprintf('Resetting a non-lazy manager service is deprecated since Symfony 3.2 and will throw an exception in version 4.0. Set the "%s" service as lazy and require "symfony/proxy-manager-bridge" in your composer.json file instead.', $name));
48+
@trigger_error(sprintf('Resetting a non-lazy manager service is deprecated since Symfony 3.2 and will throw an exception in version 4.0. Set the "%s" service as lazy and require "symfony/proxy-manager-bridge" in your composer.json file instead.', $name), E_USER_DEPRECATED);
4949

5050
$this->container->set($name, null);
5151

‎src/Symfony/Bundle/FrameworkBundle/CacheWarmer/TemplatePathsCacheWarmer.php

Copy file name to clipboardExpand all lines: src/Symfony/Bundle/FrameworkBundle/CacheWarmer/TemplatePathsCacheWarmer.php
+2-2Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,6 @@ public function __construct(TemplateFinderInterface $finder, TemplateLocator $lo
3535
{
3636
$this->finder = $finder;
3737
$this->locator = $locator;
38-
$this->filesystem = new Filesystem();
3938
}
4039

4140
/**
@@ -45,10 +44,11 @@ public function __construct(TemplateFinderInterface $finder, TemplateLocator $lo
4544
*/
4645
public function warmUp($cacheDir)
4746
{
47+
$filesystem = new Filesystem();
4848
$templates = array();
4949

5050
foreach ($this->finder->findAllTemplates() as $template) {
51-
$templates[$template->getLogicalName()] = rtrim($this->filesystem->makePathRelative($this->locator->locate($template), $cacheDir), '/');
51+
$templates[$template->getLogicalName()] = rtrim($filesystem->makePathRelative($this->locator->locate($template), $cacheDir), '/');
5252
}
5353

5454
$templates = str_replace("' => '", "' => __DIR__.'/", var_export($templates, true));

‎src/Symfony/Component/Cache/Adapter/ApcuAdapter.php

Copy file name to clipboardExpand all lines: src/Symfony/Component/Cache/Adapter/ApcuAdapter.php
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ public function __construct($namespace = '', $defaultLifetime = 0, $version = nu
3838
CacheItem::validateKey($version);
3939

4040
if (!apcu_exists($version.'@'.$namespace)) {
41-
$this->clear($namespace);
41+
$this->clear();
4242
apcu_add($version.'@'.$namespace, null);
4343
}
4444
}

‎src/Symfony/Component/DependencyInjection/Compiler/Compiler.php

Copy file name to clipboardExpand all lines: src/Symfony/Component/DependencyInjection/Compiler/Compiler.php
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ public function addPass(CompilerPassInterface $pass, $type = PassConfig::TYPE_BE
7878
if (__CLASS__ !== get_class($this)) {
7979
$r = new \ReflectionMethod($this, __FUNCTION__);
8080
if (__CLASS__ !== $r->getDeclaringClass()->getName()) {
81-
@trigger_error(sprintf('Method %s() will have a third `$priority = 0` argument in version 4.0. Not defining it is deprecated since 3.2.', get_class($this), __FUNCTION__), E_USER_DEPRECATED);
81+
@trigger_error(sprintf('Method %s() will have a third `$priority = 0` argument in version 4.0. Not defining it is deprecated since 3.2.', __METHOD__), E_USER_DEPRECATED);
8282
}
8383
}
8484

‎src/Symfony/Component/DependencyInjection/Compiler/PassConfig.php

Copy file name to clipboardExpand all lines: src/Symfony/Component/DependencyInjection/Compiler/PassConfig.php
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@ public function addPass(CompilerPassInterface $pass, $type = self::TYPE_BEFORE_O
102102
if (__CLASS__ !== get_class($this)) {
103103
$r = new \ReflectionMethod($this, __FUNCTION__);
104104
if (__CLASS__ !== $r->getDeclaringClass()->getName()) {
105-
@trigger_error(sprintf('Method %s() will have a third `$priority = 0` argument in version 4.0. Not defining it is deprecated since 3.2.', get_class($this), __FUNCTION__), E_USER_DEPRECATED);
105+
@trigger_error(sprintf('Method %s() will have a third `$priority = 0` argument in version 4.0. Not defining it is deprecated since 3.2.', __METHOD__), E_USER_DEPRECATED);
106106
}
107107
}
108108

‎src/Symfony/Component/DependencyInjection/ContainerBuilder.php

Copy file name to clipboardExpand all lines: src/Symfony/Component/DependencyInjection/ContainerBuilder.php
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -316,7 +316,7 @@ public function addCompilerPass(CompilerPassInterface $pass, $type = PassConfig:
316316
if (__CLASS__ !== get_class($this)) {
317317
$r = new \ReflectionMethod($this, __FUNCTION__);
318318
if (__CLASS__ !== $r->getDeclaringClass()->getName()) {
319-
@trigger_error(sprintf('Method %s() will have a third `$priority = 0` argument in version 4.0. Not defining it is deprecated since 3.2.', get_class($this), __FUNCTION__), E_USER_DEPRECATED);
319+
@trigger_error(sprintf('Method %s() will have a third `$priority = 0` argument in version 4.0. Not defining it is deprecated since 3.2.', __METHOD__), E_USER_DEPRECATED);
320320
}
321321
}
322322

‎src/Symfony/Component/DependencyInjection/Loader/XmlFileLoader.php

Copy file name to clipboardExpand all lines: src/Symfony/Component/DependencyInjection/Loader/XmlFileLoader.php
+3-9Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -182,7 +182,7 @@ private function parseDefinition(\DOMElement $service, $file)
182182
if (isset($factoryService[0])) {
183183
$class = $this->parseDefinition($factoryService[0], $file);
184184
} elseif ($childService = $factory->getAttribute('service')) {
185-
$class = new Reference($childService, ContainerInterface::EXCEPTION_ON_INVALID_REFERENCE, false);
185+
$class = new Reference($childService, ContainerInterface::EXCEPTION_ON_INVALID_REFERENCE);
186186
} else {
187187
$class = $factory->getAttribute('class');
188188
}
@@ -201,7 +201,7 @@ private function parseDefinition(\DOMElement $service, $file)
201201
if (isset($configuratorService[0])) {
202202
$class = $this->parseDefinition($configuratorService[0], $file);
203203
} elseif ($childService = $configurator->getAttribute('service')) {
204-
$class = new Reference($childService, ContainerInterface::EXCEPTION_ON_INVALID_REFERENCE, false);
204+
$class = new Reference($childService, ContainerInterface::EXCEPTION_ON_INVALID_REFERENCE);
205205
} else {
206206
$class = $configurator->getAttribute('class');
207207
}
@@ -374,13 +374,7 @@ private function getArgumentsAsPhp(\DOMElement $node, $name, $lowercase = true)
374374
$invalidBehavior = ContainerInterface::NULL_ON_INVALID_REFERENCE;
375375
}
376376

377-
if ($strict = $arg->getAttribute('strict')) {
378-
$strict = XmlUtils::phpize($strict);
379-
} else {
380-
$strict = true;
381-
}
382-
383-
$arguments[$key] = new Reference($arg->getAttribute('id'), $invalidBehavior, $strict);
377+
$arguments[$key] = new Reference($arg->getAttribute('id'), $invalidBehavior);
384378
break;
385379
case 'expression':
386380
$arguments[$key] = new Expression($arg->nodeValue);

‎src/Symfony/Component/DependencyInjection/Loader/YamlFileLoader.php

Copy file name to clipboardExpand all lines: src/Symfony/Component/DependencyInjection/Loader/YamlFileLoader.php
+1-4Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -468,13 +468,10 @@ private function resolveServices($value)
468468

469469
if ('=' === substr($value, -1)) {
470470
$value = substr($value, 0, -1);
471-
$strict = false;
472-
} else {
473-
$strict = true;
474471
}
475472

476473
if (null !== $invalidBehavior) {
477-
$value = new Reference($value, $invalidBehavior, $strict);
474+
$value = new Reference($value, $invalidBehavior);
478475
}
479476
}
480477

‎src/Symfony/Component/HttpKernel/DataCollector/DataCollector.php

Copy file name to clipboardExpand all lines: src/Symfony/Component/HttpKernel/DataCollector/DataCollector.php
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@ protected function cloneVar($var)
102102
*/
103103
protected function varToString($var)
104104
{
105-
@trigger_error(sprintf('The %() method is deprecated since version 3.2 and will be removed in 4.0. Use cloneVar() instead.', __METHOD__), E_USER_DEPRECATED);
105+
@trigger_error(sprintf('The %s() method is deprecated since version 3.2 and will be removed in 4.0. Use cloneVar() instead.', __METHOD__), E_USER_DEPRECATED);
106106

107107
if (null === $this->valueExporter) {
108108
$this->valueExporter = new ValueExporter();

‎src/Symfony/Component/Serializer/Normalizer/AbstractNormalizer.php

Copy file name to clipboardExpand all lines: src/Symfony/Component/Serializer/Normalizer/AbstractNormalizer.php
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -296,7 +296,7 @@ protected function instantiateObject(array &$data, $class, array &$context, \Ref
296296
if (__CLASS__ !== get_class($this)) {
297297
$r = new \ReflectionMethod($this, __FUNCTION__);
298298
if (__CLASS__ !== $r->getDeclaringClass()->getName()) {
299-
@trigger_error(sprintf('Method %s() will have a 6th `$format = null` argument in version 4.0. Not defining it is deprecated since 3.2.', get_class($this), __FUNCTION__), E_USER_DEPRECATED);
299+
@trigger_error(sprintf('Method %s::%s() will have a 6th `$format = null` argument in version 4.0. Not defining it is deprecated since 3.2.', get_class($this), __FUNCTION__), E_USER_DEPRECATED);
300300
}
301301
}
302302

‎src/Symfony/Component/Translation/Dumper/FileDumper.php

Copy file name to clipboardExpand all lines: src/Symfony/Component/Translation/Dumper/FileDumper.php
+1Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313

1414
use Symfony\Component\Translation\MessageCatalogue;
1515
use Symfony\Component\Translation\Exception\InvalidArgumentException;
16+
use Symfony\Component\Translation\Exception\RuntimeException;
1617

1718
/**
1819
* FileDumper is an implementation of DumperInterface that dump a message catalogue to file(s).

‎src/Symfony/Component/Workflow/Workflow.php

Copy file name to clipboardExpand all lines: src/Symfony/Component/Workflow/Workflow.php
+2-2Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ public function getMarking($subject)
9292
*/
9393
public function can($subject, $transitionName)
9494
{
95-
$transitions = $this->getEnabledTransitions($subject, $this->getMarking($subject));
95+
$transitions = $this->getEnabledTransitions($subject);
9696

9797
foreach ($transitions as $transition) {
9898
if ($transitionName === $transition->getName()) {
@@ -116,7 +116,7 @@ public function can($subject, $transitionName)
116116
*/
117117
public function apply($subject, $transitionName)
118118
{
119-
$transitions = $this->getEnabledTransitions($subject, $this->getMarking($subject));
119+
$transitions = $this->getEnabledTransitions($subject);
120120

121121
// We can shortcut the getMarking method in order to boost performance,
122122
// since the "getEnabledTransitions" method already checks the Marking

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.