Skip to content
This repository has been archived by the owner on Feb 1, 2020. It is now read-only.

Latest commit

 

History

History
14 lines (12 loc) · 655 Bytes

05-Validating.md

File metadata and controls

14 lines (12 loc) · 655 Bytes

Validating

The Herrera\Version\Validator class is meant to be used indirectly through the other classes. However, you may use it to validate version information according to the Semantic Versioning specification:

  • bool isIdentifier(str $identifier) — returns true if the identifier is valid, false if not. An identifier may belong to either a pre-release version number or build metadata
  • bool isNumber(int|str $number) — returns true if the version number is valid, or false if not
  • bool isVersion(str $version) — returns true if the string is a valid version string representation, false if not