NelmioApiDocBundle
                                
                                 NelmioApiDocBundle copied to clipboard
                                
                                    NelmioApiDocBundle copied to clipboard
                            
                            
                            
                        [Bug]: The PropertyInfo component was not able to guess the type of Company::$edAt. You may need to add a `@var` annotation or use `@OA\Property(type="")` to make its type explicit
Version
4.26
Description
Whenever I document a property that has a getter method with the word "ADD" in its name, the bundle fails with the following error:
The PropertyInfo component was not able to guess the type of Company::$edAt. You may need to add a `@var` annotation or use `@OA\Property(type="")` to make its type explicit
In this error, the property addedAt has a getter method with the same name addedAt(), and the bundle parses or interprets the ADD part, and only reads the rest (in this case edAt).
Company class
#[Schema(properties: [
    new Property(property: 'id', type: 'string', example: '8a8f8e8e-8e8e-8e8e-8e8e-8e8e8e8e8e8e'),
    new Property(property: 'name', type: 'string', example: 'Agency Name'),
    new Property(property: 'addedAt', type: 'integer', example: 1631610000),
])]
class Company
{
          public function addedAt(): int
          {
                  return $this->addedAt;
          }
Company Controller
class CompanyController extends SymfonyController
{
    #[Get(description: 'Get company details', summary: 'Get company details')]
    #[Response(content: new JsonContent(properties: [
        new Property(property: 'data', ref: new Model(type: Company::class))
    ]))]
    public function index()
    {
Additional context
Check this reproducible repository, and you can see it yourself.
https://github.com/tomasvts/nelmioApiDocBundleBug
Note: If I change the name of the getter to getAddedAt(), the problem goes away, which is the temporary solution I'm using. Nevertheless, I believe I have the right to name my getters the way I want.
The problem is in the (symfony/property-info) ReflecionExtractor class. It assumes that if a method has an "add" at the start, is a mutator, thus it should be stripped the word add:
https://github.com/symfony/property-info/blob/7.0/Extractor/ReflectionExtractor.php#L658
Then
For us this break with Symfony 7.1, it's a blocker to upgrade.
This issue has been marked as stale because it has not had any activity for 60 days. Remove stale label or comment to prevent this from being closed in 21 days.
It seems that this isn't any issue anymore (on 5.x atleast).
I created https://github.com/nelmio/NelmioApiDocBundle/pull/2466 to ensure that your issue will be caught in the CI if this issue would every be re-introduced.