Skip to content

Library provides setters and getters functionality without implementing them

License

Notifications You must be signed in to change notification settings

mohamed-akef/The-Magic-DTO

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

The Magic DTO

This library provides functionality to access the class property with setter and getter functions call without implementing them.

Installation

Use the package manager composer to install The-Magic-DTO.

composer require akef/the-magic-dto:dev-master

Usage

just you need to use this trait in your class:

use \Akef\MDTO\SetAndGetProvider;

or call The magic class in your class __call magic function like:

public function __call($name, $arguments)
{
    return (new \Akef\MDTO\MagicManager())->init($this, $name, $arguments)->run();
}

Example

require 'vendor/autoload.php';

class Test
{
    use \Akef\MDTO\SetAndGetProvider;
    
    private $foo;
}

$testObject = new Test();

$test->setFoo('It is working!');
$fooValue = $testObject->getFoo();
echo $fooValue; //It is working!

Contributing

Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.

Please make sure to update the tests as appropriate.

License

MIT

About

Library provides setters and getters functionality without implementing them

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages