NelmioApiDocBundle/ModelDescriber
Nicolas 27e6599b1a Add a check for Constraint class existing before using it
*Context*: NelmioApiDocBundle does not require clients to have the symfony/validator package. However it requires it in its dev dependencies.

*Problem*: If client of library does not have symfony/validator and uses PHP8, NelmioApiDocBundle will assume that symfony/validator is installed, in `SymfonyConstraintAnnotationReader.php`

*Solution*: We should not assume that client has symfony/validator. So before reading attributes of this class, we now try to see if class exists. 
- Tests still run.
- Tested in a project without symfony/validator and requiring this version, it now works.

The error before this fix was : 
Exception: `ClassNotFound`
Message for me: `Attempted to load class "Constraint" from namespace "Symfony\Component\Validator".
Did you forget a "use" statement for e.g. "JsonSchema\Constraints\Constraint" or "Doctrine\DBAL\Schema\Constraint"?`
2021-06-14 13:24:45 +02:00
..
Annotations Add a check for Constraint class existing before using it 2021-06-14 13:24:45 +02:00
BazingaHateoasModelDescriber.php Apply fixes from StyleCI 2020-02-23 16:50:24 +00:00
FallbackObjectModelDescriber.php Allow model describers on jms custom types (#1495) 2019-04-16 12:13:33 +02:00
FormModelDescriber.php Allow to not document form types fields (#1752) 2020-12-02 15:38:38 +01:00
JMSModelDescriber.php Fix the JMSModelDescriber 2020-09-09 08:38:25 +02:00
ModelDescriberInterface.php Add return types 2017-03-17 19:37:51 +01:00
ObjectModelDescriber.php Fix exposure of private/protected methods 2020-12-16 23:46:29 +01:00