Skip to content
This repository has been archived by the owner on Jan 15, 2023. It is now read-only.

This library is implementation of Plumbok (PHP version of lombok) as Symfony bundle

License

Notifications You must be signed in to change notification settings

MJKruszewski/plumbok-bundle

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Plumbok bundle

This library is implementation of Plumbok (PHP version of lombok) as Symfony bundle

Library allows to use java like annotations which will allow user to provide more readable and cleaner code.

Requirements:

  • PHP 7.1
  • Symfony 4.0 <

Installation

composer require mjkruszewski/plumbok-bundle

Create config in Symfony:

%Symfony.Project.Path%/config/packages/plumbok.yaml

Add entries to it as:

plumbok:
    dir: '%kernel.cache_dir%/plumbok'
    namespaces: [
      'App\Entity',
      'App\Exceptions',
      'App\Controller\Dto'
      ]

Change configuration for doctrine entries:

doctrine:
    orm:
        auto_generate_proxy_classes: true
        naming_strategy: doctrine.orm.naming_strategy.underscore
        auto_mapping: true
        mappings:
            App:
                is_bundle: false
                type: annotation
                #CHANGE BELOW PATH TO CACHE DIR
                dir: '%kernel.cache_dir%/plumbok'
                #########
                prefix: 'App\Entity'
                alias: App
  • Dir field is not required
  • Namespaces from src/* catalogue under symfony project

Project Maintainers

  • Maciej Kruszewski

Related Libraries

Annotations

  • Property Annotations

    • @ToString
    • @Getter
    • @Setter
  • Class Annotations

    • @AllArgsConstructor
    • @RequiredArgsConstructor
    • @NoArgsConstructor
    • @Data
    • @Value
    • @EqualTo