lib/Doctrine/ORM/Mapping/Driver/AnnotationDriver.php
private function getCascade(string $className, string $fieldName, array $originalCascades)
    {
        $cascadeTypes = ['remove', 'persist', 'refresh'];
        $cascades     = array_map('strtolower', $originalCascades);

        if (in_array('all', $cascades, true)) {
            $cascades = $cascadeTypes;
        }

        if (count($cascades) !== count(array_intersect($cascades, $cascadeTypes))) {
            $diffCascades = array_diff($cascades, array_intersect($cascades, $cascadeTypes));

            throw Mapping\MappingException::invalidCascadeOption($diffCascades, $className, $fieldName);
        }

        return $cascades;
    }
private function getCascade(string $className, string $fieldName, array $originalCascades)
    {
        $cascadeTypes = ['remove', 'persist', 'refresh'];
        $cascades     = array_map('strtolower', $originalCascades);

        if (in_array('all', $cascades, true)) {
            $cascades = $cascadeTypes;
        }

        if (count($cascades) !== count(array_intersect($cascades, $cascadeTypes))) {
            $diffCascades = array_diff($cascades, array_intersect($cascades, $cascadeTypes));

            throw Mapping\MappingException::invalidCascadeOption($diffCascades, $className, $fieldName);
        }

        return $cascades;
    }
private function getCascade ( string $ className , string $ fieldName , array $ originalCascades ) { $ cascadeTypes = [ 'remove' , 'persist' , 'refresh' ] ; $ cascades = array_map ( 'strtolower' , $ originalCascades ) ; if ( in_array ( 'all' , $ cascades , true ) ) { $ cascades = $ cascadeTypes ; } if ( count ( $ cascades ) !== count ( array_intersect ( $ cascades , $ cascadeTypes ) ) ) { $ diffCascades = array_diff ( $ cascades , array_intersect ( $ cascades , $ cascadeTypes ) ) ; throw Mapping \ MappingException :: invalidCascadeOption ( $ diffCascades , $ className , $ fieldName ) ; } return $ cascades ; }
Attempts to resolve the cascade modes.

@param string   $className        The class name.
@param string   $fieldName        The field name.
@param string[] $originalCascades The original unprocessed field cascades.

@return string[] The processed field cascades.

@throws Mapping\MappingException If a cascade option is not valid.
Attempts to resolve the cascade modes .