germania-kg / opening-hours
Interfaces and implementation for Opening Hours and Times
1.1.5
2022-06-28 11:30 UTC
Requires
- php: ^7.2|^8.0
Requires (Dev)
- friendsofphp/php-cs-fixer: ^2.12
- php-coveralls/php-coveralls: ^2.0
- phpunit/phpunit: ^7.0|^8.0
- spatie/phpunit-watcher: ^1.8
README
Germania KG ยท Opening Hours
Installation with Composer
$ composer require germania-kg/opening-hours
Usage
OpeningTimesInterface
interface Germania\OpeningTimes\OpeningTimesInterface // Textual description regarding the opening times public function getDescription() : ?string; public function setDescription( string $text = null); // Set information for certain days public function getDay( string $day ) : ?string; public function setDay( string $day, string $times = null ); // Common day interceptors, getter and setter public function getMonday() : ?string; public function getTuesday() : ?string; public function getWednesday() : ?string; public function getThursday() : ?string; public function getFriday() : ?string; public function getSaturday() : ?string; public function getSunday() : ?string;
Class OpeningTimes
use Germania\OpeningTimes\OpeningTimes; $open = new OpeningTimes; $open->setDescription("nach Vereinbarung"); $open->getDescription(); // "nach Vereinbarung" $open->setDay("monday", "09 to 18"); $open->getDay("monday"); // "09 to 18" $open->getMonday(); // null echo $open->setMonday("whole day")->getMonday(); // "whole day" // and also these Setters: // - setMonday() // - setTuesday() // - setWednesday() // - setThursday() // - setFriday() // - setSaturday() // - setSunday()
Issues
Roadmap
Fill in planned or desired features
Development
$ git clone https://github.com/GermaniaKG/OpeningTimes.git
$ cd OpeningTimes
$ composer install
Unit tests
Either copy phpunit.xml.dist
to phpunit.xml
and adapt to your needs, or leave as is. Run PhpUnit test or composer scripts like this:
$ composer test # or $ vendor/bin/phpunit