jtrw/utils

1.0.0 2021-02-05 15:16 UTC

This package is auto-updated.

Last update: 2024-11-10 13:39:37 UTC


README

Phpunit

Utils for help Dev

Structure Utils

  • ValuesObject

Install

Via Composer

$ composer require jtrw/utils

Usage ValuesObject

use Jtrw\Utils\ValuesObject;

class UserValuesObject extends ValuesObject
{
    public function getID()
    {
        return $this->get('id');
    }

    public function getName()
    {
        return $this->get('name');
    }
}

$user = [
    'id'   => 1,
    'name' => 'Test User'
];

$userValuesObject = new UserValuesObject($user);

echo $userValuesObject->getName();

Change log

Please see CHANGELOG for more information on what has changed recently.

Testing

$ composer test