$ composer require ytake/lom --dev
generate command
$ vendor/bin/lom generate [scan target dir]
use Ytake\Lom\Meta\Data;
/**
* Class DataAnnotation
* @Data
*/
class DataAnnotation
{
/**
* @var string $message
*/
protected $message;
/**
* @var string $testing
*/
protected $testing;
}
after
use Ytake\Lom\Meta\Data;
/**
* Class DataAnnotation
* @Data
*/
class DataAnnotation
{
/**
* @var string $message
*/
protected $message;
public function getMessage()
{
return $this->message;
}
public function setMessage($message)
{
$this->message = $message;
}
}
use Ytake\Lom\Meta\NoArgsConstructor;
/**
* Class DataAnnotation
* @NoArgsConstructor
*/
class DataAnnotation
{
public function __construct($message)
{
$this->message = $message;
}
}
after
use Ytake\Lom\Meta\NoArgsConstructor;
/**
* Class DataAnnotation
* @NoArgsConstructor
*/
class DataAnnotation
{
}
use Ytake\Lom\Meta\AllArgsConstructor;
/**
* Class DataAnnotation
* @AllArgsConstructor
*/
class DataAnnotation
{
protected $arg1;
protected $arg2;
}
after
use Ytake\Lom\Meta\AllArgsConstructor;
/**
* Class DataAnnotation
* @AllArgsConstructor
*/
class DataAnnotation
{
protected $arg1;
protected $arg2;
public function __construct($arg1, $arg2)
{
$this->arg1 = $arg1;
$this->arg2 = $arg2;
}
}
use Ytake\Lom\Meta\Getter;
use Ytake\Lom\Meta\Setter;
class GetterSetterAnnotation
{
/**
* @Getter @Setter
* @var string $message
*/
private $message;
/**
* @Getter @Setter
* @var string $testing
*/
private $testing;
}
/**
* Class ValueAnnotation
* @\Ytake\Lom\Meta\Value
*/
class ValueAnnotation
{
/**
* @var string $message
*/
protected $message;
/**
* @var string $testing
*/
protected $testing;
/** @var string $hello */
protected $hello;
}