minor #13431 [Form] Improved exception message if the data class is not found (fabpot)
This PR was merged into the 2.3 branch.
Discussion
----------
[Form] Improved exception message if the data class is not found
| Q | A
| ------------- | ---
| Bug fix? | no
| New feature? | no
| BC breaks? | no
| Deprecations? | no
| Tests pass? | yes
| Fixed tickets | #12359, #12367
| License | MIT
| Doc PR | -
Commits
-------
4145836
[Form] Improved exception message if the data class is not found
This commit is contained in:
commit
ec1cae8b14
@ -193,7 +193,7 @@ class FormConfigBuilder implements FormConfigBuilderInterface
|
|||||||
self::validateName($name);
|
self::validateName($name);
|
||||||
|
|
||||||
if (null !== $dataClass && !class_exists($dataClass)) {
|
if (null !== $dataClass && !class_exists($dataClass)) {
|
||||||
throw new InvalidArgumentException(sprintf('The data class "%s" is not a valid class.', $dataClass));
|
throw new InvalidArgumentException(sprintf('Class "%s" not found. Is the "data_class" form option set correctly?', $dataClass));
|
||||||
}
|
}
|
||||||
|
|
||||||
$this->name = (string) $name;
|
$this->name = (string) $name;
|
||||||
|
Reference in New Issue
Block a user