Coder Social home page Coder Social logo

id's People

Contributors

hanneskod avatar jongotlin avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

id's Issues

Throw exception when using unvalid dates

Unvalid dates are automatically transform by DateTime. We should throw an Exception instead.

$id = new PersonalId('001301-0004');
echo $id->format('ymd');
// prints 010101
// should throw exception since 13 is not a valid month

Make id parser smarter

The following formats should be supported

  • DDDDDD-NNNN
  • DDDDDD+NNNN
  • DDDDDDDD-NNNN
  • DDDDDDDD+NNNN
  • DDDDDDNNNN
  • DDDDDDDDNNNN

Should work for all id-types.

Version 2.0

2018 will see ver 2.0. Here is the todo list

  • remov deprecated classes and metods
  • require php 7 and use scalar type declarations and return type declarations
  • DateTimeInterface instead of DateTime
  • phpunit 6 7
  • constant array expressions instead of private static..
  • BirthCountyInterface, LegalFormInterface...

Let PersonalId::getSex() return constant

This should be possible

if ($id->getSex() == PersonalId::SEX_MALE) ...

And this

$id->isMale()
$id->isFemale()
$id->isThridSex()

To bc define constants as

const SEX_MALE = 'M';
const SEX_FEMALE = 'F';
const SEX_OTHER = 'O';

Century parsing error

$f = new iio\stb\ID\FakeId('450415-xxxx');
echo $f->getDate()->format('Ymd');
// prints 20450415, should be 19450415

Add a format() method to IdInterface

Should support the DateTime->format syntax for formatting the date part.
Should work with all id types, including corporate and coordination.
Should add formatting options for delimiter, checkdigit and so forth.
Should support adding non-formatting characters to format, such as filling 0's or spaces.
See ledgr/autogiro/Builder/ConsentBuilder for use cases.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.