src/watoki/reflect/PropertyReader.php
public function readInterface($object = null) {
        $properties = new Map();

        if ($this->class->getConstructor()) {
            foreach ($this->class->getConstructor()->getParameters() as $parameter) {
                $this->accumulate($properties,
                    new property\ConstructorProperty($this->factory, $this->class->getConstructor(), $parameter));
            }
        }

        $declaredProperties = array();
        foreach ($this->class->getProperties(\ReflectionProperty::IS_PUBLIC) as $property) {
            if (!$property->isStatic()) {
                $declaredProperties[] = $property->name;
                $this->accumulate($properties,
                    new property\InstanceVariableProperty($this->factory, $property));
            }
        }

        if (is_object($object)) {
            foreach ($object as $name => $value) {
                if (!in_array($name, $declaredProperties)) {
                    $this->accumulate($properties,
                        new property\DynamicProperty($this->factory, new \ReflectionClass($object), $name));
                }
            }
        }

        foreach ($this->class->getMethods(\ReflectionMethod::IS_PUBLIC) as $method) {
            if (property\AccessorProperty::isAccessor($method) && !$method->isStatic()) {
                $this->accumulate($properties,
                    new property\AccessorProperty($this->factory, $method));
            }
        }

        return $properties;
    }
public function readInterface($object = null) {
        $properties = new Map();

        if ($this->class->getConstructor()) {
            foreach ($this->class->getConstructor()->getParameters() as $parameter) {
                $this->accumulate($properties,
                    new property\ConstructorProperty($this->factory, $this->class->getConstructor(), $parameter));
            }
        }

        $declaredProperties = array();
        foreach ($this->class->getProperties(\ReflectionProperty::IS_PUBLIC) as $property) {
            if (!$property->isStatic()) {
                $declaredProperties[] = $property->name;
                $this->accumulate($properties,
                    new property\InstanceVariableProperty($this->factory, $property));
            }
        }

        if (is_object($object)) {
            foreach ($object as $name => $value) {
                if (!in_array($name, $declaredProperties)) {
                    $this->accumulate($properties,
                        new property\DynamicProperty($this->factory, new \ReflectionClass($object), $name));
                }
            }
        }

        foreach ($this->class->getMethods(\ReflectionMethod::IS_PUBLIC) as $method) {
            if (property\AccessorProperty::isAccessor($method) && !$method->isStatic()) {
                $this->accumulate($properties,
                    new property\AccessorProperty($this->factory, $method));
            }
        }

        return $properties;
    }
public function readInterface ( $ object = null ) { $ properties = new Map ( ) ; if ( $ this -> class -> getConstructor ( ) ) { foreach ( $ this -> class -> getConstructor ( ) -> getParameters ( ) as $ parameter ) { $ this -> accumulate ( $ properties , new property \ ConstructorProperty ( $ this -> factory , $ this -> class -> getConstructor ( ) , $ parameter ) ) ; } } $ declaredProperties = array ( ) ; foreach ( $ this -> class -> getProperties ( \ ReflectionProperty :: IS_PUBLIC ) as $ property ) { if ( ! $ property -> isStatic ( ) ) { $ declaredProperties [ ] = $ property -> name ; $ this -> accumulate ( $ properties , new property \ InstanceVariableProperty ( $ this -> factory , $ property ) ) ; } } if ( is_object ( $ object ) ) { foreach ( $ object as $ name => $ value ) { if ( ! in_array ( $ name , $ declaredProperties ) ) { $ this -> accumulate ( $ properties , new property \ DynamicProperty ( $ this -> factory , new \ ReflectionClass ( $ object ) , $ name ) ) ; } } } foreach ( $ this -> class -> getMethods ( \ ReflectionMethod :: IS_PUBLIC ) as $ method ) { if ( property \ AccessorProperty :: isAccessor ( $ method ) && ! $ method -> isStatic ( ) ) { $ this -> accumulate ( $ properties , new property \ AccessorProperty ( $ this -> factory , $ method ) ) ; } } return $ properties ; }
Derives properties from constructor, public instance variables, getters and setters.

@param object|null $object If provided, dynamic (run-time) variables are read as well
@return \watoki\collections\Map|Property[] indexed by property name
Derives properties from constructor public instance variables getters and setters .