infw/size

Size Object for In Framework

0.0.1.5 2017-05-20 12:33 UTC

This package is auto-updated.

Last update: 2024-10-18 08:43:07 UTC


README

Scrutinizer Code Quality Code Coverage Build Status

Size is a value object used as a dependency in various packages at "In Framework".

It can be very useful for different tasks like validations or as part of more complex objects.

Installation

composer require infw/size

Usage

<?php

use InFw\Size\BaseSizeFactory as SizeFactory;

$min = 0;
$max = 100;
$value = 55;

$factory = new SizeFactory($min, $max);

/** @var InFw\Size\SizeInterface $size */
$size = $factory->make($value);

$size->get();

/** @var \InFw\Range\RangeInterface $range */
$range = $size->getRange();