CodeExplorer Property example
$this->implements
[] = '\\'.
ltrim($interface, '\\'
);
} public function addMethod(string
$name, string
$body, array
$params =
[]): void
{ $this->methods
[] =
new Method(strtr($body,
['NAME' =>
$this->
camelCase($name)] +
$params));
} public function addProperty(string
$name, string
$classType = null, string
$defaultValue = null
): Property
{ $property =
new Property($name, '_' !==
$name[0
] ?
$this->
camelCase($name) :
$name);
if (null !==
$classType) { $property->
setType($classType);
} $this->properties
[] =
$property;
$defaultValue = null !==
$defaultValue ?
sprintf(' = %s',
$defaultValue) : '';
$property->
setContent(sprintf('private $%s%s;',
$property->
getName(),
$defaultValue));
return $property;
} public function getProperties(): array
{