Skip to content
This repository has been archived by the owner on Mar 10, 2021. It is now read-only.
/ common-types Public archive

[Deprecated] Use "mediagone/types-common" instead.

License

Notifications You must be signed in to change notification settings

Mediagone/common-types

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

25 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Common Types

Latest Version on Packagist Total Downloads Software License

Value Objects are small and immutable classes representing typed values usually implemented using PHP primitive types. However, objects can embed validation to ensure that your data is always valid without adding any check elsewhere in your code.

That's why you should ALWAYS use Value Objects rather than primitive types.

Installation

This package requires PHP 7.4+

Add it as Composer dependency:

$ composer require mediagone/common-types

List of available Value Objects

All value objects implement a common ValueObject interface and JsonSerializable.

Crypto

  • Hash (abstract class)
  • HashBcrypt
  • HashArgon2id

System

  • Age
  • Count
  • Country
  • Date
  • DateTimeUTC
  • Duration

Text

  • Hex
  • Name
  • Slug
  • Text
  • TextMedium
  • Title

Web

  • EmailAddress
  • Url
  • UrlHost
  • UrlPath

License

Common Types is licensed under MIT license. See LICENSE file.

About

[Deprecated] Use "mediagone/types-common" instead.

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages