germania-kg/opening-hours

Interfaces and implementation for Opening Hours and Times

1.1.5 2022-06-28 11:30 UTC

This package is auto-updated.

Last update: 2024-03-28 15:35:26 UTC


README

68747470733a2f2f7374617469632e6765726d616e69612d6b672e636f6d2f6c6f676f732f67612d6c6f676f2d323031362d7765622e7376677a

Germania KG · Opening Hours

Packagist PHP version Build Status Scrutinizer Code Quality Code Coverage Build Status

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

See full issues list.

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