protected function validateStrictBean()
    {
        /*
         * 1st rule to respect:
         * All the constructor's parameters must be bound
         * to a valid annotated property, and the appropriate
         * getter and setter. (This implies the bean has a constructor)
         */
        if ($this->getClass()->hasMethod('__construct') === true) {
            $params = $this->getClass()->getMethod('__construct')->getParameters();
            $class = $this->getClass()->getName();

            foreach ($params as $param) {
                $name = $param->getName();

                if ($this->hasProperty($name) === false) {
                    $msg = "The constructor parameter '${name}' of class '${class}' has no related bean property.";
                    throw new BeanException($msg, BeanException::NO_PROPERTY);
                } elseif ($this->hasGetter($name) === false) {
                    $msg = "The constructor parameter '${name}' of class '${class}' has no related bean getter.";
                    throw new BeanException($msg, BeanException::NO_METHOD);
                } elseif ($this->hasSetter($name) === false) {
                    $msg = "The construct parameter '${name}' of class '${class}' has no related bean setter.";
                    throw new BeanException($msg, BeanException::NO_METHOD);
                }
            }
        }

        /*
         * 2nd rule to respect is that any property annotated as a bean property
         * must have the appropriate getter and setter.
         */
        foreach ($this->getClass()->getProperties() as $prop) {
            $name = $prop->getName();

            if ($this->hasProperty($name) === true) {
                // Annotated property found.
                if ($this->hasGetter($name) === false) {
                    $msg = "The bean property '${name}' has no related bean getter.";
                    throw new BeanException($msg, BeanException::NO_METHOD);
                } elseif ($this->hasSetter($name) === false) {
                    $msg = "The bean property '${name}' has no related bean setter.";
                    throw new BeanException($msg, BeanException::NO_METHOD);
                }
            }
        }
    }
protected function validateStrictBean()
    {
        /*
         * 1st rule to respect:
         * All the constructor's parameters must be bound
         * to a valid annotated property, and the appropriate
         * getter and setter. (This implies the bean has a constructor)
         */
        if ($this->getClass()->hasMethod('__construct') === true) {
            $params = $this->getClass()->getMethod('__construct')->getParameters();
            $class = $this->getClass()->getName();

            foreach ($params as $param) {
                $name = $param->getName();

                if ($this->hasProperty($name) === false) {
                    $msg = "The constructor parameter '${name}' of class '${class}' has no related bean property.";
                    throw new BeanException($msg, BeanException::NO_PROPERTY);
                } elseif ($this->hasGetter($name) === false) {
                    $msg = "The constructor parameter '${name}' of class '${class}' has no related bean getter.";
                    throw new BeanException($msg, BeanException::NO_METHOD);
                } elseif ($this->hasSetter($name) === false) {
                    $msg = "The construct parameter '${name}' of class '${class}' has no related bean setter.";
                    throw new BeanException($msg, BeanException::NO_METHOD);
                }
            }
        }

        /*
         * 2nd rule to respect is that any property annotated as a bean property
         * must have the appropriate getter and setter.
         */
        foreach ($this->getClass()->getProperties() as $prop) {
            $name = $prop->getName();

            if ($this->hasProperty($name) === true) {
                // Annotated property found.
                if ($this->hasGetter($name) === false) {
                    $msg = "The bean property '${name}' has no related bean getter.";
                    throw new BeanException($msg, BeanException::NO_METHOD);
                } elseif ($this->hasSetter($name) === false) {
                    $msg = "The bean property '${name}' has no related bean setter.";
                    throw new BeanException($msg, BeanException::NO_METHOD);
                }
            }
        }
    }
protected function validateStrictBean ( ) { /*
         * 1st rule to respect:
         * All the constructor's parameters must be bound
         * to a valid annotated property, and the appropriate
         * getter and setter. (This implies the bean has a constructor)
         */ if ( $ this -> getClass ( ) -> hasMethod ( '__construct' ) === true ) { $ params = $ this -> getClass ( ) -> getMethod ( '__construct' ) -> getParameters ( ) ; $ class = $ this -> getClass ( ) -> getName ( ) ; foreach ( $ params as $ param ) { $ name = $ param -> getName ( ) ; if ( $ this -> hasProperty ( $ name ) === false ) { $ msg = "The constructor parameter '${name}' of class '${class}' has no related bean property." ; throw new BeanException ( $ msg , BeanException :: NO_PROPERTY ) ; } elseif ( $ this -> hasGetter ( $ name ) === false ) { $ msg = "The constructor parameter '${name}' of class '${class}' has no related bean getter." ; throw new BeanException ( $ msg , BeanException :: NO_METHOD ) ; } elseif ( $ this -> hasSetter ( $ name ) === false ) { $ msg = "The construct parameter '${name}' of class '${class}' has no related bean setter." ; throw new BeanException ( $ msg , BeanException :: NO_METHOD ) ; } } } /*
         * 2nd rule to respect is that any property annotated as a bean property
         * must have the appropriate getter and setter.
         */ foreach ( $ this -> getClass ( ) -> getProperties ( ) as $ prop ) { $ name = $ prop -> getName ( ) ; if ( $ this -> hasProperty ( $ name ) === true ) { // Annotated property found. if ( $ this -> hasGetter ( $ name ) === false ) { $ msg = "The bean property '${name}' has no related bean getter." ; throw new BeanException ( $ msg , BeanException :: NO_METHOD ) ; } elseif ( $ this -> hasSetter ( $ name ) === false ) { $ msg = "The bean property '${name}' has no related bean setter." ; throw new BeanException ( $ msg , BeanException :: NO_METHOD ) ; } } } }
Contains the internal logic of bean validation. Throws exceptions
to know why it's not a valid bean.

@throws \qtism\common\beans\BeanException
Contains the internal logic of bean validation . Throws exceptions to know why it s not a valid bean .