2017 © Pedro Peláez
 

library lombok-like

image

k-hei/lombok-like

  • Sunday, April 1, 2018
  • by Khwesten
  • Repository
  • 2 Watchers
  • 2 Stars
  • 43 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 9 Versions
  • 2 % Grown

The README.md

Lombok-like

You don't need create all getters and setters in your class. Only create attributes extends lombok-like and comment it for display in your IDE autocomplete., (*1)

Version

@2.1.0 - Throw an exception., (*2)

@2.0.0 - Removed abstract methods and change reflection to closure., (*3)

@1.2.1 - Change name of methods from __get to get for override., (*4)

@1.2.0 - Remove support to codes with underscore and improve to use private attributes., (*5)

@1.1.0 - Adaptated to old codes which were used with underscore before name of attribute., (*6)

Getting Started

composer install, (*7)

composer require k-hei/lombok-like

Test Tutorial

Include LombokLike class where you need:, (*8)

include 'vendor/autoload.php';

Extend it on all classes that you need:, (*9)

class Test extends \LombokLike\BaseEntity {}

If you want methods can be displayed in your IDE, use the PHPdoc on attributes:, (*10)

class Test extends \LombokLike\BaseEntity {
    ...
    /**
     * @method typeOfReturn getNameOfAttribute() optionally description
     * @method typeOfReturn setNameOfAttribute($value) optionally description
     */
    protected $nameOfAttribute;
    ...
}

And use!, (*11)

$test = new Test();
$test->setNameOfAttribute("Test");
echo $test->getNameOfAttribute();
//Result display is: Test

If you call a unknown method, receive a LombokException:, (*12)

$test->setUnknowAttr("Unkmow property");

Fatal error: Uncaught Call to undefined function: setUnknowAttr() In: F:\...\file.php On line: 99 
thrown in F:\...\LombokLike\entity\Base.php on line 100

Author

The LombokLike is created and maintained by Khwesten Heiner. Heiner is a senior FullStack web developer at MeuTutor and TeckS., (*13)

License

The LombokLike is released under the MIT public license., (*14)

The Versions

01/04 2018

v1.1.0

1.1.0.0

  Sources   Download

01/03 2017

dev-master

9999999-dev

Automatic get and set using native function __call

  Sources   Download

MIT

The Requires

  • php ^5.3.0 || ^7.0

 

by Avatar Khwesten

01/03 2017

v2.2.2

2.2.2.0

Automatic get and set using native function __call

  Sources   Download

MIT

The Requires

  • php ^5.3.0 || ^7.0

 

by Avatar Khwesten

01/03 2017

v2.2.1

2.2.1.0

Automatic get and set using native function __call

  Sources   Download

MIT

The Requires

  • php ^5.3.0

 

by Avatar Khwesten

05/01 2017

v2.2.0

2.2.0.0

Automatic get and set using native function __call

  Sources   Download

MIT

The Requires

  • php ^5.3.0

 

by Avatar Khwesten

05/01 2017

v2.1.0

2.1.0.0

Automatic get and set using native function __call

  Sources   Download

MIT

The Requires

  • php ^5.3.0

 

by Avatar Khwesten

05/01 2017

v2.0.0

2.0.0.0

automatic get and set use natives function __call, __get and __set

  Sources   Download

MIT

The Requires

  • php ^5.0.0

 

by Avatar Khwesten

04/01 2017

v1.2.1

1.2.1.0

automatic get and set use natives function __call, __get and __set

  Sources   Download

MIT

The Requires

  • php ^5.0.0

 

by Avatar Khwesten

03/01 2017

v1.2.0

1.2.0.0

automatic get and set use natives function __call, __get and __set

  Sources   Download

MIT

The Requires

  • php ^5.0.0

 

by Avatar Khwesten