123456789101112131415161718192021222324252627282930313233343536 |
- <?php
- namespace Juju\App;
- class Arguments implements \JsonSerializable, \ArrayAccess, \Countable{
- public $args;
- public function __construct($args){
- $this->args = $args;
- }
- public function jsonSerialize(){
- return $this->args;
- }
- public function __toString(){
- return $this->path;
- }
- public function __get($name){
- if(isset($this->args[$name])){
- return $this->args[$name];
- }
- }
- public function offsetGet($key){
- return $this->args[$key];
- }
- public function offsetExists($key){
- return isset($this->args[$key]);
- }
- public function offsetSet($key,$val){
- $this->args[$key] = $val;
- }
- public function offsetUnset($key){
- unset($this->args[$key]);
- }
- public function count(){
- return count($this->args);
- }
- }
- ?>
|