10000 removed unneeded private methods · symfony/symfony@07cfa93 · GitHub
[go: up one dir, main page]

Skip to content

Commit 07cfa93

Browse files
committed
removed unneeded private methods
1 parent ca050f6 commit 07cfa93

File tree

1 file changed

+6
-25
lines changed

1 file changed

+6
-25
lines changed

src/Symfony/Component/Ldap/Adapter/ExtLdap/UpdateOperation.php

Lines changed: 6 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -34,8 +34,12 @@ class UpdateOperation
3434
*/
3535
public function __construct(int $operationType, string $attribute, ?array $values)
3636
{
37-
$this->assertValidOperationType($operationType);
38-
$this->assertNullValuesOnRemoveAll($operationType, $values);
37+
if (!in_array($operationType, $this->validOperationTypes, true)) {
38+
throw new UpdateOperationException(sprintf('"%s" is not a valid modification type.', $operationType));
39+
}
40+
if (LDAP_MODIFY_BATCH_REMOVE_ALL === $operationType && null !== $values) {
41+
throw new UpdateOperationException(sprintf('$values must be null for LDAP_MODIFY_BATCH_REMOVE_ALL operation, "%s" given.', gettype($values)));
42+
}
3943

4044
$this->operationType = $operationType;
4145
$this->attribute = $attribute;
@@ -50,27 +54,4 @@ public function toArray(): array
5054
'values' => $this->values,
5155
);
5256
}
53-
54-
/**
55-
* @param int $operationType
56-
*/
57-
private function assertValidOperationType(int $operationType): void
58-
{
59-
if (!in_array($operationType, $this->validOperationTypes, true)) {
60-
throw new UpdateOperationException(sprintf('"%s" is not a valid modification type.', $operationType));
61-
}
62-
}
63-
64-
/**
65-
* @param int $operationType
66-
* @param array|null $values
67-
*
68-
* @throws \Symfony\Component\Ldap\Exception\UpdateOperationException
69-
*/
70-
private function assertNullValuesOnRemoveAll(int $operationType, ?array $values): void
71-
{
72-
if (LDAP_MODIFY_BATCH_REMOVE_ALL === $operationType && null !== $values) {
73-
throw new UpdateOperationException(sprintf('$values must be null for LDAP_MODIFY_BATCH_REMOVE_ALL operation, "%s" given.', gettype($values)));
74-
}
75-
}
7657
}

0 commit comments

Comments
 (0)
0