[minor] SCA

This commit is contained in:
Vladimir Reznichenko 2018-06-21 22:10:47 +02:00 committed by Fabien Potencier
parent aa432743f5
commit afeb89fa06
5 changed files with 4 additions and 12 deletions

View File

@ -34,12 +34,12 @@ class DefaultsConfigurator extends AbstractServiceConfigurator
*/
final public function tag(string $name, array $attributes = array())
{
if (!is_string($name) || '' === $name) {
if ('' === $name) {
throw new InvalidArgumentException('The tag name in "_defaults" must be a non-empty string.');
}
foreach ($attributes as $attribute => $value) {
if (!is_scalar($value) && null !== $value) {
if (null !== $value && !is_scalar($value)) {
throw new InvalidArgumentException(sprintf('Tag "%s", attribute "%s" in "_defaults" must be of a scalar-type.', $name, $attribute));
}
}

View File

@ -28,10 +28,6 @@ class IntegerToLocalizedStringTransformer extends NumberToLocalizedStringTransfo
*/
public function __construct(?int $scale = 0, ?bool $grouping = false, int $roundingMode = self::ROUND_DOWN)
{
if (null === $roundingMode) {
$roundingMode = self::ROUND_DOWN;
}
parent::__construct(0, $grouping, $roundingMode);
}

View File

@ -29,7 +29,7 @@ final class PersistentToken implements PersistentTokenInterface
if (empty($class)) {
throw new \InvalidArgumentException('$class must not be empty.');
}
if ('' === $username || null === $username) {
if ('' === $username) {
throw new \InvalidArgumentException('$username must not be empty.');
}
if (empty($series)) {

View File

@ -37,10 +37,6 @@ class LdapUserProvider implements UserProviderInterface
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)
{
if (null === $uidKey) {
$uidKey = 'sAMAccountName';
}
$this->ldap = $ldap;
$this->baseDn = $baseDn;
$this->searchDn = $searchDn;

View File

@ -45,7 +45,7 @@ abstract class AbstractFileExtractor
private function toSplFileInfo(string $file): \SplFileInfo
{
return ($file instanceof \SplFileInfo) ? $file : new \SplFileInfo($file);
return new \SplFileInfo($file);
}
/**