20
20
21
21
/**
22
22
* Class Matcher contains methods required by interface for external access,
23
- * but also contains methods useful for matching strategies.
23
+ * but also contains methods useful for matching strategies.
24
24
*/
25
25
class Matcher implements MatcherInterface
26
26
{
27
27
/**
28
28
* @param PropertyMatchingStrategy[]|class-string<PropertyMatchingStrategy>[] $propertyMatchingStrategies
29
- * @param ClassMatchingStrategy[]|class-string<ClassMatchingStrategy>[] $classMatchingStrategies
29
+ * @param ClassMatchingStrategy[]|class-string<ClassMatchingStrategy>[] $classMatchingStrategies
30
30
*/
31
31
public function __construct (
32
32
/** @var PropertyMatchingStrategy[] */
@@ -76,10 +76,10 @@ public function matchProperties(
76
76
foreach ($ this ->propertyMatchingStrategies as $ strategy ) {
77
77
if ($ strategy ->isStrategyConditionsMet ($ context , $ process , $ origin , $ sourceProperty , $ targetProperty )) {
78
78
$ strategy ->matchProperties ($ context , $ process , $ origin , $ sourceProperty , $ targetProperty );
79
- $ requiredMatches -- ;
79
+ -- $ requiredMatches ;
80
80
}
81
81
82
- if ($ requiredMatches === 0 ) {
82
+ if (0 === $ requiredMatches ) {
83
83
return true ;
84
84
}
85
85
}
@@ -100,13 +100,13 @@ public function matchClassBlueprintsBasedOnProperty(
100
100
PropertyBlueprint $ target
101
101
): void {
102
102
$ originClasses = $ origin ->type ->getAllClassTypes ();
103
- /** @var ClassBlueprint[] $originClasses */
103
+ /* @var ClassBlueprint[] $originClasses */
104
104
array_walk ($ originClasses , fn (string $ originClass ): ClassBlueprint => Blueprint::getBlueprint ($ origin )->blueprints [$ originClass ]);
105
105
$ sourceClasses = $ source ->type ->getAllClassTypes ();
106
- /** @var ClassBlueprint[] $sourceClasses */
106
+ /* @var ClassBlueprint[] $sourceClasses */
107
107
array_walk ($ sourceClasses , fn (string $ sourceClass ): ClassBlueprint => Blueprint::getBlueprint ($ origin )->blueprints [$ sourceClass ]);
108
108
$ targetClasses = $ target ->type ->getAllClassTypes ();
109
- /** @var ClassBlueprint[] $targetClasses */
109
+ /* @var ClassBlueprint[] $targetClasses */
110
110
array_walk ($ targetClasses , fn (string $ targetClass ): ClassBlueprint => Blueprint::getBlueprint ($ origin )->blueprints [$ targetClass ]);
111
111
112
112
foreach ($ originClasses as $ originClass ) {
@@ -136,13 +136,13 @@ public function matchClassBlueprints(
136
136
$ matchedProperties = 0 ;
137
137
foreach ($ origin ->properties as $ index => $ property ) {
138
138
if ($ this ->isPropertyIgnored ($ context , $ process , $ property )) {
139
- $ totalProperties -- ;
139
+ -- $ totalProperties ;
140
140
unset($ origin ->properties [$ index ]);
141
141
continue ;
142
142
}
143
143
144
144
if ($ this ->matchProperties ($ context , $ process , $ property , $ source , $ target )) {
145
- $ matchedProperties ++ ;
145
+ ++ $ matchedProperties ;
146
146
}
147
147
}
148
148
@@ -183,8 +183,8 @@ function (object $object) use ($origin, $source, $target) {
183
183
/**
184
184
* Method checks if the property should be ignored.
185
185
* Only origin property should be checked.
186
- *
187
- * @return bool Success if the property should be ignored.
186
+ *
187
+ * @return bool success if the property should be ignored
188
188
*/
189
189
protected function isPropertyIgnored (Context $ context , Process $ process , PropertyBlueprint $ origin ): bool
190
190
{
0 commit comments