mouf/utils.value.value-interface
最新稳定版本:v1.0.0
Composer 安装命令:
composer require mouf/utils.value.value-interface
包简介
This package contains an interface used by many objects to say they represent a value that can be computed. The concept is very simple, and very powerful at the same time.
关键字:
README 文档
README
This package contains an interface used by many objects to declare they represent a unique value.
If your objects represent a single value, they should implement ValueInterface. An object implementing this interface will return a single value when the "val()" method is called. The value can be anything (if you want the value to be a string, a bool, an array or something else, use one of the subinterfaces provided, like StringValueInterface for instance).
This is a very simple and very powerful system.
namespace Mouf\Utils\Value; interface ValueInterface { /** * Returns the value represented by this object. * * @return mixed */ public function val(); }
Here are a few samples:
- a class that represents one GET or POST parameter
- a class that represents the result of a complex operation
- a class that represents a user bean
- a class that represents whether the current user has some right
- ...
This package does not only contains the ValueInterface interface. It also contains a number of more specialized interfaces that extend ValueInterface and that represent specific values (like a string or a bool).
Here is a list of all interfaces available in this package:
- ValueInterface
- ScalarValueInterface
- StringValueInterface
- BoolValueInterface
- NumberValueInterface
- IntValueInterface
- ObjectValueInterface
- ArrayValueInterface
- MapValueInterface
- ScalarValueInterface
Mouf package
This package is part of Mouf (http://mouf-php.com), an effort to ensure good developing practices by providing a graphical dependency injection framework.
统计信息
- 总下载量: 530.12k
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 1
- 点击次数: 1
- 依赖项目数: 12
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2013-05-16