for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
/**
* @copyright Copyright (C) eZ Systems AS. All rights reserved.
* @license For full copyright and license information view LICENSE file distributed with this source code.
*/
namespace eZ\Publish\Core\MVC\Symfony\Matcher;
use eZ\Publish\API\Repository\Values\Content\Location;
use eZ\Publish\API\Repository\Values\Content\ContentInfo;
use eZ\Publish\Core\MVC\Symfony\Matcher\ViewMatcherInterface;
use eZ\Publish\Core\MVC\Symfony\View\ContentView;
use eZ\Publish\Core\MVC\Symfony\View\LocationValueView;
use eZ\Publish\Core\MVC\Symfony\View\View;
* A view matcher that matches embed images.
*
* Uses the isEmbedImage embed object parameter.
class IsEmbedImage implements ViewMatcherInterface
{
* @var bool
private $isImage;
public function setMatchingConfig($matchingConfig)
if (!is_bool($matchingConfig)) {
throw new \InvalidArgumentException('The IsImage matcher expects a boolean value');
}
$this->isImage = $matchingConfig;
public function match(View $view)
if (!$view->hasParameter('objectParameters')) {
return false;
$objectParameters = $view->getParameter('objectParameters');
if (!isset($objectParameters['isImage'])) {
return ($objectParameters['isImage'] === $this->isImage);