Skip to content

Commit 95cc9a0

Browse files
committed
Make validateIdentifiers a truthy experience in both Agent and Group
1 parent 3b6a473 commit 95cc9a0

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

src/Agent.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ protected function identifierError($used_identifiers) {
3434
}
3535

3636
protected function validateIdentifiers($used_identifiers) {
37-
return $used_identifiers !== 1;
37+
return $used_identifiers === 1;
3838
}
3939

4040
public function validate() {
@@ -44,7 +44,7 @@ public function validate() {
4444
$used_identifiers = $this->countIdentifiers();
4545

4646
// Checks that only one identifier is used.
47-
if ($this->validateIdentifiers($used_identifiers)) {
47+
if (!$this->validateIdentifiers($used_identifiers)) {
4848
$errors[] = new Error($this->identifierError($used_identifiers));
4949
}
5050

src/Group.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ protected function identifierError($used_identifiers) {
1515
protected function validateIdentifiers($used_identifiers) {
1616
$members = $this->getPropValue('member') ?: null;
1717
$validateIdentifiers = parent::validateIdentifiers($used_identifiers);
18-
$validateMembers = $members === null || count($members) === 0;
18+
$validateMembers = $members !== null && count($members) > 0;
1919
return $validateIdentifiers && $validateMembers;
2020
}
2121
}

0 commit comments

Comments
 (0)