@@ -101,15 +101,13 @@ private function generateMethodBody(
101101 $ arrayProperties
102102 ->filter (function (Property $ property ) { return $ property ->isRequired (); })
103103 ->mapPropertyNames (function (string $ propertyName ) use ($ valueParam ) {
104- return "\count( \$this-> {$ propertyName }) === \count( \${$ valueParam }-> $ propertyName)
105- && !\array_udiff_assoc( \$this-> {$ propertyName }, \${$ valueParam }-> $ propertyName, \$compareValues) " ;
104+ return "\count( \$this-> {$ propertyName }) === \count( \${$ valueParam }-> $ propertyName) && !\array_udiff_assoc( \$this-> {$ propertyName }, \${$ valueParam }-> $ propertyName, \$compareValues) " ;
106105 }),
107106
108107 $ arrayProperties
109108 ->filter (function (Property $ property ) { return !$ property ->isRequired (); })
110109 ->mapPropertyNames (function (string $ propertyName ) use ($ valueParam ) {
111- return "\$this-> {$ propertyName } === null ? \${$ valueParam }-> $ propertyName === null
112- : (\count( \$this-> {$ propertyName }) === \count( \${$ valueParam }-> $ propertyName) && !\array_udiff_assoc( \$this-> {$ propertyName }, \${$ valueParam }-> $ propertyName, \$compareValues)) " ;
110+ return "\$this-> {$ propertyName } === null ? \${$ valueParam }-> $ propertyName === null : (\count( \$this-> {$ propertyName }) === \count( \${$ valueParam }-> $ propertyName) && !\array_udiff_assoc( \$this-> {$ propertyName }, \${$ valueParam }-> $ propertyName, \$compareValues)) " ;
113111 })
114112 );
115113
@@ -123,8 +121,7 @@ private function generateMethodBody(
123121 if (\is_array( \$value1)) {
124122 \$equal = \is_array( \$value2) && \count( \$value1) === \count( \$value2) && !\array_udiff_assoc( \$value1, \$value2, \$compareValues);
125123 } else {
126- \$equal = \$value1 === \$value2
127- || (\method_exists( \$value1, 'equals') ? \$value1->equals( \$value2) : \is_object( \$value1) && \$value1 == \$value2);
124+ \$equal = \$value1 === \$value2 || (\method_exists( \$value1, 'equals') ? \$value1->equals( \$value2) : \is_object( \$value1) && \$value1 == \$value2);
128125 }
129126 return \$equal ? 0 : 1;
130127 };
0 commit comments