for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
namespace Bavix\Tests;
abstract class Bind
{
/**
* @param object $object
* @param string $attr
*
* @return mixed
*/
public static function getProperty($object, $attr)
$closure = \Closure::bind(function () use ($attr) {
return $this->$attr;
$this
}, $object, \get_class($object));
return $closure();
}
* @param mixed $value
public static function setProperty($object, $attr, $value)
$closure = \Closure::bind(function ($value) use ($attr) {
$this->$attr = $value;
return $closure($value);