public function getVariablesInBlock(array $variables)
    {
        $blockVariableNames = array_map(function (Variable $variable) {
            return $variable->getName();
        }, $this->variables);

        return array_filter($variables, function (Variable $variable) use ($blockVariableNames) {
            return in_array($variable->getName(), $blockVariableNames);
        });
    }
public function getVariablesInBlock(array $variables)
    {
        $blockVariableNames = array_map(function (Variable $variable) {
            return $variable->getName();
        }, $this->variables);

        return array_filter($variables, function (Variable $variable) use ($blockVariableNames) {
            return in_array($variable->getName(), $blockVariableNames);
        });
    }
public function getVariablesInBlock ( array $ variables ) { $ blockVariableNames = array_map ( function ( Variable $ variable ) { return $ variable -> getName ( ) ; } , $ this -> variables ) ; return array_filter ( $ variables , function ( Variable $ variable ) use ( $ blockVariableNames ) { return in_array ( $ variable -> getName ( ) , $ blockVariableNames ) ; } ) ; }
Return only the variables that are in the block.

@param Variable[] $variables

@return Variable[]
Return only the variables that are in the block .