agenciaecode / types
Common types for clean code PHP projects.
v3.0.11
2024-09-03 19:26 UTC
Requires
- php: >=8.2
- ext-intl: *
- agenciaecode/exceptions: ^1.0
- cocur/slugify: ^4.2
- ramsey/uuid: ^4.7
Requires (Dev)
- phpunit/phpunit: ^9.5
This package is auto-updated.
Last update: 2024-12-03 19:58:56 UTC
README
Requirements
- PHP ^8.1
Installation
To install this module, run the following command in your terminal:
composer require agenciaecode/types
Basic usage
$email = Email::from('email@domain.com'); echo $email->getHiddenFormat(); // Output: e***l@d********m
Common methods
Most type have at least the following common methods:
- public static function from(...$args) - public static function tryFrom(...$args) - public static function innFrom(...$args) - public static function isValid(...$args) - public function equals($value) - public function getValue(...$args) - public function __toString(...$args)
Available Types
- Address
- Arr
- Boolean
- Byte
- Centimeter
- Cnpj
- Cpf
- Domain
- Gram
- Gigabyte
- Ip
- Kilobyte
- Kilogram
- Megabyte
- Money
- Numeric
- Ounce
- Password
- Path
- PhoneNumber
- Pound
- PostalCode
- Slug
- Str
- Url
- Uuid
Coming soon
- CreditCard
- Duration
- Foot
- Hour
- Kilometer
- Meter
- Minute
- Percent
- Second
- Temperature