File tree Expand file tree Collapse file tree 2 files changed +7
-6
lines changed
Expand file tree Collapse file tree 2 files changed +7
-6
lines changed Original file line number Diff line number Diff line change @@ -34,17 +34,18 @@ 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 () {
4141 $ errors = $ this ->validateTypedElement ();
4242
4343 // Gets the used identifiers.
4444 $ used_identifiers = $ this ->countIdentifiers ();
45+ $ hasOneIdent = $ this ->validateIdentifiers ($ used_identifiers );
4546
4647 // Checks that only one identifier is used.
47- if ($ this -> validateIdentifiers ( $ used_identifiers ) ) {
48+ if (! $ hasOneIdent ) {
4849 $ errors [] = new Error ($ this ->identifierError ($ used_identifiers ));
4950 }
5051
Original file line number Diff line number Diff line change @@ -13,9 +13,9 @@ protected function identifierError($used_identifiers) {
1313 }
1414
1515 protected function validateIdentifiers ($ used_identifiers ) {
16- $ members = $ this ->getPropValue ('member ' ) ?: null ;
17- $ validateIdentifiers = parent ::validateIdentifiers ($ used_identifiers );
18- $ validateMembers = $ members === null || count ($ members ) === 0 ;
19- return $ validateIdentifiers && $ validateMembers ;
16+ $ members = $ this ->getPropValue ('member ' );
17+ $ hasOneIdent = parent ::validateIdentifiers ($ used_identifiers );
18+ $ hasMembers = ! is_null ( $ members) && count ($ members ) > 0 ;
19+ return $ hasOneIdent || (! $ hasOneIdent && $ hasMembers ) ;
2020 }
2121}
You can’t perform that action at this time.
0 commit comments