Download the PHP package nekoos-pood/propertyable without Composer
On this page you can find all versions of the php package nekoos-pood/propertyable. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Please rate this library. Is it a good library?
Informations about the package propertyable
PHP Property Decorator
Properties combine aspects of both fields and methods. To the user of an object, a property appears to be a field, accessing the property requires the same syntax. To the implementer of a class, a property is one or two code blocks, representing a get accessor and/or a set accessor.
Installation
Usage
General use
This library provides your with a built-in @property decorator as DocBlock which makes use of getter and setters much easier in Object-Oriented Programming.
use NekoOs\Decorator\Concerns\HasDecoratorProperties;
require_once "vendor/autoload.php";
/**
* @property int $age {read getAge} {write setAge}
*/
class SomeClass
{
use HasDecoratorProperties;
private $age;
public function getAge() : int
{
return $this->age;
}
public function setAge(int $value): void
{
$this->age= $value;
}
}
$someClass = new SomeClass();
$someClass->age = '33';
var_dump($someClass->age); # int(33)
All versions of propertyable with dependencies
PHP Build Version
Package Version
Requires
jasny/phpdoc-parser Version
dev-hotfix/ignore-phpdoc-closing
nekoos-pood/bitwise-flag Version ^0.1.0
nekoos-pood/bitwise-flag Version ^0.1.0
The package nekoos-pood/propertyable contains the following files
Loading the files please wait ....