VersionRequirementResolver
in package
Reads {@see RequiresPdfVersion} and {@see DeprecatedPdfFeature} attributes from PDF object classes via reflection, with static per-class caching.
Table of Contents
Methods
- clearCache() : void
- Clear all caches (useful for testing).
- getClassRequirement() : PdfVersion|null
- Get the class-level minimum PDF version requirement, if any.
- getDeprecation() : DeprecatedPdfFeature|null
- Check if a class is marked as deprecated in the PDF specification.
- getEffectiveRequirement() : PdfVersion
- Get the effective minimum version for an object instance, considering both the class-level requirement and all non-null property-level requirements. Returns PdfVersion::V1_0 if nothing is annotated.
- stripIncompatibleProperties() : array<int, string>
- Nullify properties on an object whose version requirement exceeds the given ceiling. Returns a list of stripped property names.
Methods
clearCache()
Clear all caches (useful for testing).
public
static clearCache() : void
getClassRequirement()
Get the class-level minimum PDF version requirement, if any.
public
static getClassRequirement(string|object $class) : PdfVersion|null
Parameters
- $class : string|object
Return values
PdfVersion|nullgetDeprecation()
Check if a class is marked as deprecated in the PDF specification.
public
static getDeprecation(string|object $class) : DeprecatedPdfFeature|null
Parameters
- $class : string|object
Return values
DeprecatedPdfFeature|nullgetEffectiveRequirement()
Get the effective minimum version for an object instance, considering both the class-level requirement and all non-null property-level requirements. Returns PdfVersion::V1_0 if nothing is annotated.
public
static getEffectiveRequirement(object $object) : PdfVersion
Parameters
- $object : object
Return values
PdfVersionstripIncompatibleProperties()
Nullify properties on an object whose version requirement exceeds the given ceiling. Returns a list of stripped property names.
public
static stripIncompatibleProperties(object $object, PdfVersion $ceiling) : array<int, string>
Only strips property-level requirements — class-level incompatibility must be handled by the caller (the object itself cannot be stripped).
Parameters
- $object : object
- $ceiling : PdfVersion