ymmtmsys/properties
Composer 安装命令:
composer require ymmtmsys/properties
包简介
Automatically creates a setter and getter via annotations.
关键字:
README 文档
README
Properties is automatically creates a setter and getter via annotations.
Annotations
@accessor
The @accessor annotation is able to read and write variable.
@reader
The @reader annotation is able to read variable.
@writer
The @writer annotation is able to write variable.
Example
<?php use Ymmtmsys\Properties\Properties; class SubClass extends Properties // extend Properties class { /** * @accessor */ protected $rdwr = 'Read and wirte property'; /** * @reader */ protected $rdonly = 'Read only property'; /** * @writer */ protected $wronly = 'Write only property'; protected $no_annotation = 'no annotation'; } $obj = new SubClass; // Read echo $obj->rdonly, "\n"; // => "Read only property" echo $obj->rdwr, "\n"; // => "Read and wirte property" // Write $obj->wronly = 'Yippee!'; $obj->rdwr = 'Yup!'; // Error!! $obj->rdonly = 'Oops!'; echo $obj->wronly, "\n"; $obj->no_annotation = 'php'; echo $obj->no_annotation, "\n";
Copyright
Copyright (c) 2012 ymmtmsys. See LICENSE for further details.
统计信息
- 总下载量: 13
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 1
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2012-10-06