8000 [minor] SCA · symfony/symfony@afeb89f · GitHub
[go: up one dir, main page]

Skip to content

Commit afeb89f

Browse files
kalessilfabpot
authored andcommitted
[minor] SCA
1 parent aa43274 commit afeb89f

File tree

5 files changed

+4
-12
lines changed

5 files changed

+4
-12
lines changed

src/Symfony/Component/DependencyInjection/Loader/Configurator/DefaultsConfigurator.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,12 +34,12 @@ class DefaultsConfigurator extends AbstractServiceConfigurator
3434
*/
3535
final public function tag(string $name, array $attributes = array())
3636
{
37-
if (!is_string($name) || '' === $name) {
37+
if ('' === $name) {
3838
throw new InvalidArgumentException('The tag name in "_defaults" must be a non-empty string.');
3939
}
4040

4141
foreach ($attributes as $attribute => $value) {
42-
if (!is_scalar($value) && null !== $value) {
42+
if (null !== $value && !is_scalar($value)) {
4343
throw new InvalidArgumentException(sprintf('Tag "%s", attribute "%s" in "_defaults" must be of a scalar-type.', $name, $attribute));
4444
}
4545
}

src/Symfony/Component/Form/Extension/Core/DataTransformer/IntegerToLocalizedStringTransformer.php

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -28,10 +28,6 @@ class IntegerToLocalizedStringTransformer extends NumberToLocalizedStringTransfo
2828
*/
2929
public function __construct(?int $scale = 0, ?bool $grouping = false, int $roundingMode = self::ROUND_DOWN)
3030
{
31-
if (null === $roundingMode) {
32-
$roundingMode = self::ROUND_DOWN;
33-
}
34-
3531
parent::__construct(0, $grouping, $roundingMode);
3632
}
3733

src/Symfony/Component/Security/Core/Authentication/RememberMe/PersistentToken.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ public function __construct(string $class, string $username, string $series, str
2929
if (empty($class)) {
3030
throw new \InvalidArgumentException('$class must not be empty.');
3131
}
32-
if ('' === $username || null === $username) {
32+
if ('' === $username) {
3333
throw new \InvalidArgumentException('$username must not be empty.');
3434
}
3535
if (empty($series)) {

src/Symfony/Component/Security/Core/User/LdapUserProvider.php

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -37,10 +37,6 @@ class LdapUserProvider implements UserProviderInterface
3737

3838
public function __construct(LdapInterface $ldap, string $baseDn, string $searchDn = null, string $searchPassword = null, array $defaultRoles = array(), string $uidKey = 'sAMAccountName', string $filter = '({uid_key}={username})', string $passwordAttribute = null)
3939
{
40-
if (null === $uidKey) {
41-
$uidKey = 'sAMAccountName';
42-
}
43-
4440
$this->ldap = $ldap;
4541
$this->baseDn = $baseDn;
4642
$this->searchDn = $searchDn;

src/Symfony/Component/Translation/Extractor/AbstractFileExtractor.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ protected function extractFiles($resource)
4545

4646
private function toSplFileInfo(string $file): \SplFileInfo
4747
{
48-
return ($file instanceof \SplFileInfo) ? $file : new \SplFileInfo($file);
48+
return new \SplFileInfo($file);
4949
}
5050

5151
/**

0 commit comments

Comments
 (0)
0