protected function isExposed(ObjectDefinitionInterface $definition, $prop): bool
    {
        $exposed = $definition->getExclusionPolicy() === ObjectDefinitionInterface::EXCLUDE_NONE;

        if ($prop instanceof \ReflectionMethod) {
            $exposed = false;

            //implicit inclusion
            if ($this->getFieldAnnotation($prop, Annotation\Field::class)) {
                $exposed = true;
            }
        }

        if ($exposed && $this->getFieldAnnotation($prop, Annotation\Exclude::class)) {
            $exposed = false;
        } elseif (!$exposed && $this->getFieldAnnotation($prop, Annotation\Expose::class)) {
            $exposed = true;
        }

        /** @var Annotation\Field $fieldAnnotation */
        if ($fieldAnnotation = $this->getFieldAnnotation($prop, Annotation\Field::class)) {
            $exposed = true;
            if ($fieldAnnotation->in) {
                $exposed = \in_array($definition->getName(), $fieldAnnotation->in);
            } elseif (($fieldAnnotation->notIn)) {
                $exposed = !\in_array($definition->getName(), $fieldAnnotation->notIn);
            }
        }

        return $exposed;
    }
protected function isExposed(ObjectDefinitionInterface $definition, $prop): bool
    {
        $exposed = $definition->getExclusionPolicy() === ObjectDefinitionInterface::EXCLUDE_NONE;

        if ($prop instanceof \ReflectionMethod) {
            $exposed = false;

            //implicit inclusion
            if ($this->getFieldAnnotation($prop, Annotation\Field::class)) {
                $exposed = true;
            }
        }

        if ($exposed && $this->getFieldAnnotation($prop, Annotation\Exclude::class)) {
            $exposed = false;
        } elseif (!$exposed && $this->getFieldAnnotation($prop, Annotation\Expose::class)) {
            $exposed = true;
        }

        /** @var Annotation\Field $fieldAnnotation */
        if ($fieldAnnotation = $this->getFieldAnnotation($prop, Annotation\Field::class)) {
            $exposed = true;
            if ($fieldAnnotation->in) {
                $exposed = \in_array($definition->getName(), $fieldAnnotation->in);
            } elseif (($fieldAnnotation->notIn)) {
                $exposed = !\in_array($definition->getName(), $fieldAnnotation->notIn);
            }
        }

        return $exposed;
    }
protected function isExposed ( ObjectDefinitionInterface $ definition , $ prop ) : bool { $ exposed = $ definition -> getExclusionPolicy ( ) === ObjectDefinitionInterface :: EXCLUDE_NONE ; if ( $ prop instanceof \ ReflectionMethod ) { $ exposed = false ; //implicit inclusion if ( $ this -> getFieldAnnotation ( $ prop , Annotation \ Field :: class ) ) { $ exposed = true ; } } if ( $ exposed && $ this -> getFieldAnnotation ( $ prop , Annotation \ Exclude :: class ) ) { $ exposed = false ; } elseif ( ! $ exposed && $ this -> getFieldAnnotation ( $ prop , Annotation \ Expose :: class ) ) { $ exposed = true ; } /** @var Annotation\Field $fieldAnnotation */ if ( $ fieldAnnotation = $ this -> getFieldAnnotation ( $ prop , Annotation \ Field :: class ) ) { $ exposed = true ; if ( $ fieldAnnotation -> in ) { $ exposed = \ in_array ( $ definition -> getName ( ) , $ fieldAnnotation -> in ) ; } elseif ( ( $ fieldAnnotation -> notIn ) ) { $ exposed = ! \ in_array ( $ definition -> getName ( ) , $ fieldAnnotation -> notIn ) ; } } return $ exposed ; }
Verify if a given property for given definition is exposed or not

@param ObjectDefinitionInterface             $definition
@param \ReflectionMethod|\ReflectionProperty $prop

@return boolean
Verify if a given property for given definition is exposed or not