2017 © Pedro Peláez
 

library temperature

Temperature ValueObject for PHP. Easy to use with implementation of Kelvin, Celsius and Fahrenheit

image

php-value-object/temperature

Temperature ValueObject for PHP. Easy to use with implementation of Kelvin, Celsius and Fahrenheit

  • Monday, February 5, 2018
  • by mhlavac
  • Repository
  • 4 Watchers
  • 1 Stars
  • 6 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 3 Versions
  • 0 % Grown

The README.md

Temperature Value Objects

Build Status Latest Stable Version License PHPStan, (*1)

This repository provides Temperature ValueObject implementation for PHP that is easy to use and easily allow your classes to depend on Temperature object instead of just float or string., (*2)

Install

You can install this package via composer, (*3)

composer require php-value-object/temperature, (*4)

Example

``` php function isItWarm(Temperature $temperature) : bool { $hot = new Celsius(23); if($temperature->gte($hot)) { return true; // t-shirt time }, (*5)

return false; // jacket time

}, (*6)

$temperature = new Kelvin(0); isItWarm($temperature); // false, (*7)


## Usage The temperature classes are supported: `Celsius`, `Fahrenheit` and `Kelvin`. It is possible to compare them via helper methods: * `eq` - equals * `gt` - greater than * `gte` - greater than or equals * `lt` - less than * `lte` - less than or equals * `compareTo` - returns -1, 0, 1 if less than, equal or greater than To introduce new temperature class simply extend Temperature. ## Licence MIT ## Contributing Any contributions are welcome ## Building & Development The easiest way how to develop is to `git clone` and run `make`

git clone git@github.com:PHPValueObject/Temperature.git temperature cd temperature make ```, (*8)

The Versions

05/02 2018

dev-master

9999999-dev

Temperature ValueObject for PHP. Easy to use with implementation of Kelvin, Celsius and Fahrenheit

  Sources   Download

MIT

The Requires

  • php >=7.0

 

The Development Requires

05/02 2018

v0.2

0.2.0.0

Temperature ValueObject for PHP. Easy to use with implementation of Kelvin, Celsius and Fahrenheit

  Sources   Download

MIT

The Requires

  • php >=7.0

 

The Development Requires

07/12 2017

v0.1

0.1.0.0

Temperature ValueObject for PHP. Easy to use with implementation of Kelvin, Celsius and Fahrenheit

  Sources   Download

MIT

The Development Requires