2017 © Pedro PelĂĄez
 

library php-hetu

PHP Hetu validator. Hetu stands for Henkilötunnus aka Finnish Social Security Number

image

devsmo/php-hetu

PHP Hetu validator. Hetu stands for Henkilötunnus aka Finnish Social Security Number

  • Sunday, October 29, 2017
  • by devsmo
  • Repository
  • 1 Watchers
  • 1 Stars
  • 1,539 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 4 Versions
  • 41 % Grown

The README.md

php-hetu

codecov, (*1)

Finnish Social Security number validator., (*2)

This simple class validates social security numbers and provides methods for checking birthdate, age and gender based on the 'hetu'., (*3)

Requirements

  • PHP >= 8.0

Installation

The recommended way is to install the lib through Composer., (*4)

composer require devsmo/php-hetu

Or you can add this to your composer.json, (*5)

{
    "require": {
        "devsmo/php-hetu": "^1.0"
    }
}

Usage

The hetu class creates an immutable value object. You can initialize the object in two ways:, (*6)

<?php

$hetu = Devsmo\Hetu::create('041281-981T');

if ( $hetu ) {
    echo "It's valid";
}
else {
    echo "It's not valid...";
}

Or if you want to catch possible errors:, (*7)

<?php

try {
    $hetu = new Devsmo\Hetu('041281-981T');
}
catch (\InvalidArgumentException $e){
    $msg = $e->getMessage();
}

The class has three methods:, (*8)

<?php
$age = $hetu->getAge(); // 35

$date_of_birth = $hetu->getDateStr(); // 1981-12-04

$gender = $hetu->getGender(); // male

Contribution

Feel free to contribute! Just create a new issue or a new pull request., (*9)

License

This library is released under the MIT License., (*10)

The Versions

29/10 2017

dev-master

9999999-dev https://github.com/devsmo/php-hetu

PHP Hetu validator. Hetu stands for Henkilötunnus aka Finnish Social Security Number

  Sources   Download

MIT

The Requires

  • php >=5.4.0

 

29/10 2017

v1.1.0

1.1.0.0 https://github.com/devsmo/php-hetu

PHP Hetu validator. Hetu stands for Henkilötunnus aka Finnish Social Security Number

  Sources   Download

MIT

The Requires

  • php >=5.4.0

 

21/10 2017

v1.0.0

1.0.0.0 https://github.com/devsmo/php-hetu

PHP Hetu validator. Hetu stands for Henkilötunnus aka Finnish Social Security Number

  Sources   Download

MIT

The Requires

  • php >=5.4.0

 

21/10 2017

v1.0

1.0.0.0 https://github.com/devsmo/php-hetu

PHP Hetu validator. Hetu stands for Henkilötunnus aka Finnish Social Security Number

  Sources   Download

MIT

The Requires

  • php >=5.4.0