src/Contao/View/Contao2BackendView/EditMask.php
private function isLegendVisible($legend, $legendStates)
    {
        if (\array_key_exists($legend->getName(), $legendStates)) {
            return $legendStates[$legend->getName()];
        }

        return $legend->isInitialVisible();
    }
private function isLegendVisible($legend, $legendStates)
    {
        if (\array_key_exists($legend->getName(), $legendStates)) {
            return $legendStates[$legend->getName()];
        }

        return $legend->isInitialVisible();
    }
private function isLegendVisible ( $ legend , $ legendStates ) { if ( \ array_key_exists ( $ legend -> getName ( ) , $ legendStates ) ) { return $ legendStates [ $ legend -> getName ( ) ] ; } return $ legend -> isInitialVisible ( ) ; }
Determine if the passed legend is visible or collapsed.

@param LegendInterface $legend       The legend.
@param bool[]          $legendStates The states from the session.

@return bool
Determine if the passed legend is visible or collapsed .