29/06
2015
dev-master
9999999-devDeletates methods to objects
MIT
The Development Requires
by Marcelo Jacobus
Wallogit.com
2017 © Pedro Peláez
Deletates methods to objects
Simple method delegator for PHP., (*1)
Code information:, (*2)
Package information:, (*4)
<?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
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"
}
}
Here is the issue tracker., (*7)
Only TDD code will be accepted. Please follow the PSR-2 code standard., (*8)
git checkout -b my-new-feature)git commit -am 'Add some feature')git push origin my-new-feature)phpunit --configuration tests/phpunit.xml
phpcs --standard=PSR2 lib phpcs --standard=PSR2 tests
MIT, (*9)
Deletates methods to objects
MIT