Skip to content

soulshined/ft-attributes

Repository files navigation

A catalog of php attributes for flexible and maintainable modeling.

Attributes for logging, json, property validation and more.

Quick example of property validation:

final class MyClass {
    use PropertyValidator;

    #[Email]
    private string $email;

    #[Min(value: 12)]
    private int $age;

    #[Size(min: 1, max: 3)]
    private array $phone_numbers;
}

Quick example of json:

class MyClass {
    private int $id = 1;
    #[JsonIgnore]
    private string $ssn = "xxx-xx-xxxx";
}

Json::encode(new MyClass); // { "id" : 1 }

For complete documentation and attribute usages see the documentation wiki

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Sponsor this project

 

Packages

No packages published

Languages