hgg/property-accessor
Composer 安装命令:
composer require hgg/property-accessor
包简介
The Symfony PropertyAccessor as a trait
README 文档
README
Provide a bit of convenience if your property access methods need to throw exceptions on an as needed basis.
Example:
$default = 'my default';
$throw = false;
$value = $this->getValue($obj, 'my.path.to.value', $default, $throw);
This would return the value at the given path if it exists, or the default value if not.
$default = 'my default';
$throw = true;
$value = $this->getValue($obj, 'my.path.to.value', $default, $throw);
This would return the value at the given path if it exists, or throw an exception if not.
统计信息
- 总下载量: 422
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 0
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2017-02-24