Skip to content

Commit

Permalink
Fixed coding standards
Browse files Browse the repository at this point in the history
  • Loading branch information
przemyslaw-bogusz committed Apr 6, 2019
1 parent ce94503 commit 7fa6256
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -150,19 +150,19 @@ protected function processValue($value, $isRoot = false)
}

foreach ($reflectionMethod->getParameters() as $key => $parameter) {
if (array_key_exists($key, $arguments) && '' !== $arguments[$key]) {
if (\array_key_exists($key, $arguments) && '' !== $arguments[$key]) {
continue;
}

$typeHint = ProxyHelper::getTypeHint($reflectionMethod, $parameter);

if (array_key_exists($k = ltrim($typeHint, '\\').' $'.$parameter->name, $bindings)) {
if (\array_key_exists($k = ltrim($typeHint, '\\').' $'.$parameter->name, $bindings)) {
$arguments[$key] = $this->getBindingValue($bindings[$k]);

continue;
}

if (array_key_exists('$'.$parameter->name, $bindings)) {
if (\array_key_exists('$'.$parameter->name, $bindings)) {
$arguments[$key] = $this->getBindingValue($bindings['$'.$parameter->name]);

continue;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@
use Symfony\Component\DependencyInjection\Exception\InvalidArgumentException;
use Symfony\Component\DependencyInjection\Loader\Configurator\DefaultsConfigurator;
use Symfony\Component\DependencyInjection\Loader\Configurator\InstanceofConfigurator;
use Symfony\Component\DependencyInjection\Loader\Configurator\ServicesConfigurator;
use Symfony\Component\DependencyInjection\Reference;

trait BindTrait
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -359,7 +359,7 @@ private function parseDefinition(\DOMElement $service, $file, array $defaults)
continue;
}

if (false !== strpos($name, '-') && false === strpos($name, '_') && !array_key_exists($normalizedName = str_replace('-', '_', $name), $parameters)) {
if (false !== strpos($name, '-') && false === strpos($name, '_') && !\array_key_exists($normalizedName = str_replace('-', '_', $name), $parameters)) {
$parameters[$normalizedName] = XmlUtils::phpize($node->nodeValue);
}
// keep not normalized key
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -203,7 +203,7 @@ private function parseDefinitions(array $content, string $file)
throw new InvalidArgumentException(sprintf('The "services" key should contain an array in %s. Check your YAML syntax.', $file));
}

if (array_key_exists('_instanceof', $content['services'])) {
if (\array_key_exists('_instanceof', $content['services'])) {
$instanceof = $content['services']['_instanceof'];
unset($content['services']['_instanceof']);

Expand Down Expand Up @@ -235,7 +235,7 @@ private function parseDefinitions(array $content, string $file)
*/
private function parseDefaults(array &$content, string $file): array
{
if (!array_key_exists('_defaults', $content['services'])) {
if (!\array_key_exists('_defaults', $content['services'])) {
return [];
}
$defaults = $content['services']['_defaults'];
Expand Down Expand Up @@ -344,7 +344,7 @@ private function parseDefinition($id, $service, $file, array $defaults)

if (isset($service['alias'])) {
$this->container->setAlias($id, $alias = new Alias($service['alias']));
if (array_key_exists('public', $service)) {
if (\array_key_exists('public', $service)) {
$alias->setPublic($service['public']);
} elseif (isset($defaults['public'])) {
$alias->setPublic($defaults['public']);
Expand Down Expand Up @@ -432,7 +432,7 @@ private function parseDefinition($id, $service, $file, array $defaults)
$definition->setAbstract($service['abstract']);
}

if (array_key_exists('deprecated', $service)) {
if (\array_key_exists('deprecated', $service)) {
$definition->setDeprecated(true, $service['deprecated']);
}

Expand Down Expand Up @@ -553,11 +553,11 @@ private function parseDefinition($id, $service, $file, array $defaults)
}
}

if (array_key_exists('namespace', $service) && !array_key_exists('resource', $service)) {
if (\array_key_exists('namespace', $service) && !\array_key_exists('resource', $service)) {
throw new InvalidArgumentException(sprintf('A "resource" attribute must be set when the "namespace" attribute is set for service "%s" in %s. Check your YAML syntax.', $id, $file));
}

if (array_key_exists('resource', $service)) {
if (\array_key_exists('resource', $service)) {
if (!\is_string($service['resource'])) {
throw new InvalidArgumentException(sprintf('A "resource" attribute must be of type string for service "%s" in %s. Check your YAML syntax.', $id, $file));
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@
namespace Symfony\Component\HttpKernel\DependencyInjection;

use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
use Symfony\Component\DependencyInjection\Argument\BoundArgument;
use Symfony\Component\DependencyInjection\ChildDefinition;
use Symfony\Component\DependencyInjection\Compiler\CompilerPassInterface;
use Symfony\Component\DependencyInjection\Compiler\ServiceLocatorTagPass;
Expand Down

0 comments on commit 7fa6256

Please sign in to comment.