krystianzybala/free-days

This package is abandoned and no longer maintained. No replacement package was suggested.

Simple Free Days library in PHP

1.3.3 2016-08-14 11:55 UTC

This package is not auto-updated.

Last update: 2018-09-25 10:04:42 UTC


README

FreeDays A simple php library which decides whether the passed day is a day off.

  • master Build Status
  • dev-master Build Status

##Installation

Require new dev dependency using composer:

composer require  "krystianzybala/free-days"

Using Proxy

If you want to use very quickly, use the proxy


<?php 

$dateTime = new \DateTime('04-01-2016');
if(false === FreeDaysMatcher::isFreeDay($dateTime, 'polish', $error)) { 
    echo $error;  //return message "04-01-2016 is not free day. Free day will be for 2 days"
}

Using Factory


<?php

use FreeDays\Factory\SimpleFactory;

$factory = new SimpleFactory();
$assert = $factory->create();

$dateTime  = new \DateTime('01-01-2016');
$assert->check($dateTime); //return true
$assert->getError(); //null

Example usage

<?php

use FreeDays\Factory\SimpleFactory;

$factory = new SimpleFactory();
$assert = $factory->create();

$dateTime  = new \DateTime('01-01-2016');
$assert->check($dateTime, 'polish'); //return true
$assert->getError(); //null

Available free days object

  • PolishFreeDays

New FreeDays Object

If you do not find your country, you can help prepare a new object for your country or you can prepare it yourself.

More information in CONTRIBUTING.md

License

This library is distributed under the MIT license. Please see the LICENSE file.

Feedback

If you want give me feedback, contact me kontakt@kzybala.pl