Skip to content

Commit d899ce9

Browse files
committed
Merge branch '3.4' into 4.4
* 3.4: Fix CS
2 parents 61ad1ae + fbe6408 commit d899ce9

File tree

3 files changed

+13
-13
lines changed

3 files changed

+13
-13
lines changed

Constraint.php

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ abstract class Constraint
7070
public static function getErrorName($errorCode)
7171
{
7272
if (!isset(static::$errorNames[$errorCode])) {
73-
throw new InvalidArgumentException(sprintf('The error code "%s" does not exist for constraint of type "%s".', $errorCode, \get_called_class()));
73+
throw new InvalidArgumentException(sprintf('The error code "%s" does not exist for constraint of type "%s".', $errorCode, static::class));
7474
}
7575

7676
return static::$errorNames[$errorCode];
@@ -115,7 +115,7 @@ public function __construct($options = null)
115115

116116
if (\is_array($options) && isset($options['value']) && !property_exists($this, 'value')) {
117117
if (null === $defaultOption) {
118-
throw new ConstraintDefinitionException(sprintf('No default option is configured for constraint "%s".', \get_class($this)));
118+
throw new ConstraintDefinitionException(sprintf('No default option is configured for constraint "%s".', static::class));
119119
}
120120

121121
$options[$defaultOption] = $options['value'];
@@ -136,7 +136,7 @@ public function __construct($options = null)
136136
}
137137
} elseif (null !== $options && !(\is_array($options) && 0 === \count($options))) {
138138
if (null === $defaultOption) {
139-
throw new ConstraintDefinitionException(sprintf('No default option is configured for constraint "%s".', \get_class($this)));
139+
throw new ConstraintDefinitionException(sprintf('No default option is configured for constraint "%s".', static::class));
140140
}
141141

142142
if (\array_key_exists($defaultOption, $knownOptions)) {
@@ -148,11 +148,11 @@ public function __construct($options = null)
148148
}
149149

150150
if (\count($invalidOptions) > 0) {
151-
throw new InvalidOptionsException(sprintf('The options "%s" do not exist in constraint "%s".', implode('", "', $invalidOptions), \get_class($this)), $invalidOptions);
151+
throw new InvalidOptionsException(sprintf('The options "%s" do not exist in constraint "%s".', implode('", "', $invalidOptions), static::class), $invalidOptions);
152152
}
153153

154154
if (\count($missingOptions) > 0) {
155-
throw new MissingOptionsException(sprintf('The options "%s" must be set for constraint "%s".', implode('", "', array_keys($missingOptions)), \get_class($this)), array_keys($missingOptions));
155+
throw new MissingOptionsException(sprintf('The options "%s" must be set for constraint "%s".', implode('", "', array_keys($missingOptions)), static::class), array_keys($missingOptions));
156156
}
157157
}
158158

@@ -176,7 +176,7 @@ public function __set($option, $value)
176176
return;
177177
}
178178

179-
throw new InvalidOptionsException(sprintf('The option "%s" does not exist in constraint "%s".', $option, \get_class($this)), [$option]);
179+
throw new InvalidOptionsException(sprintf('The option "%s" does not exist in constraint "%s".', $option, static::class), [$option]);
180180
}
181181

182182
/**
@@ -202,7 +202,7 @@ public function __get($option)
202202
return $this->groups;
203203
}
204204

205-
throw new InvalidOptionsException(sprintf('The option "%s" does not exist in constraint "%s".', $option, \get_class($this)), [$option]);
205+
throw new InvalidOptionsException(sprintf('The option "%s" does not exist in constraint "%s".', $option, static::class), [$option]);
206206
}
207207

208208
/**
@@ -266,7 +266,7 @@ public function getRequiredOptions()
266266
*/
267267
public function validatedBy()
268268
{
269-
return \get_class($this).'Validator';
269+
return static::class.'Validator';
270270
}
271271

272272
/**

Constraints/AbstractComparison.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,11 +39,11 @@ public function __construct($options = null)
3939

4040
if (\is_array($options)) {
4141
if (!isset($options['value']) && !isset($options['propertyPath'])) {
42-
throw new ConstraintDefinitionException(sprintf('The "%s" constraint requires either the "value" or "propertyPath" option to be set.', \get_class($this)));
42+
throw new ConstraintDefinitionException(sprintf('The "%s" constraint requires either the "value" or "propertyPath" option to be set.', static::class));
4343
}
4444

4545
if (isset($options['value']) && isset($options['propertyPath'])) {
46-
throw new ConstraintDefinitionException(sprintf('The "%s" constraint requires only one of the "value" or "propertyPath" options to be set, not both.', \get_class($this)));
46+
throw new ConstraintDefinitionException(sprintf('The "%s" constraint requires only one of the "value" or "propertyPath" options to be set, not both.', static::class));
4747
}
4848

4949
if (isset($options['propertyPath']) && !class_exists(PropertyAccess::class)) {

Constraints/Composite.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -71,11 +71,11 @@ public function __construct($options = null)
7171
$constraint = \get_class($constraint);
7272
}
7373

74-
throw new ConstraintDefinitionException(sprintf('The value %s is not an instance of Constraint in constraint %s', $constraint, \get_class($this)));
74+
throw new ConstraintDefinitionException(sprintf('The value %s is not an instance of Constraint in constraint %s', $constraint, static::class));
7575
}
7676

7777
if ($constraint instanceof Valid) {
78-
throw new ConstraintDefinitionException(sprintf('The constraint Valid cannot be nested inside constraint %s. You can only declare the Valid constraint directly on a field or method.', \get_class($this)));
78+
throw new ConstraintDefinitionException(sprintf('The constraint Valid cannot be nested inside constraint %s. You can only declare the Valid constraint directly on a field or method.', static::class));
7979
}
8080
}
8181

@@ -99,7 +99,7 @@ public function __construct($options = null)
9999
$excessGroups = array_diff($constraint->groups, $this->groups);
100100

101101
if (\count($excessGroups) > 0) {
102-
throw new ConstraintDefinitionException(sprintf('The group(s) "%s" passed to the constraint %s should also be passed to its containing constraint %s', implode('", "', $excessGroups), \get_class($constraint), \get_class($this)));
102+
throw new ConstraintDefinitionException(sprintf('The group(s) "%s" passed to the constraint %s should also be passed to its containing constraint %s', implode('", "', $excessGroups), \get_class($constraint), static::class));
103103
}
104104
} else {
105105
$constraint->groups = $this->groups;

0 commit comments

Comments
 (0)