Attributes

The mapper library currently comes with a single attribute that can be used to influence mapping, but more are in the works.

#[PostMapping]

PostMapping is a class attribute that defines a function that should be called on each new object after it has been mapped.
The function has to be a public and not static.

A class can have multiple #[PostMapping] attributes, even for the same function.

#[PostMapping('uppercase')]
class User {
    public string $name;

    public function uppercase(): void
    {
        $this->name = \ucfirst($this->name);
    }
}