src/File/Validation/ItemTypeRule.php
protected function getItemSanityCheck($itemName)
    {
        $model = $this->getFile()->getModelFromStructAttribute($this->getAttribute());
        $sanityCheck = 'false';
        if ($model instanceof Struct && !$model->isList() && ($model->isStruct() || ($model->isArray() && $model->getInheritanceStruct() instanceof Struct))) {
            $sanityCheck = sprintf('!$%s instanceof %s', $itemName, $this->getFile()->getStructAttributeType($this->getAttribute(), true));
        } else {
            $type = AbstractModelFile::getPhpType($this->getFile()->getStructAttributeType($this->getAttribute()));
            if ($rule = $this->getRules()->getRule($type)) {
                $sanityCheck = $rule->testConditions($itemName, null, true);
            }
        }
        return $sanityCheck;
    }
protected function getItemSanityCheck($itemName)
    {
        $model = $this->getFile()->getModelFromStructAttribute($this->getAttribute());
        $sanityCheck = 'false';
        if ($model instanceof Struct && !$model->isList() && ($model->isStruct() || ($model->isArray() && $model->getInheritanceStruct() instanceof Struct))) {
            $sanityCheck = sprintf('!$%s instanceof %s', $itemName, $this->getFile()->getStructAttributeType($this->getAttribute(), true));
        } else {
            $type = AbstractModelFile::getPhpType($this->getFile()->getStructAttributeType($this->getAttribute()));
            if ($rule = $this->getRules()->getRule($type)) {
                $sanityCheck = $rule->testConditions($itemName, null, true);
            }
        }
        return $sanityCheck;
    }
protected function getItemSanityCheck ( $ itemName ) { $ model = $ this -> getFile ( ) -> getModelFromStructAttribute ( $ this -> getAttribute ( ) ) ; $ sanityCheck = 'false' ; if ( $ model instanceof Struct && ! $ model -> isList ( ) && ( $ model -> isStruct ( ) || ( $ model -> isArray ( ) && $ model -> getInheritanceStruct ( ) instanceof Struct ) ) ) { $ sanityCheck = sprintf ( '!$%s instanceof %s' , $ itemName , $ this -> getFile ( ) -> getStructAttributeType ( $ this -> getAttribute ( ) , true ) ) ; } else { $ type = AbstractModelFile :: getPhpType ( $ this -> getFile ( ) -> getStructAttributeType ( $ this -> getAttribute ( ) ) ) ; if ( $ rule = $ this -> getRules ( ) -> getRule ( $ type ) ) { $ sanityCheck = $ rule -> testConditions ( $ itemName , null , true ) ; } } return $ sanityCheck ; }
The second case which used PHP native functions is volontary limited by the native functions provided by PHP,
and the possible types defined in xsd_types.yml
@param string $itemName
@return string
The second case which used PHP native functions is volontary limited by the native functions provided by PHP and the possible types defined in xsd_types . yml