2017 © Pedro Peláez
 

library delegator

Deletates methods to objects

image

koine/delegator

Deletates methods to objects

  • Monday, June 29, 2015
  • by mjacobus
  • Repository
  • 1 Watchers
  • 0 Stars
  • 0 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 1 Versions
  • 0 % Grown

The README.md

Koine Delegator

Simple method delegator for PHP., (*1)

Code information:, (*2)

Build Status Coverage Status Code Climate Scrutinizer Code Quality, (*3)

Package information:, (*4)

Latest Stable Version Total Downloads Latest Unstable Version License Dependency Status, (*5)

Usage

<?php

class City
{
    protected $state;
    protected $name;

    public function __construct($name, $state)
    {
        $this->name = $name;
        $this->state = $state;
    }

    public function getStateName()
    {
        $delegator = new \Koine\MethodDelegator;

        $delegator->method('getName')->to($this->state);

        return $delegator->delegate();
    }
}

class State
{
    protected $name;

    public function __construct($name)
    {
        $this->name = $name;
    }

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

$state = new State('Some State');
$city  = new City('Some City', $state);

$city->getStateName(); // Some State

Installing

Via Composer

Append the lib to your requirements key in your composer.json., (*6)

{
    // composer.json
    // [..]
    require: {
        // append this line to your requirements
        "koine/delegator": "dev-master"
    }
}

Alternative install

Issues/Features proposals

Here is the issue tracker., (*7)

Contributing

Only TDD code will be accepted. Please follow the PSR-2 code standard., (*8)

  1. Fork it
  2. Create your feature branch (git checkout -b my-new-feature)
  3. Commit your changes (git commit -am 'Add some feature')
  4. Push to the branch (git push origin my-new-feature)
  5. Create new Pull Request

How to run the tests:

phpunit --configuration tests/phpunit.xml

To check the code standard run:

phpcs --standard=PSR2 lib
phpcs --standard=PSR2 tests

Lincense

MIT, (*9)

Authors

The Versions

29/06 2015

dev-master

9999999-dev

Deletates methods to objects

  Sources   Download

MIT

The Development Requires

by Marcelo Jacobus