2017 © Pedro Peláez
 

library lom

lombok style code generator for php

image

ytake/lom

lombok style code generator for php

  • Saturday, May 5, 2018
  • by ytake
  • Repository
  • 2 Watchers
  • 1 Stars
  • 1 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 2 Forks
  • 0 Open issues
  • 4 Versions
  • 0 % Grown

The README.md

Lom

for php code generator, (*1)

Build Status Scrutinizer Code Quality StyleCI Coverage Status, (*2)

install

$ composer require ytake/lom --dev  

usage

generate command, (*3)

$ vendor/bin/lom generate [scan target dir] 

feature

@Data Annotation


use Ytake\Lom\Meta\Data; /** * Class DataAnnotation * @Data */ class DataAnnotation { /** * @var string $message */ protected $message; /** * @var string $testing */ protected $testing; }

after, (*4)


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; } }

@NoArgsConstructor Annotation


use Ytake\Lom\Meta\NoArgsConstructor; /** * Class DataAnnotation * @NoArgsConstructor */ class DataAnnotation { public function __construct($message) { $this->message = $message; } }

after, (*5)


use Ytake\Lom\Meta\NoArgsConstructor; /** * Class DataAnnotation * @NoArgsConstructor */ class DataAnnotation { }

@AllArgsConstructor Annotation


use Ytake\Lom\Meta\AllArgsConstructor; /** * Class DataAnnotation * @AllArgsConstructor */ class DataAnnotation { protected $arg1; protected $arg2; }

after, (*6)


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; } }

@Getter/@Setter Annotation

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;
}

@Value Annotation

/**
 * Class ValueAnnotation
 * @\Ytake\Lom\Meta\Value
 */
class ValueAnnotation
{
    /**
     * @var string $message
     */
    protected $message;

    /**
     * @var string $testing
     */
    protected $testing;

    /** @var string $hello */
    protected $hello;
}

The Versions