public function resolveImage(ImagesContainerInterface $imagesContainer)
    {
        if (
            $imagesContainer instanceof PrincipalImageInterface &&
            $imagesContainer->getPrincipalImage() instanceof ImageInterface
        ) {
            return $imagesContainer->getPrincipalImage();
        }

        $firstImage = $imagesContainer
            ->getSortedImages()
            ->first();

        return ($firstImage instanceof ImageInterface)
            ? $firstImage
            : false;
    }
public function resolveImage(ImagesContainerInterface $imagesContainer)
    {
        if (
            $imagesContainer instanceof PrincipalImageInterface &&
            $imagesContainer->getPrincipalImage() instanceof ImageInterface
        ) {
            return $imagesContainer->getPrincipalImage();
        }

        $firstImage = $imagesContainer
            ->getSortedImages()
            ->first();

        return ($firstImage instanceof ImageInterface)
            ? $firstImage
            : false;
    }
public function resolveImage ( ImagesContainerInterface $ imagesContainer ) { if ( $ imagesContainer instanceof PrincipalImageInterface && $ imagesContainer -> getPrincipalImage ( ) instanceof ImageInterface ) { return $ imagesContainer -> getPrincipalImage ( ) ; } $ firstImage = $ imagesContainer -> getSortedImages ( ) -> first ( ) ; return ( $ firstImage instanceof ImageInterface ) ? $ firstImage : false ; }
Return one image given a ImagesContainerInterface implementation.

@param ImagesContainerInterface $imagesContainer Images container

@return ImageInterface|false First image of false if any found
Return one image given a ImagesContainerInterface implementation .