Giter Site home page Giter Site logo

stdlib's Introduction

Stdlib

Build Status

Collections of useful classes and interfaces I often use in my projects.

Classes & Traits

PartialFn

Usage:

use Stdlib\Functional\PartialFn;

$mulXYZ = PartialFn::create(function($x, $y, $z) {
    return $x * $y * $z;
});

$x = $mulXYZ(2);
$xy = $x(4);
$xyz = $xy(6);

> echo $xyz;
> 48
BigDecimal

Usage:

use Stdlib\Math\BigDecimal;

$n = new BigDecimal('12345678900987654321');
$val = $n->mul(12345);

> echo $val->getValue();
> '152407406032692592592745'
Chainable

Usage:

use Stdlib\Util\Chainable;

class Person {
    private $birthday;

    public function getBirthday() {
        return $this->birthday;
    }

    public function setBirthday(\DateTime $date) {
        return $this->birthday = $date;
    }
}

$p1 = new Person();
$p2 = new Person();
$p2->setBirthday(new \DateTime('1990-02-02'));

$bd1 = Chainable::wrap($p1->getBirthday());
$bd2 = Chainable::wrap($p2->getBirthday());

> echo strval($bd1->format('Y-m-d'));
> echo strval($bd2->format('Y-m-d'));
> ''
> '1990-02-02'
CollectionUtil

Usage:

TODO
ConfigurableTrait

Usage:

TODO
Options

Usage:

TODO

Interfaces

OperandInterface
HierarchicalInterface
TreeInterface
ConfigurableInterface
IdProviderInterface
StatusProviderInterface

stdlib's People

Contributors

hanif avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.