CONTEXT.md and .claude/REVIEW_PROMPT.md state that a public DTO property may only be a scalar (int, string, bool) or an array, with two exceptions, DecimalNumber and DateTimeImmutable.
The CI-enforced rule allows more than that. tests/PHPStan/ApiResourcePropertyTypeRule.php:
private const ALLOWED_SCALAR_TYPES = ['bool', 'int', 'string', 'array'];
private const ALLOWED_CLASS_SHORT_NAMES = ['DecimalNumber', 'DateTimeImmutable', 'File'];
private const ALLOWED_CLASS_FQCNS = [
'PrestaShop\Decimal\DecimalNumber',
'DateTimeImmutable',
...
'PrestaShop\PrestaShop\Core\Util\DateTime\DateImmutable',
];
So Symfony\Component\HttpFoundation\File\File and Core\Util\DateTime\DateImmutable are both accepted by the rule and both missing from the documentation.
Why it is worth fixing
The documentation is what the automated pre-review reads. On #422, which needs ?File properties for a multipart upload, it produced a hard blocker against a resource that the rule accepts and whose CI is green. Every future multipart endpoint will hit the same false positive, and a contributor who trusts the report will rewrite working code.
Suggested fix
Bring both documents in line with the rule, and say what each exception is for:
DecimalNumber, mandatory instead of float
DateTimeImmutable and Core\Util\DateTime\DateImmutable for date and datetime properties
File for multipart upload properties, which are normally paired with #[ApiProperty(readable: false)] so they stay out of responses
Since the rule is the thing CI enforces, it may be worth having the documentation point at ALLOWED_CLASS_SHORT_NAMES explicitly so the two cannot drift again.
CONTEXT.mdand.claude/REVIEW_PROMPT.mdstate that a public DTO property may only be a scalar (int,string,bool) or anarray, with two exceptions,DecimalNumberandDateTimeImmutable.The CI-enforced rule allows more than that.
tests/PHPStan/ApiResourcePropertyTypeRule.php:So
Symfony\Component\HttpFoundation\File\FileandCore\Util\DateTime\DateImmutableare both accepted by the rule and both missing from the documentation.Why it is worth fixing
The documentation is what the automated pre-review reads. On #422, which needs
?Fileproperties for a multipart upload, it produced a hard blocker against a resource that the rule accepts and whose CI is green. Every future multipart endpoint will hit the same false positive, and a contributor who trusts the report will rewrite working code.Suggested fix
Bring both documents in line with the rule, and say what each exception is for:
DecimalNumber, mandatory instead offloatDateTimeImmutableandCore\Util\DateTime\DateImmutablefor date and datetime propertiesFilefor multipart upload properties, which are normally paired with#[ApiProperty(readable: false)]so they stay out of responsesSince the rule is the thing CI enforces, it may be worth having the documentation point at
ALLOWED_CLASS_SHORT_NAMESexplicitly so the two cannot drift again.