public function test (string $name, int $count = null) {
doSomeWith($name);
if ($count) {...}
}
class DtoConfig {
public $name;
public $count;
public function __construct($name, $count = null) {
$this->name = $name;
$this->count = $count;
}
}
$Dto = new ConfigDto('Vasya', 100);
public function test (DtoConfig $Dto) {
doSomeWith($Dto->name);
if ($Dto->count) {...}
}
$this->test($Dto);
public function fuckedMagic(array $args)
{
$args = extract($args);
/** сношайтесь как хотите */
}