Database queries should use parameter binding 5

More information: https://insight.symfony.com/what-we-analyse/doctrine.database_query_contains_string_and_variable_concatenation

  1. if (strlen($this->table) === 0) {
  2. throw new QueryException('Missing table name');
  3. }
  4. $where = count($this->where)
  5. ? ' WHERE ' . implode(' AND ', $this->where)

    If provided by the user, the value of implode(' AND ', $this->where) may allow an SQL injection attack. Avoid concatenating parameters to SQL query strings, and use parameter binding instead.

    Time to fix: about 1 hour
    Open Issue Permalink
    Last edited by André R
  6. : '';
  7. return 'DELETE FROM ' . $this->table . $where;
  8. }
  9. }
  1. $where = count($this->where)
  2. ? ' WHERE ' . implode(' AND ', $this->where)
  3. : '';
  4. return 'DELETE FROM ' . $this->table . $where;

    If provided by the user, the value of $this->table may allow an SQL injection attack. Avoid concatenating parameters to SQL query strings, and use parameter binding instead.

    Time to fix: about 1 hour
    Open Issue Permalink
    Last edited by Benjamin Eberlei
  5. }
  6. }
  1. }
  2. }
  3. }
  4. if (count($this->parts['where']) > 0) {
  5. $sql .= ' WHERE ' . implode(' AND ', $this->parts['where']);

    If provided by the user, the value of implode(' AND ', $this->parts['where']) may allow an SQL injection attack. Avoid concatenating parameters to SQL query strings, and use parameter binding instead.

    Time to fix: about 1 hour
    Open Issue Permalink
    Last edited by Jérôme Vieilledent
  6. }
  7. if (count($this->parts['groupBy']) > 0) {
  8. $sql .= ' GROUP BY ' . implode(', ', $this->parts['groupBy']);
  9. }
  1. if (count($this->parts['having']) > 0) {
  2. $sql .= ' HAVING ' . implode(' AND ', $this->parts['having']);
  3. }
  4. if (count($this->parts['orderBy']) > 0) {
  5. $sql .= ' ORDER BY ' . implode(', ', $this->parts['orderBy']);

    If provided by the user, the value of implode(', ', $this->parts['orderBy']) may allow an SQL injection attack. Avoid concatenating parameters to SQL query strings, and use parameter binding instead.

    Time to fix: about 1 hour
    Open Issue Permalink
    Last edited by Jérôme Vieilledent
  6. }
  7. if ($this->limit || $this->offset) {
  8. $sql = $this->connection->getDatabasePlatform()->modifyLimitQuery(
  9. $sql,
  1. foreach ($this->values as $column => $expression) {
  2. $set[] = $column . ' = ' . $expression;
  3. }
  4. return 'UPDATE ' . $this->table . ' SET ' . implode(', ', $set)

    If provided by the user, the value of $this->table may allow an SQL injection attack. Avoid concatenating parameters to SQL query strings, and use parameter binding instead.

    Time to fix: about 1 hour
    Open Issue Permalink
    Last edited by Jérôme Vieilledent
  5. . ' WHERE ' . implode(' AND ', $this->where);
  6. }
  7. }

PHP configuration should not be changed dynamically 2

More information: https://insight.symfony.com/what-we-analyse/php.dynamically_change_configuration

  1. * @see http://php.net/manual/en/session.configuration.php#ini.session.save-path for further details.
  2. */
  3. public function __construct($savePath = null, $saveHandler = null)
  4. {
  5. if (null !== $savePath) {
  6. ini_set('session.save_path', $savePath);

    Changing PHP configuration dynamically through ini_set() may create hard to debug errors.

    Time to fix: about 2 hours
    Open Issue Permalink
    Last edited by Vidar
  7. }
  8. if (null !== $saveHandler) {
  9. ini_set('session.save_handler', $saveHandler);
  10. }
  1. if (null !== $savePath) {
  2. ini_set('session.save_path', $savePath);
  3. }
  4. if (null !== $saveHandler) {
  5. ini_set('session.save_handler', $saveHandler);

    Changing PHP configuration dynamically through ini_set() may create hard to debug errors.

    Time to fix: about 2 hours
    Open Issue Permalink
    Last edited by Vidar
  6. }
  7. }
  8. }

Missing use statement should be avoided 9

More information: https://insight.symfony.com/what-we-analyse/php.missing_use_statement

  1. /**
  2. * Publishes a content draft.
  3. *
  4. * @param eZ\Publish\API\Repository\Values\Content\Content $content
  5. */
  6. public function publishDraft(Content $content)

    The Content type hint resolves to the following classes: eZ\Bundle\EzPublishCoreBundle\DependencyInjection\Configuration\Parser\Content or eZ\Publish\API\Repository\Values\Content\Content or eZ\Publish\Core\MVC\Symfony\Matcher\ContentBased\Id\Content or eZ\Publish\Core\MVC\Symfony\View\Provider\Content or eZ\Publish\Core\REST\Client\Input\Parser\Content or eZ\Publish\Core\REST\Client\Values\Content\Content or eZ\Publish\Core\REST\Server\Controller\Content or eZ\Publish\Core\Repository\Values\Content\Content or eZ\Publish\SPI\Persistence\Content.
    Did you forget to add a corresponding use statement for one of them?

    Time to fix: about 15 minutes
    Open Issue Permalink
    Last edited by Miguel Jacinto
  7. {
  8. $this->contentService->publishVersion($content->versionInfo->id);
  9. }
  10. /**
  1. * E.g. array('%contentId%' => 123).
  2. */
  3. public function __construct($messageTemplate, array $parameters = [])
  4. {
  5. /** @Ignore */
  6. $this->setMessageTemplate($messageTemplate);

    The @Ignore annotation does not seem to be valid. Did you mean @ignore instead?
    If this is a class annotation, it currently resolves to the eZ\Publish\Core\Base\Exceptions\Ignore class which PHP does not seem to be able to autoload.

    Time to fix: about 15 minutes
    Open Issue Permalink
    Last edited by Jérôme Vieilledent
  7. $this->setParameters($parameters);
  8. parent::__construct($this->getBaseTranslation());
  9. }
  10. }
  1. * E.g. array('%contentId%' => 123).
  2. */
  3. public function __construct($messageTemplate, array $parameters = [])
  4. {
  5. /** @Ignore */
  6. $this->setMessageTemplate($messageTemplate);

    The @Ignore annotation does not seem to be valid. Did you mean @ignore instead?
    If this is a class annotation, it currently resolves to the eZ\Publish\Core\Base\Exceptions\Ignore class which PHP does not seem to be able to autoload.

    Time to fix: about 15 minutes
    Open Issue Permalink
    Last edited by Jérôme Vieilledent
  7. $this->setParameters($parameters);
  8. parent::__construct($this->getBaseTranslation());
  9. }
  10. }
  1. * E.g. array('%contentId%' => 123).
  2. */
  3. public function __construct($messageTemplate, array $parameters = [])
  4. {
  5. /** @Ignore */
  6. $this->setMessageTemplate($messageTemplate);

    The @Ignore annotation does not seem to be valid. Did you mean @ignore instead?
    If this is a class annotation, it currently resolves to the eZ\Publish\Core\Base\Exceptions\Ignore class which PHP does not seem to be able to autoload.

    Time to fix: about 15 minutes
    Open Issue Permalink
    Last edited by Jérôme Vieilledent
  7. $this->setParameters($parameters);
  8. parent::__construct($this->getBaseTranslation());
  9. }
  10. }
  1. $actualType = is_object($value) ? get_class($value) : gettype($value);
  2. $parameters['%actualType%'] = $actualType;
  3. }
  4. /** @Ignore */
  5. $this->addParameters($parameters);

    The @Ignore annotation does not seem to be valid. Did you mean @ignore instead?
    If this is a class annotation, it currently resolves to the eZ\Publish\Core\Base\Exceptions\Ignore class which PHP does not seem to be able to autoload.

    Time to fix: about 15 minutes
    Open Issue Permalink
    Last edited by Jérôme Vieilledent
  6. $this->message = $this->getBaseTranslation();
  7. }
  8. }
  1. parent::__construct($argumentName, $whatIsWrong, $previous);
  2. // Alter the message template & inject new parameters.
  3. /** @Ignore */
  4. $this->setMessageTemplate(str_replace('%whatIsWrong%', $whatIsWrong, $this->getMessageTemplate()));

    The @Ignore annotation does not seem to be valid. Did you mean @ignore instead?
    If this is a class annotation, it currently resolves to the eZ\Publish\Core\Base\Exceptions\Ignore class which PHP does not seem to be able to autoload.

    Time to fix: about 15 minutes
    Open Issue Permalink
    Last edited by Jérôme Vieilledent
  5. $this->addParameters($parameters);
  6. $this->message = $this->getBaseTranslation();
  7. }
  8. }
  1. /**
  2. * @return \Psr\Log\LoggerInterface|null
  3. */
  4. public function getLogger()
  5. {
  6. return $this->container->get('logger', ContainerInterface::NULL_ON_INVALID_REFERENCE);

    The ContainerInterface class resolves to the following classes: Psr\Container\ContainerInterface or Symfony\Component\DependencyInjection\ContainerInterface.
    Did you forget to add a corresponding use statement for one of them?

    Time to fix: about 15 minutes
    Open Issue Permalink
    Last edited by Jérôme Vieilledent
  7. }
  8. /**
  9. * @return \eZ\Publish\API\Repository\Repository
  10. */
  1. // value object (or its parent class(es)) to the respective visitor
  2. // implementation instance.
  3. array(
  4. '\\eZ\\Publish\\API\\Repository\\Values\\Content\\SectionCreateStruct' => new Client\Output\ValueObjectVisitor\SectionCreateStruct($requestParser),
  5. '\\eZ\\Publish\\API\\Repository\\Values\\Content\\SectionUpdateStruct' => new Client\Output\ValueObjectVisitor\SectionUpdateStruct($requestParser),
  6. '\\eZ\\Publish\\Core\\REST\\Common\\Values\\SectionIncludingContentMetadataUpdateStruct' => new Client\Output\ValueObjectVisitor\SectionIncludingContentMetadataUpdateStruct($requestParser),

    The Client\Output\ValueObjectVisitor\SectionIncludingContentMetadataUpdateStruct class resolves to the eZ\Publish\Core\REST\Client\Output\ValueObjectVisitor\SectionIncludingContentMetadataUpdateStruct class which PHP does not seem to be able to autoload.

    Time to fix: about 15 minutes
    Open Issue Permalink
    Last edited by Jérôme Vieilledent
  7. '\\eZ\\Publish\\API\\Repository\\Values\\User\\RoleCreateStruct' => new Client\Output\ValueObjectVisitor\RoleCreateStruct($requestParser),
  8. '\\eZ\\Publish\\API\\Repository\\Values\\User\\RoleUpdateStruct' => new Client\Output\ValueObjectVisitor\RoleUpdateStruct($requestParser),
  9. '\\eZ\\Publish\\API\\Repository\\Values\\User\\PolicyCreateStruct' => new Client\Output\ValueObjectVisitor\PolicyCreateStruct($requestParser),
  10. '\\eZ\\Publish\\API\\Repository\\Values\\User\\Limitation' => new Client\Output\ValueObjectVisitor\Limitation($requestParser),
  11. '\\eZ\\Publish\\API\\Repository\\Values\\User\\PolicyUpdateStruct' => new Client\Output\ValueObjectVisitor\PolicyUpdateStruct($requestParser),
  1. $generator->startValueElement('errorMessage', $this->httpStatusCodes[$statusCode]);
  2. $generator->endValueElement('errorMessage');
  3. if ($data instanceof Translatable && $this->translator) {
  4. /** @Ignore */
  5. $errorDescription = $this->translator->trans($data->getMessageTemplate(), $data->getParameters(), 'repository_exceptions');

    The @Ignore annotation does not seem to be valid. Did you mean @ignore instead?
    If this is a class annotation, it currently resolves to the eZ\Publish\Core\REST\Server\Output\ValueObjectVisitor\Ignore class which PHP does not seem to be able to autoload.

    Time to fix: about 15 minutes
    Open Issue Permalink
    Last edited by Jérôme Vieilledent
  6. } else {
  7. $errorDescription = $data->getMessage();
  8. }
  9. $generator->startValueElement('errorDescription', $errorDescription);
  10. $generator->endValueElement('errorDescription');

PHP 7 reserved words should not be used as class, interfaces or traits names

More information: https://insight.symfony.com/what-we-analyse/php.php7_reserved_words

  1. use eZ\Publish\Core\REST\Common\Value as RestValue;
  2. /**
  3. * This class represents a resource.
  4. */
  5. class Resource extends RestValue

    This name is a reserved word since PHP 7 and should not be used as class, interface or trait name.

    Time to fix: about 15 minutes
    Open Issue Permalink
    Last edited by wizhippo
  6. {
  7. /**
  8. * Resource name.
  9. *
  10. * @var string

exit() and die() functions should be avoided 4

More information: https://insight.symfony.com/what-we-analyse/php.use_exit_function

  1. if ($installer === false) {
  2. $output->writeln(
  3. "Unknown install type '$type', available options in currently installed eZ Platform package: " .
  4. implode(', ', array_keys($this->installers))
  5. );
  6. exit(self::EXIT_UNKNOWN_INSTALL_TYPE);

    This line stops the execution flow, without explanation. If this is for debug, you should remove it. If this is to deal with an error, use exceptions instead.

    Time to fix: about 4 hours
    Open Issue Permalink
    Last edited by Jérôme Vieilledent
  7. }
  8. $installer->setOutput($output);
  9. $installer->importSchema();
  1. private function checkPermissions()
  2. {
  3. if (!is_writable('web') && !is_writable('web/var')) {
  4. $this->output->writeln('[web/ | web/var] is not writable');
  5. exit(self::EXIT_MISSING_PERMISSIONS);

    This line stops the execution flow, without explanation. If this is for debug, you should remove it. If this is to deal with an error, use exceptions instead.

    Time to fix: about 4 hours
    Open Issue Permalink
    Last edited by Jérôme Vieilledent
  6. }
  7. }
  8. private function checkParameters()
  9. {
  1. private function checkParameters()
  2. {
  3. $parametersFile = 'app/config/parameters.yml';
  4. if (!is_file($parametersFile)) {
  5. $this->output->writeln("Required configuration file '$parametersFile' not found");
  6. exit(self::EXIT_PARAMETERS_NOT_FOUND);

    This line stops the execution flow, without explanation. If this is for debug, you should remove it. If this is to deal with an error, use exceptions instead.

    Time to fix: about 4 hours
    Open Issue Permalink
    Last edited by Jérôme Vieilledent
  7. }
  8. }
  9. private function checkCreateDatabase(OutputInterface $output)
  10. {
  1. "<error>The configured database '%s' does not exist or cannot be created.</error>",
  2. $this->db->getDatabase()
  3. )
  4. );
  5. $this->output->writeln("Please check the database configuration in 'app/config/parameters.yml'");
  6. exit(self::EXIT_GENERAL_DATABASE_ERROR);

    This line stops the execution flow, without explanation. If this is for debug, you should remove it. If this is to deal with an error, use exceptions instead.

    Time to fix: about 4 hours
    Open Issue Permalink
    Last edited by Jérôme Vieilledent
  7. }
  8. }
  9. /**
  10. * Clear all content related cache (persistence cache).

Absolute path constants __DIR__ and __FILE__ should not be used 2

More information: https://insight.symfony.com/what-we-analyse/symfony.dependency_injection.use_dir_file_constant

  1. * @param ContainerBuilder $container
  2. * @param array $config
  3. */
  4. public function load(ContainerBuilder $container, array $config)
  5. {
  6. $loader = new YamlFileLoader($container, new FileLocator(__DIR__ . '/../Resources/config'));

    __DIR__ and __FILE__ constants may conflict with the Symfony resource overriding system

    Time to fix: about 2 hours
    Open Issue Permalink
    Last edited by Miguel
  7. $loader->load('services.yml');
  8. }
  9. }
  1. public function __construct(Connection $db)
  2. {
  3. $this->db = $db;
  4. // parametrized so other installer implementations can override this
  5. $this->baseDataDir = __DIR__ . '/../../../../../data';

    __DIR__ and __FILE__ constants may conflict with the Symfony resource overriding system

    Time to fix: about 2 hours
    Open Issue Permalink
    Last edited by Andrew Longosz
  6. }
  7. /**
  8. * @param \Symfony\Component\Console\Output\OutputInterface $output
  9. */

PHP super globals should never be used

More information: https://insight.symfony.com/what-we-analyse/symfony.use_super_globals

  1. {
  2. if ($requestStack !== null && ($request = $requestStack->getMasterRequest())) {
  3. return $request->isSecure() ? 'https-' : '';
  4. }
  5. return !empty($_SERVER['HTTPS']) && 'off' !== strtolower($_SERVER['HTTPS']) ? 'https-' : '';

    $_SERVER super global should not be used.

    Time to fix: about 2 hours
    Open Issue Permalink
    Last edited by Adam Wójs
  6. }
  7. }

The EntityManager should not be flushed within a loop

More information: https://insight.symfony.com/what-we-analyse/doctrine.use_flush_in_loop

  1. } catch (NotFoundException $e) {
  2. $this->logWarning($progress, 'Content with id ' . $contentObject->versionInfo->id . ' has missing data, so skipped for indexing. Full exception: ' . $e->getMessage());
  3. }
  4. }
  5. if ($commit) {
  6. $this->searchHandler->flush();

    Calling flush is a resource intensive operation, especially when a lot of entities are managed by Doctrine. You should avoid flushing inside a loop.

    Time to fix: about 1 hour
    Open Issue Permalink
    Last edited by Andrew Longosz
  7. }
  8. $progress->advance($k);
  9. } while (($i += $iterationCount) < $totalCount);
  10. $progress->finish();
  11. $output->writeln('');

Code should not be duplicated 65

More information: https://insight.symfony.com/what-we-analyse/php.duplicated_code

  1. $query->bindValue($status, null, \PDO::PARAM_INT)
  2. );
  3. } else {
  4. $draftCondition = $query->expr->neq(
  5. $this->handler->quoteColumn('version', 'ezrole'),
  6. $query->bindValue(Role::STATUS_DEFINED, null, \PDO::PARAM_INT)

    The next 38 lines appear both in eZ/Publish/Core/Persistence/Legacy/User/Role/Gateway/DoctrineDatabase.php:111 and eZ/Publish/Core/Persistence/Legacy/User/Role/Gateway/DoctrineDatabase.php:180.

    Time to fix: about 4 hours
    Open Issue Permalink
    Last edited by Jérôme Vieilledent
  7. );
  8. }
  9. $query->select(
  10. $this->handler->aliasedColumn($query, 'id', 'ezrole'),
  1. $this->handler->quoteColumn('version', 'ezrole'),
  2. $query->bindValue(Role::STATUS_DEFINED, null, \PDO::PARAM_INT)
  3. );
  4. }
  5. $query->select(

    The next 32 lines appear both in eZ/Publish/Core/Persistence/Legacy/User/Role/Gateway/DoctrineDatabase.php:115 and eZ/Publish/Core/Persistence/Legacy/User/Role/Gateway/DoctrineDatabase.php:240.

    Time to fix: about 4 hours
    Open Issue Permalink
    Last edited by Kore Nordmann
  6. $this->handler->aliasedColumn($query, 'id', 'ezrole'),
  7. $this->handler->aliasedColumn($query, 'name', 'ezrole'),
  8. $this->handler->aliasedColumn($query, 'version', 'ezrole'),
  9. $this->handler->aliasedColumn($query, 'id', 'ezpolicy'),
  10. $this->handler->aliasedColumn($query, 'function_name', 'ezpolicy'),
  1. $query->bindValue(Role::STATUS_DEFINED, null, \PDO::PARAM_INT)
  2. );
  3. }
  4. $query->select(
  5. $this->handler->aliasedColumn($query, 'id', 'ezrole'),

    The next 10 lines appear both in eZ/Publish/Core/Persistence/Legacy/User/Role/Gateway/DoctrineDatabase.php:116 and eZ/Publish/Core/Persistence/Legacy/User/Role/Gateway/DoctrineDatabase.php:377.

    Time to fix: about 4 hours
    Open Issue Permalink
    Last edited by Jérôme Vieilledent
  6. $this->handler->aliasedColumn($query, 'name', 'ezrole'),
  7. $this->handler->aliasedColumn($query, 'version', 'ezrole'),
  8. $this->handler->aliasedColumn($query, 'id', 'ezpolicy'),
  9. $this->handler->aliasedColumn($query, 'function_name', 'ezpolicy'),
  10. $this->handler->aliasedColumn($query, 'module_name', 'ezpolicy'),
  1. $this->handler->aliasedColumn($query, 'module_name', 'ezpolicy'),
  2. $this->handler->aliasedColumn($query, 'original_id', 'ezpolicy'),
  3. $this->handler->aliasedColumn($query, 'identifier', 'ezpolicy_limitation'),
  4. $this->handler->aliasedColumn($query, 'value', 'ezpolicy_limitation_value')
  5. )->from(
  6. $this->handler->quoteTable('ezrole')

    The next 21 lines appear both in eZ/Publish/Core/Persistence/Legacy/User/Role/Gateway/DoctrineDatabase.php:126 and eZ/Publish/Core/Persistence/Legacy/User/Role/Gateway/DoctrineDatabase.php:324.

    Time to fix: about 4 hours
    Open Issue Permalink
    Last edited by Jérôme Vieilledent
  7. )->leftJoin(
  8. $this->handler->quoteTable('ezpolicy'),
  9. $query->expr->eq(
  10. $this->handler->quoteColumn('role_id', 'ezpolicy'),
  11. $this->handler->quoteColumn('id', 'ezrole')
  1. * @param string $identifier
  2. * @param int $status One of Role::STATUS_DEFINED|Role::STATUS_DRAFT
  3. *
  4. * @return array
  5. */
  6. public function loadRoleByIdentifier($identifier, $status = Role::STATUS_DEFINED)

    The next 20 lines appear both in eZ/Publish/Core/Persistence/Legacy/User/Role/Gateway/DoctrineDatabase.php:169 and eZ/Publish/Core/Persistence/Legacy/User/Role/Gateway/DoctrineDatabase.php:292.

    Time to fix: about 4 hours
    Open Issue Permalink
    Last edited by Gunnstein Lye
  7. {
  8. $query = $this->handler->createSelectQuery();
  9. if ($status === Role::STATUS_DEFINED) {
  10. $roleVersionCondition = $query->expr->eq(
  11. $this->handler->quoteColumn('version', 'ezrole'),
  1. $this->handler->aliasedColumn($query, 'original_id', 'ezpolicy'),
  2. $this->handler->aliasedColumn($query, 'identifier', 'ezpolicy_limitation'),
  3. $this->handler->aliasedColumn($query, 'value', 'ezpolicy_limitation_value')
  4. )->from(
  5. $this->handler->quoteTable('ezrole')
  6. )->leftJoin(

    The next 26 lines appear both in eZ/Publish/Core/Persistence/Legacy/User/Role/Gateway/DoctrineDatabase.php:320 and eZ/Publish/Core/Persistence/Legacy/User/Role/Gateway/DoctrineDatabase.php:394.

    Time to fix: about 4 hours
    Open Issue Permalink
    Last edited by André R
  7. $this->handler->quoteTable('ezuser_role'),
  8. $query->expr->eq(
  9. $this->handler->quoteColumn('role_id', 'ezuser_role'),
  10. $this->handler->quoteColumn('id', 'ezrole')
  11. )
  1. * @param \eZ\Publish\API\Repository\Values\User\RoleDraft $roleDraft
  2. * @param \eZ\Publish\API\Repository\Values\User\PolicyCreateStruct $policyCreateStruct
  3. *
  4. * @return \eZ\Publish\API\Repository\Values\User\RoleDraft
  5. */
  6. public function addPolicyByRoleDraft(APIRoleDraft $roleDraft, APIPolicyCreateStruct $policyCreateStruct)

    The next 16 lines appear both in eZ/Publish/Core/Repository/RoleService.php:317 and eZ/Publish/Core/Repository/RoleService.php:601.

    Time to fix: about 4 hours
    Open Issue Permalink
    Last edited by Gunnstein Lye
  7. {
  8. if (!is_string($policyCreateStruct->module) || empty($policyCreateStruct->module)) {
  9. throw new InvalidArgumentValue('module', $policyCreateStruct->module, 'PolicyCreateStruct');
  10. }
  1. *
  2. * Provides content filtering based on Fields contents & values.
  3. */
  4. class CustomField extends Criterion implements CriterionInterface
  5. {
  6. public function getSpecifications()

    The next 12 lines appear both in eZ/Publish/API/Repository/Values/Content/Query/Criterion/CustomField.php:22 and eZ/Publish/API/Repository/Values/Content/Query/Criterion/Field.php:30.

    Time to fix: about 4 hours
    Open Issue Permalink
    Last edited by Kore Nordmann
  7. {
  8. return array(
  9. new Specifications(Operator::IN, Specifications::FORMAT_ARRAY),
  10. new Specifications(Operator::EQ, Specifications::FORMAT_SINGLE),
  11. new Specifications(Operator::GT, Specifications::FORMAT_SINGLE),
  1. if (count($result) < 1) {
  2. return null;
  3. }
  4. $convertedResult = [];
  5. foreach (reset($result) as $column => $value) {

    The next 65 lines appear both in eZ/Publish/Core/FieldType/BinaryBase/BinaryBaseStorage/Gateway/DoctrineStorage.php:186 and eZ/Publish/Core/FieldType/BinaryBase/BinaryBaseStorage/Gateway/LegacyStorage.php:212.

    Time to fix: about 4 hours
    Open Issue Permalink
    Last edited by Andrew Longosz
  6. $convertedResult[$this->toPropertyName($column)] = $this->castToPropertyValue($value, $column);
  7. }
  8. $convertedResult['id'] = $this->prependMimeToPath(
  9. $convertedResult['id'],
  10. $convertedResult['mimeType']
  1. * @copyright Copyright (C) eZ Systems AS. All rights reserved.
  2. * @license For full copyright and license information view LICENSE file distributed with this source code.
  3. */
  4. namespace eZ\Publish\Core\FieldType\BinaryFile;
  5. use eZ\Publish\SPI\Persistence\Content\Field;

    The next 79 lines appear both in eZ/Publish/Core/FieldType/BinaryFile/SearchField.php:11 and eZ/Publish/Core/FieldType/Media/SearchField.php:11.

    Time to fix: about 4 hours
    Open Issue Permalink
    Last edited by Petar Španja
  6. use eZ\Publish\SPI\Persistence\Content\Type\FieldDefinition;
  7. use eZ\Publish\SPI\FieldType\Indexable;
  8. use eZ\Publish\SPI\Search;
  9. /**
  1. * @copyright Copyright (C) eZ Systems AS. All rights reserved.
  2. * @license For full copyright and license information view LICENSE file distributed with this source code.
  3. */
  4. namespace eZ\Publish\Core\FieldType\EmailAddress;
  5. use eZ\Publish\SPI\Persistence\Content\Field;

    The next 67 lines appear both in eZ/Publish/Core/FieldType/EmailAddress/SearchField.php:11 and eZ/Publish/Core/FieldType/ISBN/SearchField.php:11.

    Time to fix: about 4 hours
    Open Issue Permalink
    Last edited by Petar Španja
  6. use eZ\Publish\SPI\Persistence\Content\Type\FieldDefinition;
  7. use eZ\Publish\SPI\FieldType\Indexable;
  8. use eZ\Publish\SPI\Search;
  9. /**
  1. * Stores the keyword list from $field->value->externalData.
  2. *
  3. * @param \eZ\Publish\SPI\Persistence\Content\Field
  4. * @param int $contentTypeId
  5. */
  6. public function storeFieldData(Field $field, $contentTypeId)

    The next 67 lines appear both in eZ/Publish/Core/FieldType/Keyword/KeywordStorage/Gateway/DoctrineStorage.php:37 and eZ/Publish/Core/FieldType/Keyword/KeywordStorage/Gateway/LegacyStorage.php:44.

    Time to fix: about 4 hours
    Open Issue Permalink
    Last edited by Andrew Longosz
  7. {
  8. if (empty($field->value->externalData) && !empty($field->id)) {
  9. $this->deleteFieldData($field->id);
  10. return;
  1. *
  2. * @param \eZ\Publish\Core\FieldType\Page\Parts\Block
  3. *
  4. * @return \eZ\Publish\Core\FieldType\Page\Parts\Item[]
  5. */
  6. public function getValidBlockItems(Block $block)

    The next 18 lines appear both in eZ/Publish/Core/FieldType/Page/PageStorage/Gateway/DoctrineStorage.php:41 and eZ/Publish/Core/FieldType/Page/PageStorage/Gateway/DoctrineStorage.php:200.

    Time to fix: about 4 hours
    Open Issue Permalink
    Last edited by Andrew Longosz
  7. {
  8. $query = $this->connection->createQueryBuilder();
  9. $query
  10. ->select(
  11. $this->connection->quoteIdentifier('p.object_id'),
  1. *
  2. * @param \eZ\Publish\Core\FieldType\Page\Parts\Block
  3. *
  4. * @return \eZ\Publish\Core\FieldType\Page\Parts\Item[]
  5. */
  6. public function getValidBlockItems(Block $block)

    The next 16 lines appear both in eZ/Publish/Core/FieldType/Page/PageStorage/Gateway/DoctrineStorage.php:41 and eZ/Publish/Core/FieldType/Page/PageStorage/Gateway/DoctrineStorage.php:100.

    Time to fix: about 4 hours
    Open Issue Permalink
    Last edited by Andrew Longosz
  7. {
  8. $query = $this->connection->createQueryBuilder();
  9. $query
  10. ->select(
  11. $this->connection->quoteIdentifier('p.object_id'),
  1. *
  2. * @param mixed $fieldSettings
  3. *
  4. * @return \eZ\Publish\SPI\FieldType\ValidationError[]
  5. */
  6. public function validateFieldSettings($fieldSettings)

    The next 33 lines appear both in eZ/Publish/Core/FieldType/Relation/Type.php:56 and eZ/Publish/Core/FieldType/RelationList/Type.php:67.

    Time to fix: about 4 hours
    Open Issue Permalink
    Last edited by Jérôme Vieilledent
  7. {
  8. $validationErrors = array();
  9. foreach ($fieldSettings as $name => $value) {
  10. if (!isset($this->settingsSchema[$name])) {
  1. *
  2. * @param \eZ\Publish\Core\FieldType\TextBlock\Value $value
  3. *
  4. * @return string
  5. */
  6. public function getName(SPIValue $value)

    The next 72 lines appear both in eZ/Publish/Core/FieldType/TextBlock/Type.php:53 and eZ/Publish/Core/FieldType/TextLine/Type.php:142.

    Time to fix: about 4 hours
    Open Issue Permalink
    Last edited by Jérôme Vieilledent
  7. {
  8. return (string)$value->text;
  9. }
  10. /**
  1. * @param \eZ\Publish\API\Repository\Values\User\Limitation $limitationValue
  2. */
  3. public function acceptValue(APILimitationValue $limitationValue)
  4. {
  5. if (!$limitationValue instanceof APIContentTypeLimitation) {
  6. throw new InvalidArgumentType('$limitationValue', 'APIContentTypeLimitation', $limitationValue);

    The next 52 lines appear both in eZ/Publish/Core/Limitation/ContentTypeLimitationType.php:43 and eZ/Publish/Core/Limitation/ParentContentTypeLimitationType.php:45.

    Time to fix: about 4 hours
    Open Issue Permalink
    Last edited by Jérôme Vieilledent
  7. } elseif (!is_array($limitationValue->limitationValues)) {
  8. throw new InvalidArgumentType('$limitationValue->limitationValues', 'array', $limitationValue->limitationValues);
  9. }
  10. foreach ($limitationValue->limitationValues as $key => $id) {
  1. * @param \eZ\Publish\API\Repository\Values\User\Limitation $limitationValue
  2. */
  3. public function acceptValue(APILimitationValue $limitationValue)
  4. {
  5. if (!$limitationValue instanceof APINewObjectStateLimitation) {
  6. throw new InvalidArgumentType('$limitationValue', 'NewObjectStateLimitation', $limitationValue);

    The next 52 lines appear both in eZ/Publish/Core/Limitation/NewObjectStateLimitationType.php:45 and eZ/Publish/Core/Limitation/ObjectStateLimitationType.php:44.

    Time to fix: about 4 hours
    Open Issue Permalink
    Last edited by Jérôme Vieilledent
  7. } elseif (!is_array($limitationValue->limitationValues)) {
  8. throw new InvalidArgumentType('$limitationValue->limitationValues', 'array', $limitationValue->limitationValues);
  9. }
  10. foreach ($limitationValue->limitationValues as $key => $id) {
  1. * @param \eZ\Publish\API\Repository\Values\User\Limitation $limitationValue
  2. */
  3. public function acceptValue(APILimitationValue $limitationValue)
  4. {
  5. if (!$limitationValue instanceof APINewSectionLimitation) {
  6. throw new InvalidArgumentType('$limitationValue', 'APINewSectionLimitation', $limitationValue);

    The next 52 lines appear both in eZ/Publish/Core/Limitation/NewSectionLimitationType.php:43 and eZ/Publish/Core/Limitation/SectionLimitationType.php:44.

    Time to fix: about 4 hours
    Open Issue Permalink
    Last edited by Jérôme Vieilledent
  7. } elseif (!is_array($limitationValue->limitationValues)) {
  8. throw new InvalidArgumentType('$limitationValue->limitationValues', 'array', $limitationValue->limitationValues);
  9. }
  10. foreach ($limitationValue->limitationValues as $key => $id) {
  1. * @param \eZ\Publish\API\Repository\Values\User\Limitation $limitationValue
  2. */
  3. public function acceptValue(APILimitationValue $limitationValue)
  4. {
  5. if (!$limitationValue instanceof APIOwnerLimitation) {
  6. throw new InvalidArgumentType('$limitationValue', 'APIOwnerLimitation', $limitationValue);

    The next 53 lines appear both in eZ/Publish/Core/Limitation/OwnerLimitationType.php:43 and eZ/Publish/Core/Limitation/ParentOwnerLimitationType.php:41.

    Time to fix: about 4 hours
    Open Issue Permalink
    Last edited by Jérôme Vieilledent
  7. } elseif (!is_array($limitationValue->limitationValues)) {
  8. throw new InvalidArgumentType('$limitationValue->limitationValues', 'array', $limitationValue->limitationValues);
  9. }
  10. foreach ($limitationValue->limitationValues as $key => $value) {
  1. {
  2. if (!$value instanceof APIParentContentTypeLimitation) {
  3. throw new InvalidArgumentException('$value', 'Must be of type: APIParentContentTypeLimitation');
  4. }
  5. if ($object instanceof ContentCreateStruct) {

    The next 31 lines appear both in eZ/Publish/Core/Limitation/ParentContentTypeLimitationType.php:120 and eZ/Publish/Core/Limitation/ParentDepthLimitationType.php:107.

    Time to fix: about 4 hours
    Open Issue Permalink
    Last edited by Jérôme Vieilledent
  6. return $this->evaluateForContentCreateStruct($value, $targets);
  7. } elseif ($object instanceof Content) {
  8. $object = $object->getVersionInfo()->getContentInfo();
  9. } elseif ($object instanceof VersionInfo) {
  10. $object = $object->getContentInfo();
  1. * @param \eZ\Publish\API\Repository\Values\User\Limitation $limitationValue
  2. */
  3. public function acceptValue(APILimitationValue $limitationValue)
  4. {
  5. if (!$limitationValue instanceof APIParentUserGroupLimitation) {
  6. throw new InvalidArgumentType('$limitationValue', 'APIParentUserGroupLimitation', $limitationValue);

    The next 56 lines appear both in eZ/Publish/Core/Limitation/ParentUserGroupLimitationType.php:41 and eZ/Publish/Core/Limitation/UserGroupLimitationType.php:43.

    Time to fix: about 4 hours
    Open Issue Permalink
    Last edited by Jérôme Vieilledent
  7. } elseif (!is_array($limitationValue->limitationValues)) {
  8. throw new InvalidArgumentType('$limitationValue->limitationValues', 'array', $limitationValue->limitationValues);
  9. }
  10. foreach ($limitationValue->limitationValues as $key => $value) {
  1. */
  2. protected function getMatcher($matcherIdentifier)
  3. {
  4. // Not a FQ class name, so take the relative namespace.
  5. if ($matcherIdentifier[0] !== '\\' && defined('static::MATCHER_RELATIVE_NAMESPACE')) {
  6. $matcherIdentifier = static::MATCHER_RELATIVE_NAMESPACE . "\\$matcherIdentifier";

    The next 63 lines appear both in eZ/Publish/Core/MVC/Symfony/Matcher/AbstractMatcherFactory.php:86 and eZ/Publish/Core/MVC/Symfony/Matcher/ClassNameMatcherFactory.php:81.

    Time to fix: about 4 hours
    Open Issue Permalink
    Last edited by Jérôme Vieilledent
  7. }
  8. // Retrieving the matcher instance from in-memory cache
  9. if (isset($this->matchers[$matcherIdentifier])) {
  10. return $this->matchers[$matcherIdentifier];
  1. return;
  2. }
  3. $node = $node->expr;
  4. $ignore = false;

    The next 31 lines appear both in eZ/Publish/Core/MVC/Symfony/Translation/TranslatableExceptionsFileVisitor.php:121 and eZ/Publish/Core/MVC/Symfony/Translation/ValidationErrorFileVisitor.php:114.

    Time to fix: about 4 hours
    Open Issue Permalink
    Last edited by Bertrand Dunogier
  5. $desc = $meaning = null;
  6. if (null !== $docComment = $this->getDocCommentForNode($node)) {
  7. if ($docComment instanceof Doc) {
  8. $docComment = $docComment->getText();
  9. }
  1. throw new RuntimeException($message);
  2. }
  3. $id = $node->args[0]->value->value;
  4. $message = new Message($id, $this->defaultDomain);

    The next 83 lines appear both in eZ/Publish/Core/MVC/Symfony/Translation/TranslatableExceptionsFileVisitor.php:156 and eZ/Publish/Core/MVC/Symfony/Translation/ValidationErrorFileVisitor.php:155.

    Time to fix: about 4 hours
    Open Issue Permalink
    Last edited by Bertrand Dunogier
  5. $message->setDesc($desc);
  6. $message->setMeaning($meaning);
  7. $message->addSource($this->fileSourceFactory->create($this->file, $node->getLine()));
  8. $this->catalogue->add($message);
  9. }
  1. $this->dbHandler->quoteColumn('language_code'),
  2. $q->bindValue($field->languageCode)
  3. )->set(
  4. $this->dbHandler->quoteColumn('version'),
  5. $q->bindValue($field->versionNo, null, \PDO::PARAM_INT)
  6. )->set(

    The next 15 lines appear both in eZ/Publish/Core/Persistence/Legacy/Content/Gateway/DoctrineDatabase.php:689 and eZ/Publish/Core/Persistence/Legacy/Content/Gateway/DoctrineDatabase.php:770.

    Time to fix: about 4 hours
    Open Issue Permalink
    Last edited by Tobias Schlitt
  7. $this->dbHandler->quoteColumn('data_float'),
  8. $q->bindValue($value->dataFloat)
  9. )->set(
  10. $this->dbHandler->quoteColumn('data_int'),
  11. $q->bindValue($value->dataInt, null, \PDO::PARAM_INT)
  1. {
  2. /** @var $query \eZ\Publish\Core\Persistence\Database\SelectQuery */
  3. $query = $this->dbHandler->createSelectQuery();
  4. $query->select(
  5. // Content object
  6. $this->dbHandler->aliasedColumn($query, 'id', 'ezcontentobject'),

    The next 12 lines appear both in eZ/Publish/Core/Persistence/Legacy/Content/Gateway/DoctrineDatabase/QueryBuilder.php:50 and eZ/Publish/Core/Persistence/Legacy/Content/Gateway/DoctrineDatabase/QueryBuilder.php:206.

    Time to fix: about 4 hours
    Open Issue Permalink
    Last edited by Jérôme Vieilledent
  7. $this->dbHandler->aliasedColumn($query, 'contentclass_id', 'ezcontentobject'),
  8. $this->dbHandler->aliasedColumn($query, 'section_id', 'ezcontentobject'),
  9. $this->dbHandler->aliasedColumn($query, 'owner_id', 'ezcontentobject'),
  10. $this->dbHandler->aliasedColumn($query, 'remote_id', 'ezcontentobject'),
  11. $this->dbHandler->aliasedColumn($query, 'current_version', 'ezcontentobject'),
  1. $query = $this->dbHandler->createSelectQuery();
  2. $query->select(
  3. $query->alias($query->expr->count('*'), 'count')
  4. )->from(
  5. $this->dbHandler->quoteTable('ezcobj_state')
  6. )->where(

    The next 28 lines appear both in eZ/Publish/Core/Persistence/Legacy/Content/Language/Gateway/DoctrineDatabase.php:242 and eZ/Publish/Core/Persistence/Legacy/Content/Language/Gateway/DoctrineDatabase.php:270.

    Time to fix: about 4 hours
    Open Issue Permalink
    Last edited by Patrick Allaert
  7. $query->expr->lOr(
  8. $query->expr->eq(
  9. $this->dbHandler->quoteColumn('default_language_id'),
  10. $query->bindValue($id, null, \PDO::PARAM_INT)
  11. ),
  1. $this->dbHandler->quoteTable('ezcobj_state')
  2. )->where(
  3. $query->expr->lOr(
  4. $query->expr->eq(
  5. $this->dbHandler->quoteColumn('default_language_id'),
  6. $query->bindValue($id, null, \PDO::PARAM_INT)

    The next 24 lines appear both in eZ/Publish/Core/Persistence/Legacy/Content/Language/Gateway/DoctrineDatabase.php:246 and eZ/Publish/Core/Persistence/Legacy/Content/Language/Gateway/DoctrineDatabase.php:346.

    Time to fix: about 4 hours
    Open Issue Permalink
    Last edited by Jérôme Vieilledent
  7. ),
  8. $query->expr->gt(
  9. $query->expr->bitAnd(
  10. $this->dbHandler->quoteColumn('language_mask'),
  11. $query->bindValue($id, null, \PDO::PARAM_INT)
  1. $query = $this->dbHandler->createSelectQuery();
  2. $query->select(
  3. $query->alias($query->expr->count('*'), 'count')
  4. )->from(
  5. $this->dbHandler->quoteTable('ezcontentclass')
  6. )->where(

    The next 28 lines appear in eZ/Publish/Core/Persistence/Legacy/Content/Language/Gateway/DoctrineDatabase.php:342, eZ/Publish/Core/Persistence/Legacy/Content/Language/Gateway/DoctrineDatabase.php:392 and eZ/Publish/Core/Persistence/Legacy/Content/Language/Gateway/DoctrineDatabase.php:464.

    Time to fix: about 4 hours
    Open Issue Permalink
    Last edited by Patrick Allaert
  7. $query->expr->lOr(
  8. $query->expr->eq(
  9. $this->dbHandler->quoteColumn('initial_language_id'),
  10. $query->bindValue($id, null, \PDO::PARAM_INT)
  11. ),
  1. $query = $this->dbHandler->createSelectQuery();
  2. $query->select(
  3. $this->dbHandler->quoteColumn('parent'),
  4. $this->dbHandler->quoteColumn('text_md5'),
  5. $this->dbHandler->quoteColumn('lang_mask')
  6. )->from(

    The next 15 lines appear both in eZ/Publish/Core/Persistence/Legacy/Content/UrlAlias/Gateway/DoctrineDatabase.php:279 and eZ/Publish/Core/Persistence/Legacy/Content/UrlAlias/Gateway/DoctrineDatabase.php:826.

    Time to fix: about 4 hours
    Open Issue Permalink
    Last edited by Petar Spanja
  7. $this->dbHandler->quoteTable($this->table)
  8. )->where(
  9. $query->expr->lAnd(
  10. // 1) Autogenerated aliases that match action and language...
  11. $query->expr->eq(
  1. *
  2. * @return array
  3. */
  4. public function load($userId)
  5. {
  6. $query = $this->handler->createSelectQuery();

    The next 20 lines appear both in eZ/Publish/Core/Persistence/Legacy/User/Gateway/DoctrineDatabase.php:123 and eZ/Publish/Core/Persistence/Legacy/User/Gateway/DoctrineDatabase.php:202.

    Time to fix: about 4 hours
    Open Issue Permalink
    Last edited by Kore Nordmann
  7. $query->select(
  8. $this->handler->quoteColumn('contentobject_id', 'ezuser'),
  9. $this->handler->quoteColumn('login', 'ezuser'),
  10. $this->handler->quoteColumn('email', 'ezuser'),
  11. $this->handler->quoteColumn('password_hash', 'ezuser'),
  1. *
  2. * @return array
  3. */
  4. public function load($userId)
  5. {
  6. $query = $this->handler->createSelectQuery();

    The next 19 lines appear both in eZ/Publish/Core/Persistence/Legacy/User/Gateway/DoctrineDatabase.php:123 and eZ/Publish/Core/Persistence/Legacy/User/Gateway/DoctrineDatabase.php:162.

    Time to fix: about 4 hours
    Open Issue Permalink
    Last edited by Kore Nordmann
  7. $query->select(
  8. $this->handler->quoteColumn('contentobject_id', 'ezuser'),
  9. $this->handler->quoteColumn('login', 'ezuser'),
  10. $this->handler->quoteColumn('email', 'ezuser'),
  11. $this->handler->quoteColumn('password_hash', 'ezuser'),
  1. *
  2. * @return array
  3. */
  4. public function load($userId)
  5. {
  6. $query = $this->handler->createSelectQuery();

    The next 18 lines appear both in eZ/Publish/Core/Persistence/Legacy/User/Gateway/DoctrineDatabase.php:123 and eZ/Publish/Core/Persistence/Legacy/User/Gateway/DoctrineDatabase.php:241.

    Time to fix: about 4 hours
    Open Issue Permalink
    Last edited by Kore Nordmann
  7. $query->select(
  8. $this->handler->quoteColumn('contentobject_id', 'ezuser'),
  9. $this->handler->quoteColumn('login', 'ezuser'),
  10. $this->handler->quoteColumn('email', 'ezuser'),
  11. $this->handler->quoteColumn('password_hash', 'ezuser'),
  1. if ($names !== null && (!is_array($names) || empty($names))) {
  2. throw new InvalidArgumentValue('names', $names);
  3. }
  4. $inputStruct->name = $names !== null ? $names : $objectState->getNames();

    The next 23 lines appear both in eZ/Publish/Core/Repository/ObjectStateService.php:712 and eZ/Publish/Core/Repository/ObjectStateService.php:780.

    Time to fix: about 4 hours
    Open Issue Permalink
    Last edited by Edi Modrić
  5. if (!isset($inputStruct->name[$inputStruct->defaultLanguage])) {
  6. throw new InvalidArgumentValue('names', $inputStruct->name);
  7. }
  1. *
  2. * @return array
  3. */
  4. protected function getProperties($dynamicProperties = array('contentId'))
  5. {
  6. return parent::getProperties($dynamicProperties);

    The next 43 lines appear both in eZ/Publish/Core/Repository/Values/Content/Location.php:55 and eZ/Publish/Core/Repository/Values/Content/TrashItem.php:55.

    Time to fix: about 4 hours
    Open Issue Permalink
    Last edited by Jérôme Vieilledent
  7. }
  8. /**
  9. * Magic getter for retrieving convenience properties.
  10. *
  1. /**
  2. * Internal content representation.
  3. *
  4. * @var \eZ\Publish\API\Repository\Values\Content\Content
  5. */
  6. protected $content;

    The next 110 lines appear both in eZ/Publish/Core/Repository/Values/User/User.php:25 and eZ/Publish/Core/Repository/Values/User/UserGroup.php:25.

    Time to fix: about 4 hours
    Open Issue Permalink
    Last edited by Edi Modric
  7. /**
  8. * Returns the VersionInfo for this version.
  9. *
  10. * @return \eZ\Publish\API\Repository\Values\Content\VersionInfo
  1. $userGroupLocation->contentId
  2. );
  3. try {
  4. $this->userService->unAssignUserFromUserGroup($user, $userGroup);
  5. } catch (ApiExceptions\InvalidArgumentException $e) {

    The next 40 lines appear both in eZ/Publish/Core/REST/Server/Controller/User.php:880 and eZ/Publish/Core/REST/Server/Controller/User.php:942.

    Time to fix: about 4 hours
    Open Issue Permalink
    Last edited by Bertrand Dunogier
  6. // User is not in the group
  7. throw new Exceptions\ForbiddenException($e->getMessage());
  8. }
  9. $userGroups = $this->userService->loadUserGroupsOfUser($user);
  1. $generator->endObjectElement('Location');
  2. }
  3. protected function visitLocationAttributes(Visitor $visitor, Generator $generator, LocationValue $location)
  4. {
  5. $generator->startAttribute(

    The next 49 lines appear both in eZ/Publish/Core/REST/Server/Output/ValueObjectVisitor/Location.php:51 and eZ/Publish/Core/REST/Server/Output/ValueObjectVisitor/RestLocation.php:37.

    Time to fix: about 4 hours
    Open Issue Permalink
    Last edited by Bertrand Dunogier
  6. 'href',
  7. $this->router->generate(
  8. 'ezpublish_rest_loadLocation',
  9. array('locationPath' => trim($location->pathString, '/'))
  10. )
  1. $generator->startObjectElement('Content');
  2. $generator->startAttribute(
  3. 'href',
  4. $this->router->generate('ezpublish_rest_loadContent', array('contentId' => $location->contentId))
  5. );
  6. $generator->endAttribute('href');

    The next 26 lines appear both in eZ/Publish/Core/REST/Server/Output/ValueObjectVisitor/Location.php:123 and eZ/Publish/Core/REST/Server/Output/ValueObjectVisitor/RestLocation.php:109.

    Time to fix: about 4 hours
    Open Issue Permalink
    Last edited by Bertrand Dunogier
  7. $generator->endObjectElement('Content');
  8. $generator->startValueElement('sortField', $this->serializeSortField($location->sortField));
  9. $generator->endValueElement('sortField');
  1. $generator->endAttribute('remoteId');
  2. $visitor->setHeader('Content-Type', $generator->getMediaType('User'));
  3. $visitor->setHeader('Accept-Patch', $generator->getMediaType('UserUpdate'));
  4. $generator->startObjectElement('ContentType');

    The next 38 lines appear both in eZ/Publish/Core/REST/Server/Output/ValueObjectVisitor/RestUser.php:49 and eZ/Publish/Core/REST/Server/Output/ValueObjectVisitor/RestUserGroup.php:51.

    Time to fix: about 4 hours
    Open Issue Permalink
    Last edited by Jérôme Vieilledent
  5. $generator->startAttribute(
  6. 'href',
  7. $this->router->generate('ezpublish_rest_loadContentType', array('contentTypeId' => $contentInfo->contentTypeId))
  8. );
  1. $this->router->generate('ezpublish_rest_loadUserGroupsOfUser', array('userId' => $contentInfo->id))
  2. );
  3. $generator->endAttribute('href');
  4. $generator->endObjectElement('Groups');
  5. $generator->startObjectElement('Owner', 'User');

    The next 32 lines appear both in eZ/Publish/Core/REST/Server/Output/ValueObjectVisitor/RestUser.php:105 and eZ/Publish/Core/REST/Server/Output/ValueObjectVisitor/RestUserGroup.php:102.

    Time to fix: about 4 hours
    Open Issue Permalink
    Last edited by Jérôme Vieilledent
  6. $generator->startAttribute(
  7. 'href',
  8. $this->router->generate('ezpublish_rest_loadUser', array('userId' => $contentInfo->ownerId))
  9. );
  10. $generator->endAttribute('href');
  1. * File containing the ContentId criterion visitor class.
  2. *
  3. * @copyright Copyright (C) eZ Systems AS. All rights reserved.
  4. * @license For full copyright and license information view LICENSE file distributed with this source code.
  5. */
  6. namespace eZ\Publish\Core\Search\Elasticsearch\Content\CriterionVisitor;

    The next 41 lines appear both in eZ/Publish/Core/Search/Elasticsearch/Content/CriterionVisitor/ContentIdIn.php:9 and eZ/Publish/Core/Search/Elasticsearch/Content/Location/CriterionVisitor/ContentIdIn.php:9.

    Time to fix: about 4 hours
    Open Issue Permalink
    Last edited by Petar Španja
  7. use eZ\Publish\Core\Search\Elasticsearch\Content\CriterionVisitorDispatcher as Dispatcher;
  8. use eZ\Publish\Core\Search\Elasticsearch\Content\CriterionVisitor;
  9. use eZ\Publish\API\Repository\Values\Content\Query\Criterion;
  10. use eZ\Publish\API\Repository\Values\Content\Query\Criterion\Operator;
  1. * File containing the ContentTypeGroupIdIn criterion visitor class.
  2. *
  3. * @copyright Copyright (C) eZ Systems AS. All rights reserved.
  4. * @license For full copyright and license information view LICENSE file distributed with this source code.
  5. */
  6. namespace eZ\Publish\Core\Search\Elasticsearch\Content\CriterionVisitor;

    The next 43 lines appear both in eZ/Publish/Core/Search/Elasticsearch/Content/CriterionVisitor/ContentTypeGroupIdIn.php:9 and eZ/Publish/Core/Search/Elasticsearch/Content/Location/CriterionVisitor/ContentTypeGroupIdIn.php:9.

    Time to fix: about 4 hours
    Open Issue Permalink
    Last edited by Petar Španja
  7. use eZ\Publish\Core\Search\Elasticsearch\Content\CriterionVisitorDispatcher as Dispatcher;
  8. use eZ\Publish\Core\Search\Elasticsearch\Content\CriterionVisitor;
  9. use eZ\Publish\API\Repository\Values\Content\Query\Criterion;
  10. use eZ\Publish\API\Repository\Values\Content\Query\Criterion\Operator;
  1. * File containing the ContentTypeIdentifierIn criterion visitor class.
  2. *
  3. * @copyright Copyright (C) eZ Systems AS. All rights reserved.
  4. * @license For full copyright and license information view LICENSE file distributed with this source code.
  5. */
  6. namespace eZ\Publish\Core\Search\Elasticsearch\Content\CriterionVisitor;

    The next 66 lines appear both in eZ/Publish/Core/Search/Elasticsearch/Content/CriterionVisitor/ContentTypeIdentifierIn.php:9 and eZ/Publish/Core/Search/Elasticsearch/Content/Location/CriterionVisitor/ContentTypeIdentifierIn.php:9.

    Time to fix: about 4 hours
    Open Issue Permalink
    Last edited by Petar Španja
  7. use eZ\Publish\Core\Search\Elasticsearch\Content\CriterionVisitorDispatcher as Dispatcher;
  8. use eZ\Publish\Core\Search\Elasticsearch\Content\CriterionVisitor;
  9. use eZ\Publish\API\Repository\Values\Content\Query\Criterion;
  10. use eZ\Publish\API\Repository\Values\Content\Query\Criterion\Operator;
  1. * File containing the ContentTypeIdIn criterion visitor class.
  2. *
  3. * @copyright Copyright (C) eZ Systems AS. All rights reserved.
  4. * @license For full copyright and license information view LICENSE file distributed with this source code.
  5. */
  6. namespace eZ\Publish\Core\Search\Elasticsearch\Content\CriterionVisitor;

    The next 43 lines appear both in eZ/Publish/Core/Search/Elasticsearch/Content/CriterionVisitor/ContentTypeIdIn.php:9 and eZ/Publish/Core/Search/Elasticsearch/Content/Location/CriterionVisitor/ContentTypeIdIn.php:9.

    Time to fix: about 4 hours
    Open Issue Permalink
    Last edited by Petar Španja
  7. use eZ\Publish\Core\Search\Elasticsearch\Content\CriterionVisitorDispatcher as Dispatcher;
  8. use eZ\Publish\Core\Search\Elasticsearch\Content\CriterionVisitor;
  9. use eZ\Publish\API\Repository\Values\Content\Query\Criterion;
  10. use eZ\Publish\API\Repository\Values\Content\Query\Criterion\Operator;
  1. * File containing the ModifiedBetween criterion visitor class.
  2. *
  3. * @copyright Copyright (C) eZ Systems AS. All rights reserved.
  4. * @license For full copyright and license information view LICENSE file distributed with this source code.
  5. */
  6. namespace eZ\Publish\Core\Search\Elasticsearch\Content\CriterionVisitor\DateMetadata;

    The next 45 lines appear both in eZ/Publish/Core/Search/Elasticsearch/Content/CriterionVisitor/DateMetadata/ModifiedIn.php:9 and eZ/Publish/Core/Search/Elasticsearch/Content/Location/CriterionVisitor/DateMetadata/ModifiedIn.php:9.

    Time to fix: about 4 hours
    Open Issue Permalink
    Last edited by Petar Španja
  7. use eZ\Publish\Core\Search\Elasticsearch\Content\CriterionVisitorDispatcher as Dispatcher;
  8. use eZ\Publish\Core\Search\Elasticsearch\Content\CriterionVisitor\DateMetadata;
  9. use eZ\Publish\API\Repository\Values\Content\Query\Criterion;
  10. use eZ\Publish\API\Repository\Values\Content\Query\Criterion\Operator;
  1. * File containing the ModifiedRange criterion visitor class.
  2. *
  3. * @copyright Copyright (C) eZ Systems AS. All rights reserved.
  4. * @license For full copyright and license information view LICENSE file distributed with this source code.
  5. */
  6. namespace eZ\Publish\Core\Search\Elasticsearch\Content\CriterionVisitor\DateMetadata;

    The next 49 lines appear both in eZ/Publish/Core/Search/Elasticsearch/Content/CriterionVisitor/DateMetadata/ModifiedRange.php:9 and eZ/Publish/Core/Search/Elasticsearch/Content/Location/CriterionVisitor/DateMetadata/ModifiedRange.php:9.

    Time to fix: about 4 hours
    Open Issue Permalink
    Last edited by Petar Španja
  7. use eZ\Publish\Core\Search\Elasticsearch\Content\CriterionVisitorDispatcher as Dispatcher;
  8. use eZ\Publish\Core\Search\Elasticsearch\Content\CriterionVisitor\DateMetadata;
  9. use eZ\Publish\API\Repository\Values\Content\Query\Criterion;
  10. use eZ\Publish\API\Repository\Values\Content\Query\Criterion\Operator;
  1. */
  2. public function canVisit(Criterion $criterion)
  3. {
  4. return
  5. $criterion instanceof Criterion\DateMetadata &&
  6. $criterion->target === 'modified' &&

    The next 26 lines appear both in eZ/Publish/Core/Search/Elasticsearch/Content/CriterionVisitor/DateMetadata/ModifiedRange.php:32 and eZ/Publish/Core/Search/Elasticsearch/Content/CriterionVisitor/DateMetadata/PublishedRange.php:32.

    Time to fix: about 4 hours
    Open Issue Permalink
    Last edited by Jérôme Vieilledent
  7. (
  8. $criterion->operator === Operator::LT ||
  9. $criterion->operator === Operator::LTE ||
  10. $criterion->operator === Operator::GT ||
  11. $criterion->operator === Operator::GTE ||
  1. * File containing the ModifiedBetween criterion visitor class.
  2. *
  3. * @copyright Copyright (C) eZ Systems AS. All rights reserved.
  4. * @license For full copyright and license information view LICENSE file distributed with this source code.
  5. */
  6. namespace eZ\Publish\Core\Search\Elasticsearch\Content\CriterionVisitor\DateMetadata;

    The next 45 lines appear both in eZ/Publish/Core/Search/Elasticsearch/Content/CriterionVisitor/DateMetadata/PublishedIn.php:9 and eZ/Publish/Core/Search/Elasticsearch/Content/Location/CriterionVisitor/DateMetadata/PublishedIn.php:9.

    Time to fix: about 4 hours
    Open Issue Permalink
    Last edited by Petar Španja
  7. use eZ\Publish\Core\Search\Elasticsearch\Content\CriterionVisitorDispatcher as Dispatcher;
  8. use eZ\Publish\Core\Search\Elasticsearch\Content\CriterionVisitor\DateMetadata;
  9. use eZ\Publish\API\Repository\Values\Content\Query\Criterion;
  10. use eZ\Publish\API\Repository\Values\Content\Query\Criterion\Operator;
  1. * File containing the PublishedRange criterion visitor class.
  2. *
  3. * @copyright Copyright (C) eZ Systems AS. All rights reserved.
  4. * @license For full copyright and license information view LICENSE file distributed with this source code.
  5. */
  6. namespace eZ\Publish\Core\Search\Elasticsearch\Content\CriterionVisitor\DateMetadata;

    The next 49 lines appear both in eZ/Publish/Core/Search/Elasticsearch/Content/CriterionVisitor/DateMetadata/PublishedRange.php:9 and eZ/Publish/Core/Search/Elasticsearch/Content/Location/CriterionVisitor/DateMetadata/PublishedRange.php:9.

    Time to fix: about 4 hours
    Open Issue Permalink
    Last edited by Petar Španja
  7. use eZ\Publish\Core\Search\Elasticsearch\Content\CriterionVisitorDispatcher as Dispatcher;
  8. use eZ\Publish\Core\Search\Elasticsearch\Content\CriterionVisitor\DateMetadata;
  9. use eZ\Publish\API\Repository\Values\Content\Query\Criterion;
  10. use eZ\Publish\API\Repository\Values\Content\Query\Criterion\Operator;
  1. * @param \eZ\Publish\Core\Search\Elasticsearch\Content\CriterionVisitorDispatcher $dispatcher
  2. * @param array $languageFilter
  3. *
  4. * @return mixed
  5. */
  6. public function visitFilter(Criterion $criterion, Dispatcher $dispatcher, array $languageFilter)

    The next 64 lines appear both in eZ/Publish/Core/Search/Elasticsearch/Content/CriterionVisitor/Field/FieldIn.php:96 and eZ/Publish/Core/Search/Elasticsearch/Content/CriterionVisitor/FullText.php:116.

    Time to fix: about 4 hours
    Open Issue Permalink
    Last edited by André R
  7. {
  8. $filter = array(
  9. 'nested' => array(
  10. 'path' => 'fields_doc',
  11. 'filter' => array(
  1. * File containing the LanguageCodeIn criterion visitor class.
  2. *
  3. * @copyright Copyright (C) eZ Systems AS. All rights reserved.
  4. * @license For full copyright and license information view LICENSE file distributed with this source code.
  5. */
  6. namespace eZ\Publish\Core\Search\Elasticsearch\Content\CriterionVisitor;

    The next 41 lines appear both in eZ/Publish/Core/Search/Elasticsearch/Content/CriterionVisitor/LanguageCodeIn.php:9 and eZ/Publish/Core/Search/Elasticsearch/Content/Location/CriterionVisitor/LanguageCodeIn.php:9.

    Time to fix: about 4 hours
    Open Issue Permalink
    Last edited by Petar Španja
  7. use eZ\Publish\Core\Search\Elasticsearch\Content\CriterionVisitorDispatcher as Dispatcher;
  8. use eZ\Publish\Core\Search\Elasticsearch\Content\CriterionVisitor;
  9. use eZ\Publish\API\Repository\Values\Content\Query\Criterion;
  10. use eZ\Publish\API\Repository\Values\Content\Query\Criterion\Operator;
  1. * File containing the ObjectStateIdIn criterion visitor class.
  2. *
  3. * @copyright Copyright (C) eZ Systems AS. All rights reserved.
  4. * @license For full copyright and license information view LICENSE file distributed with this source code.
  5. */
  6. namespace eZ\Publish\Core\Search\Elasticsearch\Content\CriterionVisitor;

    The next 41 lines appear both in eZ/Publish/Core/Search/Elasticsearch/Content/CriterionVisitor/ObjectStateIdIn.php:9 and eZ/Publish/Core/Search/Elasticsearch/Content/Location/CriterionVisitor/ObjectStateIdIn.php:9.

    Time to fix: about 4 hours
    Open Issue Permalink
    Last edited by Petar Španja
  7. use eZ\Publish\Core\Search\Elasticsearch\Content\CriterionVisitorDispatcher as Dispatcher;
  8. use eZ\Publish\Core\Search\Elasticsearch\Content\CriterionVisitor;
  9. use eZ\Publish\API\Repository\Values\Content\Query\Criterion;
  10. use eZ\Publish\API\Repository\Values\Content\Query\Criterion\Operator;
  1. * File containing the RemoteId criterion visitor class.
  2. *
  3. * @copyright Copyright (C) eZ Systems AS. All rights reserved.
  4. * @license For full copyright and license information view LICENSE file distributed with this source code.
  5. */
  6. namespace eZ\Publish\Core\Search\Elasticsearch\Content\CriterionVisitor;

    The next 43 lines appear both in eZ/Publish/Core/Search/Elasticsearch/Content/CriterionVisitor/RemoteIdIn.php:9 and eZ/Publish/Core/Search/Elasticsearch/Content/Location/CriterionVisitor/RemoteIdIn.php:9.

    Time to fix: about 4 hours
    Open Issue Permalink
    Last edited by Petar Španja
  7. use eZ\Publish\Core\Search\Elasticsearch\Content\CriterionVisitorDispatcher as Dispatcher;
  8. use eZ\Publish\Core\Search\Elasticsearch\Content\CriterionVisitor;
  9. use eZ\Publish\API\Repository\Values\Content\Query\Criterion;
  10. use eZ\Publish\API\Repository\Values\Content\Query\Criterion\Operator;
  1. * File containing the SectionId criterion visitor class.
  2. *
  3. * @copyright Copyright (C) eZ Systems AS. All rights reserved.
  4. * @license For full copyright and license information view LICENSE file distributed with this source code.
  5. */
  6. namespace eZ\Publish\Core\Search\Elasticsearch\Content\CriterionVisitor;

    The next 43 lines appear both in eZ/Publish/Core/Search/Elasticsearch/Content/CriterionVisitor/SectionIdIn.php:9 and eZ/Publish/Core/Search/Elasticsearch/Content/Location/CriterionVisitor/SectionIdIn.php:9.

    Time to fix: about 4 hours
    Open Issue Permalink
    Last edited by Petar Španja
  7. use eZ\Publish\Core\Search\Elasticsearch\Content\CriterionVisitorDispatcher as Dispatcher;
  8. use eZ\Publish\Core\Search\Elasticsearch\Content\CriterionVisitor;
  9. use eZ\Publish\API\Repository\Values\Content\Query\Criterion;
  10. use eZ\Publish\API\Repository\Values\Content\Query\Criterion\Operator;
  1. * File containing the SubtreeIn criterion visitor class.
  2. *
  3. * @copyright Copyright (C) eZ Systems AS. All rights reserved.
  4. * @license For full copyright and license information view LICENSE file distributed with this source code.
  5. */
  6. namespace eZ\Publish\Core\Search\Elasticsearch\Content\CriterionVisitor;

    The next 43 lines appear both in eZ/Publish/Core/Search/Elasticsearch/Content/CriterionVisitor/SubtreeIn.php:9 and eZ/Publish/Core/Search/Elasticsearch/Content/Location/CriterionVisitor/SubtreeIn.php:9.

    Time to fix: about 4 hours
    Open Issue Permalink
    Last edited by Petar Španja
  7. use eZ\Publish\Core\Search\Elasticsearch\Content\CriterionVisitorDispatcher as Dispatcher;
  8. use eZ\Publish\Core\Search\Elasticsearch\Content\CriterionVisitor;
  9. use eZ\Publish\API\Repository\Values\Content\Query\Criterion;
  10. use eZ\Publish\API\Repository\Values\Content\Query\Criterion\Operator;
  1. * File containing the UserMetadataIn criterion visitor class.
  2. *
  3. * @copyright Copyright (C) eZ Systems AS. All rights reserved.
  4. * @license For full copyright and license information view LICENSE file distributed with this source code.
  5. */
  6. namespace eZ\Publish\Core\Search\Elasticsearch\Content\CriterionVisitor;

    The next 46 lines appear both in eZ/Publish/Core/Search/Elasticsearch/Content/CriterionVisitor/UserMetadataIn.php:9 and eZ/Publish/Core/Search/Elasticsearch/Content/Location/CriterionVisitor/UserMetadataIn.php:9.

    Time to fix: about 4 hours
    Open Issue Permalink
    Last edited by Petar Španja
  7. use eZ\Publish\Core\Search\Elasticsearch\Content\CriterionVisitorDispatcher as Dispatcher;
  8. use eZ\Publish\Core\Search\Elasticsearch\Content\CriterionVisitor;
  9. use eZ\Publish\API\Repository\Exceptions\NotImplementedException;
  10. use eZ\Publish\API\Repository\Values\Content\Query\Criterion;
  1. * @return bool
  2. */
  3. public function canVisit(Criterion $criterion)
  4. {
  5. return
  6. $criterion instanceof Criterion\Location\Depth &&

    The next 28 lines appear both in eZ/Publish/Core/Search/Elasticsearch/Content/Location/CriterionVisitor/Location/DepthRange.php:31 and eZ/Publish/Core/Search/Elasticsearch/Content/Location/CriterionVisitor/Location/PriorityRange.php:31.

    Time to fix: about 4 hours
    Open Issue Permalink
    Last edited by Petar Španja
  7. (
  8. $criterion->operator === Operator::LT ||
  9. $criterion->operator === Operator::LTE ||
  10. $criterion->operator === Operator::GT ||
  11. $criterion->operator === Operator::GTE ||
  1. * File containing the SortClauseVisitor\Aggregate class.
  2. *
  3. * @copyright Copyright (C) eZ Systems AS. All rights reserved.
  4. * @license For full copyright and license information view LICENSE file distributed with this source code.
  5. */
  6. namespace eZ\Publish\Core\Search\Elasticsearch\Content\Location\SortClauseVisitor;

    The next 71 lines appear both in eZ/Publish/Core/Search/Elasticsearch/Content/Location/SortClauseVisitor/Aggregate.php:9 and eZ/Publish/Core/Search/Elasticsearch/Content/SortClauseVisitor/Aggregate.php:9.

    Time to fix: about 4 hours
    Open Issue Permalink
    Last edited by Petar Španja
  7. use eZ\Publish\Core\Search\Elasticsearch\Content\SortClauseVisitor;
  8. use eZ\Publish\API\Repository\Values\Content\Query\SortClause;
  9. use eZ\Publish\API\Repository\Exceptions\NotImplementedException;
  1. $column = $this->dbHandler->quoteColumn(
  2. $criterion->target === Criterion\DateMetadata::MODIFIED ? 'modified' : 'published',
  3. 'ezcontentobject'
  4. );
  5. switch ($criterion->operator) {

    The next 29 lines appear both in eZ/Publish/Core/Search/Legacy/Content/Common/Gateway/CriterionHandler/DateMetadata.php:57 and eZ/Publish/Core/Search/Legacy/Content/Location/Gateway/CriterionHandler/Location/Depth.php:54.

    Time to fix: about 4 hours
    Open Issue Permalink
    Last edited by Jérôme Vieilledent
  6. case Criterion\Operator::IN:
  7. return $query->expr->in(
  8. $column,
  9. $criterion->value
  10. );
  1. ),
  2. $query->bindValue(1, null, PDO::PARAM_INT)
  3. );
  4. $rightSide = $query->expr->bitAnd(
  5. $this->dbHandler->quoteColumn('language_id', 'ezcontentobject_attribute'),
  6. $query->bindValue(1, null, PDO::PARAM_INT)

    The next 13 lines appear both in eZ/Publish/Core/Search/Legacy/Content/Common/Gateway/CriterionHandler/FieldBase.php:89 and eZ/Publish/Core/Search/Legacy/Content/Common/Gateway/SortClauseHandler/Field.php:215.

    Time to fix: about 4 hours
    Open Issue Permalink
    Last edited by Petar Španja
  7. );
  8. for ($index = count($languageSettings['languages']) - 1, $multiplier = 2; $index >= 0; $index--, $multiplier *= 2) {
  9. $languageId = $this->languageHandler
  10. ->loadByLanguageCode($languageSettings['languages'][$index])->id;
  1. $addToRightSide = $query->expr->bitAnd(
  2. $this->dbHandler->quoteColumn('language_id', 'ezcontentobject_attribute'),
  3. $languageId
  4. );
  5. if ($multiplier > $languageId) {

    The next 23 lines appear both in eZ/Publish/Core/Search/Legacy/Content/Common/Gateway/CriterionHandler/FieldBase.php:111 and eZ/Publish/Core/Search/Legacy/Content/Common/Gateway/SortClauseHandler/Field.php:237.

    Time to fix: about 4 hours
    Open Issue Permalink
    Last edited by Petar Španja
  6. $factor = $multiplier / $languageId;
  7. for ($shift = 0; $factor > 1; $factor = $factor / 2, $shift++);
  8. $factorTerm = ' << ' . $shift;
  9. $addToLeftSide .= $factorTerm;
  10. $addToRightSide .= $factorTerm;
  1. }
  2. $fieldDefinitionId = $fieldMap[$fieldTarget->typeIdentifier][$fieldTarget->fieldIdentifier]['field_definition_id'];
  3. $table = $this->getSortTableName($number);
  4. $query

    The next 20 lines appear both in eZ/Publish/Core/Search/Legacy/Content/Common/Gateway/SortClauseHandler/Field.php:156 and eZ/Publish/Core/Search/Legacy/Content/Common/Gateway/SortClauseHandler/MapLocationDistance.php:119.

    Time to fix: about 4 hours
    Open Issue Permalink
    Last edited by Petar Španja
  5. ->leftJoin(
  6. $query->alias(
  7. $this->dbHandler->quoteTable('ezcontentobject_attribute'),
  8. $this->dbHandler->quoteIdentifier($table)
  9. ),
  1. * This file is part of the eZ Publish Kernel package.
  2. *
  3. * @copyright Copyright (C) eZ Systems AS. All rights reserved.
  4. * @license For full copyright and license information view LICENSE file distributed with this source code.
  5. */
  6. namespace eZ\Publish\Core\Search\Legacy\Content\Gateway\CriterionHandler;

    The next 46 lines appear both in eZ/Publish/Core/Search/Legacy/Content/Gateway/CriterionHandler/Ancestor.php:9 and eZ/Publish/Core/Search/Legacy/Content/Location/Gateway/CriterionHandler/Ancestor.php:9.

    Time to fix: about 4 hours
    Open Issue Permalink
    Last edited by Petar Španja
  7. use eZ\Publish\Core\Search\Legacy\Content\Common\Gateway\CriterionHandler;
  8. use eZ\Publish\Core\Search\Legacy\Content\Common\Gateway\CriteriaConverter;
  9. use eZ\Publish\API\Repository\Values\Content\Query\Criterion;
  10. use eZ\Publish\Core\Persistence\Database\SelectQuery;

The Symfony Dependency Injection Container should not be passed as an argument 8

More information: https://insight.symfony.com/what-we-analyse/symfony.dependency_injection.no_container_as_parameter

  1. *
  2. * @param \Symfony\Component\DependencyInjection\ContainerInterface $container
  3. * @param array $enabledCustomTags List of Custom Tags enabled for the current scope/SiteAccess
  4. */
  5. private function validateCustomTagsConfiguration(
  6. ContainerInterface $container,

    A Symfony dependency injection container has been found as an argument.

    Time to fix: about 4 hours
    Open Issue Permalink
    Last edited by Andrew Longosz
  7. array $enabledCustomTags
  8. ) {
  9. $definedCustomTags = array_keys(
  10. $container->getParameter(EzPublishCoreExtension::RICHTEXT_CUSTOM_TAGS_PARAMETER)
  11. );
  1. /**
  2. * @var ContextualizerInterface
  3. */
  4. protected $contextualizer;
  5. public function __construct(ContainerInterface $containerBuilder, $namespace, $siteAcccessNodeName = 'system')

    A Symfony dependency injection container has been found as an argument.

    Time to fix: about 4 hours
    Open Issue Permalink
    Last edited by Jérôme Vieilledent
  6. {
  7. $this->contextualizer = $this->buildContextualizer($containerBuilder, $namespace, $siteAcccessNodeName);
  8. }
  9. /**
  1. * @param string $namespace
  2. * @param string $siteAccessNodeName
  3. *
  4. * @return \eZ\Bundle\EzPublishCoreBundle\DependencyInjection\Configuration\SiteAccessAware\ContextualizerInterface
  5. */
  6. protected function buildContextualizer(ContainerInterface $containerBuilder, $namespace, $siteAccessNodeName)

    A Symfony dependency injection container has been found as an argument.

    Time to fix: about 4 hours
    Open Issue Permalink
    Last edited by Jérôme Vieilledent
  7. {
  8. return new Contextualizer($containerBuilder, $namespace, $siteAccessNodeName, static::$availableSiteAccesses, static::$groupsBySiteAccess);
  9. }
  10. /**
  1. public function getContainer();
  2. /**
  3. * @param \Symfony\Component\DependencyInjection\ContainerInterface $container
  4. */
  5. public function setContainer(ContainerInterface $container);

    A Symfony dependency injection container has been found as an argument.

    Time to fix: about 4 hours
    Open Issue Permalink
    Last edited by Jérôme Vieilledent
  6. /**
  7. * Injects namespace for internal settings.
  8. * Registered internal settings always have the format <namespace>.<scope>.<parameter_name>
  9. * e.g. ezsettings.default.session.
  1. * @var array
  2. */
  3. private $groupsBySiteAccess;
  4. public function __construct(
  5. ContainerInterface $containerBuilder,

    A Symfony dependency injection container has been found as an argument.

    Time to fix: about 4 hours
    Open Issue Permalink
    Last edited by Jérôme Vieilledent
  6. $namespace,
  7. $siteAccessNodeName,
  8. array $availableSiteAccesses,
  9. array $groupsBySiteAccess
  10. ) {
  1. }
  2. $this->container->setParameter($key, $value);
  3. }
  4. }
  5. public function setContainer(ContainerInterface $container)

    A Symfony dependency injection container has been found as an argument.

    Time to fix: about 4 hours
    Open Issue Permalink
    Last edited by Jérôme Vieilledent
  6. {
  7. $this->container = $container;
  8. }
  9. public function getContainer()
  1. $this->resettableServiceIds = $resettableServiceIds;
  2. $this->updatableServices = $updatableServices;
  3. $this->expressionLanguage = $expressionLanguage ?: new ExpressionLanguage();
  4. }
  5. public function setContainer(ContainerInterface $container)

    A Symfony dependency injection container has been found as an argument.

    Time to fix: about 4 hours
    Open Issue Permalink
    Last edited by André R
  6. {
  7. $this->container = $container;
  8. }
  9. public static function getSubscribedEvents()
  1. /**
  2. * @var \Symfony\Component\DependencyInjection\ContainerInterface
  3. */
  4. protected $container;
  5. public function __construct(ContainerInterface $container)

    A Symfony dependency injection container has been found as an argument.

    Time to fix: about 4 hours
    Open Issue Permalink
    Last edited by Jérôme Vieilledent
  6. {
  7. $this->container = $container;
  8. }
  9. /**

Error silenced by the at sign (@) 7

More information: https://insight.symfony.com/what-we-analyse/php.silenced_error

  1. *
  2. * @deprecated Deprecated since 6.5. Use SessionController::refreshSessionAction().
  3. */
  4. public function createSession(Request $request)
  5. {
  6. @trigger_error(

    Adding "@" before trigger_error(E_USER_DEPRECATED, 'The session actions from the User controller are deprecated since 6.5. Use the SessionController instead.') prevents warning and errors during this function execution from being displayed.
    If you need to do that, you should probably implement a better way to qualify and recover from errors, using Exceptions.

    Time to fix: about 4 hours
    Open Issue Permalink
    Last edited by Bertrand Dunogier
  7. E_USER_DEPRECATED,
  8. 'The session actions from the User controller are deprecated since 6.5. Use the SessionController instead.'
  9. );
  10. return $this->sessionController->createSessionAction($request);
  1. *
  2. * @deprecated Deprecated since 6.5. Use SessionController::refreshSessionAction().
  3. */
  4. public function refreshSession($sessionId, Request $request)
  5. {
  6. @trigger_error(

    Adding "@" before trigger_error(E_USER_DEPRECATED, 'The session actions from the User controller are deprecated since 6.5. Use the SessionController instead.') prevents warning and errors during this function execution from being displayed.
    If you need to do that, you should probably implement a better way to qualify and recover from errors, using Exceptions.

    Time to fix: about 4 hours
    Open Issue Permalink
    Last edited by Bertrand Dunogier
  7. E_USER_DEPRECATED,
  8. 'The session actions from the User controller are deprecated since 6.5. Use the SessionController instead.'
  9. );
  10. return $this->sessionController->refreshSessionAction($sessionId, $request);
  1. *
  2. * @deprecated Deprecated since 6.5. Use SessionController::refreshSessionAction().
  3. */
  4. public function deleteSession($sessionId, Request $request)
  5. {
  6. @trigger_error(

    Adding "@" before trigger_error(E_USER_DEPRECATED, 'The session actions from the User controller are deprecated since 6.5. Use the SessionController instead.') prevents warning and errors during this function execution from being displayed.
    If you need to do that, you should probably implement a better way to qualify and recover from errors, using Exceptions.

    Time to fix: about 4 hours
    Open Issue Permalink
    Last edited by Bertrand Dunogier
  7. E_USER_DEPRECATED,
  8. 'The session actions from the User controller are deprecated since 6.5. Use the SessionController instead.'
  9. );
  10. return $this->sessionController->deleteSessionAction($sessionId, $request);
  1. return array_pop($pathParts);
  2. }
  3. public function setTokenStorage(TokenStorageInterface $csrfTokenStorage)
  4. {
  5. @trigger_error(

    Adding "@" before trigger_error(E_USER_DEPRECATED, 'setTokenStorage() is deprecated since 6.5 and will be removed in 7.0.') prevents warning and errors during this function execution from being displayed.
    If you need to do that, you should probably implement a better way to qualify and recover from errors, using Exceptions.

    Time to fix: about 4 hours
    Open Issue Permalink
    Last edited by Bertrand Dunogier
  6. E_USER_DEPRECATED,
  7. 'setTokenStorage() is deprecated since 6.5 and will be removed in 7.0.'
  8. );
  9. $this->csrfTokenStorage = $csrfTokenStorage;
  1. $cpuinfo = file_get_contents('/proc/cpuinfo');
  2. preg_match_all('/^processor/m', $cpuinfo, $matches);
  3. $cores = count($matches[0]);
  4. } elseif (DIRECTORY_SEPARATOR === '\\') {
  5. // Windows
  6. if (($process = @popen('wmic cpu get NumberOfCores', 'rb')) !== false) {

    Adding "@" before popen('wmic cpu get NumberOfCores', 'rb') prevents warning and errors during this function execution from being displayed.
    If you need to do that, you should probably implement a better way to qualify and recover from errors, using Exceptions.

    Time to fix: about 4 hours
    Open Issue Permalink
    Last edited by André R
  7. fgets($process);
  8. $cores = (int) fgets($process);
  9. pclose($process);
  10. }
  11. } elseif (($process = @popen('sysctl -a', 'rb')) !== false) {
  1. if (($process = @popen('wmic cpu get NumberOfCores', 'rb')) !== false) {
  2. fgets($process);
  3. $cores = (int) fgets($process);
  4. pclose($process);
  5. }
  6. } elseif (($process = @popen('sysctl -a', 'rb')) !== false) {

    Adding "@" before popen('sysctl -a', 'rb') prevents warning and errors during this function execution from being displayed.
    If you need to do that, you should probably implement a better way to qualify and recover from errors, using Exceptions.

    Time to fix: about 4 hours
    Open Issue Permalink
    Last edited by André R
  7. // *nix (Linux, BSD and Mac)
  8. $output = stream_get_contents($process);
  9. if (preg_match('/hw.ncpu: (\d+)/', $output, $matches)) {
  10. $cores = (int) $matches[1][0];
  11. }
  1. * @return bool
  2. */
  3. public function __isset($property)
  4. {
  5. if ($property === 'defaultLanguageCode') {
  6. @trigger_error(

    Adding "@" before trigger_error(__CLASS__ . '::$defaultLanguageCode is deprecated. Use mainLanguageCode') prevents warning and errors during this function execution from being displayed.
    If you need to do that, you should probably implement a better way to qualify and recover from errors, using Exceptions.

    Time to fix: about 4 hours
    Open Issue Permalink
    Last edited by Andrew Longosz
  7. __CLASS__ . '::$defaultLanguageCode is deprecated. Use mainLanguageCode'
  8. );
  9. return true;
  10. }

PHPUnit should be able to run all PHP tests

More information: https://insight.symfony.com/what-we-analyse/php.neglected_tests

This file is not included in any of the tests suites present in the source code (phpunit-functional-rest.xml, phpunit-integration-legacy-elasticsearch.xml, phpunit-integration-legacy-solr.xml, phpunit-integration-legacy.xml, phpunit-integration-rest-json.xml, phpunit-integration-rest-xml.xml, phpunit.xml).

Time to fix: about 1 hour
Open Issue Permalink
Collective

Object parameters should be type hinted 4

More information: https://insight.symfony.com/what-we-analyse/php.object_parameter_not_type_hinted

  1. $objectStateHandler = $this->persistence->objectStateHandler();
  2. $stateGroups = $objectStateHandler->loadAllGroups();
  3. $groupedLimitationValues = [];
  4. foreach ($stateGroups as $stateGroup) {
  5. $states = $objectStateHandler->loadObjectStates($stateGroup->id);
  6. $stateIds = array_map(function ($state) {

    The parameter state, which is an object, should be typehinted.

    Time to fix: about 1 hour
    Open Issue Permalink
    Last edited by Jacek Foremski
  7. return $state->id;
  8. }, $states);
  9. $limitationValuesGroup = array_intersect($stateIds, $limitationValues);
  10. if (!empty($limitationValuesGroup)) {
  11. $groupedLimitationValues[] = array_values($limitationValuesGroup);
  1. $this->cache->invalidateTags(['content-' . $contentId]);
  2. if (!empty($reverseRelations)) {
  3. $this->cache->invalidateTags(
  4. array_map(
  5. function ($relation) {

    The parameter relation, which is an object, should be typehinted.

    Time to fix: about 1 hour
    Open Issue Permalink
    Last edited by André R
  6. // only the full content object *with* fields is affected by this
  7. return 'content-fields-' . $relation->sourceContentId;
  8. },
  9. $reverseRelations
  10. )
  1. *
  2. * @param mixed $data
  3. *
  4. * @return \eZ\Publish\API\Repository\Values\Content\Search\SearchResult
  5. */
  6. public function extract($data)

    The parameter data, which is an object, should be typehinted.

    Time to fix: about 1 hour
    Open Issue Permalink
    Last edited by Jérôme Vieilledent
  7. {
  8. $result = new SearchResult(
  9. array(
  10. 'time' => $data->took,
  11. 'maxScore' => $data->hits->max_score,
  1. *
  2. * @param mixed $data
  3. *
  4. * @return array
  5. */
  6. protected function mapData($data)

    The parameter data, which is an object, should be typehinted.

    Time to fix: about 1 hour
    Open Issue Permalink
    Last edited by Jérôme Vieilledent
  7. {
  8. $values = array();
  9. foreach ($data->buckets as $bucket) {
  10. $values[$bucket->key] = $bucket->doc_count;

Booleans and null should be compared strictly 6

More information: https://insight.symfony.com/what-we-analyse/php.strict_boolean_comparison_should_be_used

  1. * @param bool $required True if the is the field required, optional
  2. */
  3. public function createField($fieldType, $name = null, $required = false)
  4. {
  5. $fieldPosition = $this->getActualFieldPosition();
  6. $name = ($name == null ? $fieldType : $name);

    With booleans and null, only strict comparison (with === operator) should be used to lower bug risks and to improve performances.

    Time to fix: about 15 minutes
    Open Issue Permalink
    Last edited by Miguel Jacinto
  7. $fieldCreateStruct = $this->contentTypeService->newFieldDefinitionCreateStruct(
  8. $name,
  9. $this->fieldTypeInternalIdentifier[$fieldType]
  10. );
  11. $fieldCreateStruct->names = array(self::DEFAULT_LANGUAGE => $name);
  1. */
  2. public function addValueConstraint($fieldType, $value, $constraint)
  3. {
  4. $validatorName = $this->getFieldValidator($fieldType);
  5. $validatorParent = $validatorName . 'Validator';
  6. if ($this->fieldConstructionObject['fieldType']->validatorConfiguration == null) {

    With booleans and null, only strict comparison (with === operator) should be used to lower bug risks and to improve performances.

    Time to fix: about 15 minutes
    Open Issue Permalink
    Last edited by Miguel Jacinto
  7. $this->fieldConstructionObject['fieldType']->validatorConfiguration = array(
  8. $validatorParent => array(),
  9. );
  10. }
  11. $value = is_numeric($value) ? $value + 0 : $value;
  1. $languageCode = self::DEFAULT_LANGUAGE;
  2. $locationCreateStruct = $this->locationService->newLocationCreateStruct('2');
  3. $contentType = $this->fieldConstructionObject['contentType'];
  4. $contentCreateStruct = $this->contentService->newContentCreateStruct($contentType, $languageCode);
  5. if ($field != null && $value != null) {

    With booleans and null, only strict comparison (with !== operator) should be used to lower bug risks and to improve performances.

    Time to fix: about 15 minutes
    Open Issue Permalink
    Last edited by Miguel Jacinto
  6. $value = ($value == 'empty') ? null : $value;
  7. $value = is_numeric($value) ? $value + 0 : $value;
  8. $contentCreateStruct->setField($field, $value);
  9. }
  10. $draft = $this->contentService->createContent($contentCreateStruct, array($locationCreateStruct));
  1. /**
  2. * Getter method for the position of the field, relative to other possible fields.
  3. */
  4. private function getActualFieldPosition()
  5. {
  6. if ($this->fieldConstructionObject['fieldType'] == null) {

    With booleans and null, only strict comparison (with === operator) should be used to lower bug risks and to improve performances.

    Time to fix: about 15 minutes
    Open Issue Permalink
    Last edited by Miguel Jacinto
  7. return 10;
  8. } else {
  9. return $this->fieldConstructionObject['fieldType']->position + 10;
  10. }
  11. }
  1. // response as it can depend on user role for instance.
  2. if ($request->headers->has('X-User-Hash')) {
  3. $response->setVary('X-User-Hash');
  4. }
  5. if ($lastModified != null) {

    With booleans and null, only strict comparison (with !== operator) should be used to lower bug risks and to improve performances.

    Time to fix: about 15 minutes
    Open Issue Permalink
    Last edited by Jérôme Vieilledent
  6. $response->setLastModified($lastModified);
  7. }
  8. }
  9. return $response;
  1. $versionInfo = $content->getVersionInfo();
  2. $contentType = $data->contentType;
  3. $path = $data->path;
  4. if ($path == null) {

    With booleans and null, only strict comparison (with === operator) should be used to lower bug risks and to improve performances.

    Time to fix: about 15 minutes
    Open Issue Permalink
    Last edited by Adam Wójs
  5. $path = $this->router->generate(
  6. 'ezpublish_rest_loadContentInVersion',
  7. array(
  8. 'contentId' => $content->id,
  9. 'versionNumber' => $versionInfo->versionNo,

Boolean property should not be prefixed by "is" 2

More information: https://insight.symfony.com/what-we-analyse/php.bad_mutator_method_name_for_boolean_property

  1. /**
  2. * Sets the value as embed / not embed.
  3. *
  4. * @param bool $value
  5. */
  6. public function setIsEmbed($value)

    Boolean property accessor should not be setIsXXX nor getIsXXX but setXXX and isXXX.

    Time to fix: about 15 minutes
    Open Issue Permalink
    Last edited by Bertrand Dunogier
  7. {
  8. $this->isEmbed = (bool)$value;
  9. }
  10. /**
  1. /**
  2. * Sets the value as embed / not embed.
  3. *
  4. * @param bool $value
  5. */
  6. public function setIsEmbed($value);

    Boolean property accessor should not be setIsXXX nor getIsXXX but setXXX and isXXX.

    Time to fix: about 15 minutes
    Open Issue Permalink
    Last edited by Bertrand Dunogier
  7. /**
  8. * Is the view an embed or not.
  9. *
  10. * @return bool True if the view is an embed, false if it is not.

Unused method, property, variable or parameter 33

More information: https://insight.symfony.com/what-we-analyse/php.unused_local_variable_or_private_member

Updated rule! We've recently tweaked this rule. This may explain the disappearance of false positives, or new suggestions not linked to any activity in the code.
  1. *
  2. * @return mixed The content's main location id
  3. */
  4. public function createContent($contentType, $fields, $parentLocationId)
  5. {
  6. $repository = $this->getRepository();

    This repository local variable is declared but never used. You should remove it.

    Time to fix: about 15 minutes
    Open Issue Permalink
    Last edited by Miguel Jacinto
  7. $languageCode = self::DEFAULT_LANGUAGE;
  8. $content = $this->createContentDraft($parentLocationId, $contentType, $fields, $languageCode);
  9. $content = $this->contentService->publishVersion($content->versionInfo);
  10. return $content->contentInfo->mainLocationId;
  1. */
  2. public function iHaveUser($username)
  3. {
  4. $email = $this->findNonExistingUserEmail($username);
  5. $password = $username;
  6. $user = $this->ensureUserExists($username, $email, $password);

    This user local variable is declared but never used. You should remove it.

    Time to fix: about 15 minutes
    Open Issue Permalink
    Last edited by Miguel Jacinto
  7. }
  8. /**
  9. * @Given there is a User with name :username, email :email and password :password
  10. *
  1. */
  2. public function iHaveUserInGroup($username, $parentGroupName)
  3. {
  4. $email = $this->findNonExistingUserEmail($username);
  5. $password = $username;
  6. $user = $this->ensureUserExists($username, $email, $password, $parentGroupName);

    This user local variable is declared but never used. You should remove it.

    Time to fix: about 15 minutes
    Open Issue Permalink
    Last edited by Miguel Jacinto
  7. }
  8. /**
  9. * @Given there is a User with name :username, email :email and password :password in :parentGroup group
  10. *
  1. "Couldn't find User with name '$username'."
  2. );
  3. $user = $this->userService->loadUserByLogin($username);
  4. $fieldsTable = $table->getTable();
  5. array_shift($fieldsTable);
  6. $updateFields = array();

    This updateFields local variable is declared but never used. You should remove it.

    Time to fix: about 15 minutes
    Open Issue Permalink
    Last edited by Miguel Jacinto
  7. foreach ($fieldsTable as $fieldRow) {
  8. $fieldName = $fieldRow[0];
  9. $expectedValue = $fieldRow[1];
  10. switch ($fieldName) {
  11. case 'email':
  1. *
  2. * @return string A not used name
  3. *
  4. * @throws \Exception Possible endless loop
  5. */
  6. private function findNonExistingUserName()

    This findNonExistingUserName method is declared but never used. You should remove it.

    Time to fix: about 15 minutes
    Open Issue Permalink
    Last edited by Miguel Jacinto
  7. {
  8. for ($i = 0; $i < 20; ++$i) {
  9. $username = 'User#' . uniqid();
  10. if (!$this->checkUserExistenceByUsername($username)) {
  11. return $username;
  1. /**
  2. * @var \Symfony\Component\Security\Csrf\TokenStorage\TokenStorageInterface
  3. * @deprecated This property is deprecated since 6.5, and will be removed in 7.0.
  4. */
  5. private $csrfTokenStorage;

    This csrfTokenStorage attribute is declared but never used. You should remove it.

    Time to fix: about 15 minutes
    Open Issue Permalink
    Last edited by Bertrand Dunogier
  6. /**
  7. * @var \eZ\Publish\Core\REST\Server\Controller\SessionController
  8. * @deprecated This property is added for backward compatibility. It is deprecated, and will be removed in 7.0.
  9. */
  1. private $mainConfigParser;
  2. /**
  3. * @var Configuration\Suggestion\Collector\SuggestionCollectorInterface
  4. */
  5. private $suggestionCollector;

    This suggestionCollector attribute is declared but never used. You should remove it.

    Time to fix: about 15 minutes
    Open Issue Permalink
    Last edited by Jérôme Vieilledent
  6. /**
  7. * @var \eZ\Bundle\EzPublishCoreBundle\SiteAccess\SiteAccessConfigurationFilter[]
  8. */
  9. private $siteAccessConfigurationFilters;
  1. */
  2. private function handleCache(array $config, ContainerBuilder $container, FileLoader $loader)
  3. {
  4. $loader->load('cache.yml');
  5. $purgeService = null;

    This purgeService local variable is declared but never used. You should remove it.

    Time to fix: about 15 minutes
    Open Issue Permalink
    Last edited by Vidar Langseid
  6. if (isset($config['http_cache']['purge_type'])) {
  7. $container->setParameter('ezpublish.http_cache.purge_type', $config['http_cache']['purge_type']);
  8. }
  9. }
  1. private $logger;
  2. /**
  3. * @var \eZ\Publish\Core\MVC\ConfigResolverInterface
  4. */
  5. private $configResolver;

    This configResolver attribute is declared but never used. You should remove it.

    Time to fix: about 15 minutes
    Open Issue Permalink
    Last edited by Jérôme Vieilledent
  6. /**
  7. * @var string
  8. */
  9. private $defaultSiteAccess;
  1. private $configResolver;
  2. /**
  3. * @var string
  4. */
  5. private $defaultSiteAccess;

    This defaultSiteAccess attribute is declared but never used. You should remove it.

    Time to fix: about 15 minutes
    Open Issue Permalink
    Last edited by Jérôme Vieilledent
  6. /**
  7. * @var \Symfony\Component\Routing\RouterInterface
  8. */
  9. private $router;
  1. private $defaultSiteAccess;
  2. /**
  3. * @var \Symfony\Component\Routing\RouterInterface
  4. */
  5. private $router;

    This router attribute is declared but never used. You should remove it.

    Time to fix: about 15 minutes
    Open Issue Permalink
    Last edited by Jérôme Vieilledent
  6. public function __construct(ConfigResolverInterface $configResolver, RouterInterface $router, $defaultSiteAccess, LoggerInterface $logger = null)
  7. {
  8. $this->configResolver = $configResolver;
  9. $this->defaultSiteAccess = $defaultSiteAccess;
  1. use ContainerAwareTrait;
  2. /**
  3. * @var \Symfony\Component\Routing\RouterInterface
  4. */
  5. private $defaultRouter;

    This defaultRouter attribute is declared but never used. You should remove it.

    Time to fix: about 15 minutes
    Open Issue Permalink
    Last edited by Jérôme Vieilledent
  6. /**
  7. * @var \eZ\Publish\Core\MVC\Symfony\Routing\Generator\UrlAliasGenerator
  8. */
  9. private $urlAliasGenerator;
  1. private $defaultRouter;
  2. /**
  3. * @var \eZ\Publish\Core\MVC\Symfony\Routing\Generator\UrlAliasGenerator
  4. */
  5. private $urlAliasGenerator;

    This urlAliasGenerator attribute is declared but never used. You should remove it.

    Time to fix: about 15 minutes
    Open Issue Permalink
    Last edited by Jérôme Vieilledent
  6. /**
  7. * @var \Symfony\Component\Security\Http\HttpUtils
  8. */
  9. private $httpUtils;
  1. private $urlAliasGenerator;
  2. /**
  3. * @var \Symfony\Component\Security\Http\HttpUtils
  4. */
  5. private $httpUtils;

    This httpUtils attribute is declared but never used. You should remove it.

    Time to fix: about 15 minutes
    Open Issue Permalink
    Last edited by Jérôme Vieilledent
  6. public function __construct(RouterInterface $defaultRouter, UrlAliasGenerator $urlAliasGenerator, HttpUtils $httpUtils)
  7. {
  8. $this->defaultRouter = $defaultRouter;
  9. $this->urlAliasGenerator = $urlAliasGenerator;
  1. {
  2. /** @var \Symfony\Component\HttpKernel\Controller\ControllerResolverInterface */
  3. private $controllerResolver;
  4. /** @var \Psr\Log\LoggerInterface */
  5. private $logger;

    This logger attribute is declared but never used. You should remove it.

    Time to fix: about 15 minutes
    Open Issue Permalink
    Last edited by Jérôme Vieilledent
  6. /** @var \eZ\Publish\Core\MVC\Symfony\View\Builder\ViewBuilderRegistry */
  7. private $viewBuilderRegistry;
  8. /** @var \Symfony\Component\EventDispatcher\EventDispatcher */
  1. class ConsoleContext extends EzContext implements Context, SnippetAcceptingContext
  2. {
  3. private $scriptOutput = null;
  4. private $nonDefaultSiteaccessName = null;

    This nonDefaultSiteaccessName attribute is declared but never used. You should remove it.

    Time to fix: about 15 minutes
    Open Issue Permalink
    Last edited by Bertrand Dunogier
  5. /**
  6. * Elements referenced by 'it' in sentences.
  7. * @var array
  8. */
  1. public function thereIsADefaultSiteaccess($expectedSiteaccessName)
  2. {
  3. $this->thereIsASiteaccess($expectedSiteaccessName, true);
  4. Assertion::assertEquals(
  5. $expectedSiteaccessName,
  6. $siteaccessList = $this->getConfigResolver()->getParameter('siteaccess.default_siteaccess')

    This siteaccessList local variable is declared but never used. You should remove it.

    Time to fix: about 15 minutes
    Open Issue Permalink
    Last edited by Bertrand Dunogier
  7. );
  8. }
  9. /**
  10. * @When I run a console script with it
  1. private $innerRenderer;
  2. /**
  3. * @var \eZ\Publish\Core\MVC\Symfony\SiteAccess
  4. */
  5. private $siteAccess;

    This siteAccess attribute is declared but never used. You should remove it.

    Time to fix: about 15 minutes
    Open Issue Permalink
    Last edited by Jérôme Vieilledent
  6. public function __construct(FragmentRendererInterface $innerRenderer)
  7. {
  8. $this->innerRenderer = $innerRenderer;
  9. }
  1. private $driver;
  2. /**
  3. * @var \Behat\Mink\Mink
  4. */
  5. private $mink;

    This mink attribute is declared but never used. You should remove it.

    Time to fix: about 15 minutes
    Open Issue Permalink
    Last edited by Bertrand Dunogier
  6. /**
  7. * @var array
  8. */
  9. private $minkParameters;
  1. private $mink;
  2. /**
  3. * @var array
  4. */
  5. private $minkParameters;

    This minkParameters attribute is declared but never used. You should remove it.

    Time to fix: about 15 minutes
    Open Issue Permalink
    Last edited by Bertrand Dunogier
  6. /**
  7. * Initialize class.
  8. *
  9. * @param string $url Base URL for REST calls
  1. }
  2. /**
  3. * @BeforeScenario
  4. */
  5. private function resetDriver()

    This resetDriver method is declared but never used. You should remove it.

    Time to fix: about 15 minutes
    Open Issue Permalink
    Last edited by Joao Inacio
  6. {
  7. $this->setRestDriver($this->driver, $this->url);
  8. }
  9. /**
  1. {
  2. // delete the user over HTTP as the user service will have inmemory cache
  3. $this->restContext->createAndSendRequest('get', '/user/users/' . $this->currentContent->id);
  4. Assertion::assertInstanceOf(
  5. 'eZ\Publish\Core\REST\Common\Exceptions\NotFoundException',
  6. $object = $this->restContext->getResponseObject(),

    This object local variable is declared but never used. You should remove it.

    Time to fix: about 15 minutes
    Open Issue Permalink
    Last edited by Bertrand Dunogier
  7. 'The user the content referred to exists'
  8. );
  9. }
  10. /**
  1. }
  2. /**
  3. * @BeforeScenario
  4. */
  5. public function loginAdmin($event)

    This event argument is declared but never used. You should remove it.

    Time to fix: about 15 minutes
    Open Issue Permalink
    Last edited by Miguel Jacinto
  6. {
  7. $this->repository->setCurrentUser(new UserReference($this->adminUserId));
  8. }
  9. }
  1. /** @var \eZ\Publish\Core\IO\MetadataHandler */
  2. protected $imageSizeMetadataHandler;
  3. /** @var \eZ\Publish\Core\Base\Utils\DeprecationWarnerInterface */
  4. private $deprecationWarner;

    This deprecationWarner attribute is declared but never used. You should remove it.

    Time to fix: about 15 minutes
    Open Issue Permalink
    Last edited by Bertrand Dunogier
  5. /** @var \eZ\Publish\Core\FieldType\Image\AliasCleanerInterface */
  6. protected $aliasCleaner;
  7. /** @var \eZ\Publish\Core\FieldType\Image\ImageStorage\Gateway $gateway */
  1. /** @var string */
  2. private $defaultGroup;
  3. /** @var \Symfony\Component\Translation\TranslatorInterface */
  4. private $translator;

    This translator attribute is declared but never used. You should remove it.

    Time to fix: about 15 minutes
    Open Issue Permalink
    Last edited by Bertrand Dunogier
  5. public function __construct(TranslatorInterface $translator, $defaultGroup, array $groups)
  6. {
  7. $translatedGroups = [];
  8. foreach ($groups as $groupIdentifier) {
  1. /**
  2. * Default templates, indexed per viewType (full, line, ...).
  3. * @var array
  4. */
  5. private $defaultTemplates;

    This defaultTemplates attribute is declared but never used. You should remove it.

    Time to fix: about 15 minutes
    Open Issue Permalink
    Last edited by Bertrand Dunogier
  6. /**
  7. * @var \eZ\Publish\Core\Helper\ContentInfoLocationLoader
  8. */
  9. private $locationLoader;
  1. private function getCacheTags(UrlAlias $urlAlias, array $tags = [])
  2. {
  3. $tags[] = 'urlAlias-' . $urlAlias->id;
  4. if ($urlAlias->type === UrlAlias::LOCATION) {
  5. $cacheTags[] = 'urlAlias-location-' . $urlAlias->destination;

    This cacheTags local variable is declared but never used. You should remove it.

    Time to fix: about 15 minutes
    Open Issue Permalink
    Last edited by André R
  6. $location = $this->persistenceHandler->locationHandler()->load($urlAlias->destination);
  7. foreach (explode('/', trim($location->pathString, '/')) as $pathId) {
  8. $tags[] = 'urlAlias-location-path-' . $pathId;
  9. }
  10. }
  1. }
  2. break;
  3. case 'name':
  4. case 'type':
  5. case 'view':
  6. ${$node->nodeName} = $node->nodeValue;

    This local variable is declared but never used. You should remove it.

    Time to fix: about 15 minutes
    Open Issue Permalink
    Last edited by Jérôme Vieilledent
  7. break;
  8. case 'overflow_id':
  9. $overflowId = $node->nodeValue;
  10. break;
  11. case 'zone_id':
  1. *
  2. * @param string $path
  3. *
  4. * @return mixed
  5. */
  6. private function extractLocationIdFromPath(string $path)

    This extractLocationIdFromPath method is declared but never used. You should remove it.

    Time to fix: about 15 minutes
    Open Issue Permalink
    Last edited by Adam Wójs
  7. {
  8. $pathParts = explode('/', $path);
  9. return array_pop($pathParts);
  10. }
  1. "/{$this->indexName}/{$document->type}/{$document->id}",
  2. new Message(
  3. array(
  4. 'Content-Type' => 'application/json',
  5. ),
  6. $json = $this->serializer->getIndexDocument($document)

    This json local variable is declared but never used. You should remove it.

    Time to fix: about 15 minutes
    Open Issue Permalink
    Last edited by Jérôme Vieilledent
  7. )
  8. );
  9. $this->flush();
  1. * @param int|string $id
  2. * @param string $type
  3. */
  4. public function delete($id, $type)
  5. {
  6. $result = $this->client->request('DELETE', "/{$this->indexName}/{$type}/{$id}");

    This result local variable is declared but never used. You should remove it.

    Time to fix: about 15 minutes
    Open Issue Permalink
    Last edited by Jérôme Vieilledent
  7. $this->flush();
  8. }
  9. /**
  10. * Deletes a document(s) of the given $type by given $query string.
  1. * @param string $query
  2. * @param string $type
  3. */
  4. public function deleteByQuery($query, $type)
  5. {
  6. $result = $this->client->request(

    This result local variable is declared but never used. You should remove it.

    Time to fix: about 15 minutes
    Open Issue Permalink
    Last edited by Petar Španja
  7. 'DELETE',
  8. "/{$this->indexName}/{$type}/_query",
  9. new Message(
  10. array(
  11. 'Content-Type' => 'application/json',
  1. */
  2. public function mapContent(Content $content)
  3. {
  4. $locations = $this->locationHandler->loadLocationsByContent($content->versionInfo->contentInfo->id);
  5. $section = $this->sectionHandler->load($content->versionInfo->contentInfo->sectionId);
  6. $mainLocation = null;

    This mainLocation local variable is declared but never used. You should remove it.

    Time to fix: about 15 minutes
    Open Issue Permalink
    Last edited by Petar Španja
  7. $locationDocuments = array();
  8. foreach ($locations as $location) {
  9. $locationDocuments[] = $this->mapContentLocation($location, $content);
  10. }

Commented code should not be committed 6

More information: https://insight.symfony.com/what-we-analyse/php.commented_out_code

  1. public function iHaveTheFollowingUsers(TableNode $table)
  2. {
  3. $users = $table->getTable();
  4. array_shift($users);
  5. foreach ($users as $user) {
  6. // array( [0] => userName, [1] => groupName );

    Commented out code reduces readability and lowers the code confidence for other developers. If it's common usage for debug, it should not be committed. Using a version control system, such code can be safely removed.

    Time to fix: about 30 minutes
    Open Issue Permalink
    Last edited by Miguel Jacinto
  7. $this->ensureUserExists($user[0], $user[1]);
  8. }
  9. }
  10. /**
  1. *
  2. * @return string
  3. */
  4. protected function fillXml($imageData, $pathInfo, $timestamp)
  5. {
  6. // <?xml version="1.0" encoding="utf-8"

    Commented out code reduces readability and lowers the code confidence for other developers. If it's common usage for debug, it should not be committed. Using a version control system, such code can be safely removed.

    Time to fix: about 30 minutes
    Open Issue Permalink
    Last edited by Tobias Schlitt
  7. // <ezimage serial_number="1" is_valid="1" filename="River-Boat.jpg" suffix="jpg" basename="River-Boat" dirpath="var/ezdemo_site/storage/images/travel/peruvian-amazon/river-boat/322-1-eng-US" url="var/ezdemo_site/storage/images/travel/peruvian-amazon/river-boat/322-1-eng-US/River-Boat.jpg" original_filename="bbbbc2fe.jpg" mime_type="image/jpeg" width="770" height="512" alternative_text="Old River Boat" alias_key="1293033771" timestamp="1342530101">
  8. // <original attribute_id="322" attribute_version="1" attribute_language="eng-US"/>
  9. // <information Height="512" Width="770" IsColor="1"/>
  10. // </ezimage>
  11. $xml = <<<EOT
  1. $statement = $query->prepare();
  2. $statement->execute();
  3. // Commented due to EZP-23302: Update Location fails if no change is performed with the update
  4. // Should be fixed with PDO::MYSQL_ATTR_FOUND_ROWS instead
  5. /*if ( $statement->rowCount() < 1 )

    Commented out code reduces readability and lowers the code confidence for other developers. If it's common usage for debug, it should not be committed. Using a version control system, such code can be safely removed.

    Time to fix: about 30 minutes
    Open Issue Permalink
    Last edited by Gunnstein Lye
  6. {
  7. throw new NotFound( 'location', $locationId );
  8. }*/
  9. }
  1. $statement = $query->prepare();
  2. $statement->execute();
  3. // Commented due to EZP-24698: Role update leads to NotFoundException
  4. // Should be fixed with PDO::MYSQL_ATTR_FOUND_ROWS instead
  5. /*if ($statement->rowCount() < 1) {

    Commented out code reduces readability and lowers the code confidence for other developers. If it's common usage for debug, it should not be committed. Using a version control system, such code can be safely removed.

    Time to fix: about 30 minutes
    Open Issue Permalink
    Last edited by Gunnstein Lye
  6. throw new NotFoundException('role', $role->id);
  7. }*/
  8. }
  9. /**
  1. $e
  2. );
  3. }
  4. // TODO: Uncomment when role policy editing is done, see EZP-24711 & EZP-24713
  5. /*if (count($loadedRoleDraft->getPolicies()) === 0) {

    Commented out code reduces readability and lowers the code confidence for other developers. If it's common usage for debug, it should not be committed. Using a version control system, such code can be safely removed.

    Time to fix: about 30 minutes
    Open Issue Permalink
    Last edited by Gunnstein Lye
  6. throw new InvalidArgumentException(
  7. "\$roleDraft",
  8. 'The role draft should have at least one policy.'
  9. );
  10. }*/
  1. *
  2. * @param bool $commit
  3. */
  4. public function setCommit($commit)
  5. {
  6. //$this->gateway->setCommit( $commit );

    Commented out code reduces readability and lowers the code confidence for other developers. If it's common usage for debug, it should not be committed. Using a version control system, such code can be safely removed.

    Time to fix: about 30 minutes
    Open Issue Permalink
    Last edited by Petar Španja
  7. }
  8. public function flush()
  9. {
  10. $this->gateway->flush();

Usage of a function in loops should be avoided

More information: https://insight.symfony.com/what-we-analyse/php.for_loop_uses_test_function

  1. {
  2. $contentId = $fullTextData->id;
  3. $prevWordId = 0;
  4. for ($i = 0; $i < count($indexArray); ++$i) {

    This loop uses a function. To avoid the overhead of executing the function n times, you should precalculate it before the loop.

    Time to fix: about 15 minutes
    Open Issue Permalink
    Last edited by Andrew Longosz
  5. $indexWord = $indexArray[$i]['Word'];
  6. $contentFieldId = $indexArray[$i]['ContentClassAttributeID'];
  7. $identifier = $indexArray[$i]['identifier'];
  8. $integerValue = $indexArray[$i]['integer_value'];
  9. $wordId = $wordIDArray[$indexWord];

Deprecated class usage found 5

More information: https://insight.symfony.com/what-we-analyse/third_party.use_deprecated_class

  1. $public = $definition->isPublic();
  2. $tags = $definition->getTags();
  3. $definition->setPublic(false);
  4. $container->setDefinition($renamedId, $definition);
  5. $decoratedDef = new DefinitionDecorator('ezpublish.decorated_fragment_renderer');

    The Symfony\Component\DependencyInjection\DefinitionDecorator class has been deprecated in Symfony 3.3. Use the Symfony\Component\DependencyInjection\ChildDefinition class instead.

    Time to fix: about 2 hours
    Open Issue Permalink
    Last edited by Jérôme Vieilledent
  6. $decoratedDef->setArguments(array(new Reference($renamedId)));
  7. $decoratedDef->setPublic($public);
  8. $decoratedDef->setTags($tags);
  9. // Special treatment for inline fragment renderer, to fit ESI renderer constructor type hinting (forced to InlineFragmentRenderer)
  10. if ($id === 'fragment.renderer.inline') {
  1. $contentSearchGatewayDef->replaceArgument(5, $connectionParams['index_name']);
  2. $contentSearchGatewayId = self::CONTENT_SEARCH_GATEWAY_ID . ".$connectionName";
  3. $container->setDefinition($contentSearchGatewayId, $contentSearchGatewayDef);
  4. // Location search gateway
  5. $locationSearchGatewayDef = new DefinitionDecorator(self::LOCATION_SEARCH_GATEWAY_ID);

    The Symfony\Component\DependencyInjection\DefinitionDecorator class has been deprecated in Symfony 3.3. Use the Symfony\Component\DependencyInjection\ChildDefinition class instead.

    Time to fix: about 2 hours
    Open Issue Permalink
    Last edited by Jérôme Vieilledent
  6. $locationSearchGatewayDef->replaceArgument(0, new Reference($httpClientId));
  7. $locationSearchGatewayDef->replaceArgument(5, $connectionParams['index_name']);
  8. $locationSearchGatewayId = self::LOCATION_SEARCH_GATEWAY_ID . ".$connectionName";
  9. $container->setDefinition($locationSearchGatewayId, $locationSearchGatewayDef);
  1. foreach ($configuredHandlers as $name => $config) {
  2. $configurationFactory = $this->getFactory($factories, $config['type'], $container);
  3. $parentHandlerId = $configurationFactory->getParentServiceId();
  4. $handlerId = sprintf('%s.%s', $parentHandlerId, $name);
  5. $definition = $container->setDefinition($handlerId, new DefinitionDecorator($parentHandlerId));

    The Symfony\Component\DependencyInjection\DefinitionDecorator class has been deprecated in Symfony 3.3. Use the Symfony\Component\DependencyInjection\ChildDefinition class instead.

    Time to fix: about 2 hours
    Open Issue Permalink
    Last edited by Jérôme Vieilledent
  6. $configurationFactory->configureHandler($definition, $config);
  7. $handlers[$name] = $handlerId;
  8. }
  1. }
  2. $filesystemId = sprintf('ezpublish.core.io.flysystem.%s_filesystem', $name);
  3. $definition = $container->setDefinition(
  4. $filesystemId,
  5. new DefinitionDecorator('ezpublish.core.io.flysystem.base_filesystem')

    The Symfony\Component\DependencyInjection\DefinitionDecorator class has been deprecated in Symfony 3.3. Use the Symfony\Component\DependencyInjection\ChildDefinition class instead.

    Time to fix: about 2 hours
    Open Issue Permalink
    Last edited by Jérôme Vieilledent
  6. );
  7. $definition->setArguments(array(new Reference($adapterId)));
  8. return $filesystemId;
  9. }
  1. }
  2. protected function createListener($container, $id, $config, $userProvider)
  3. {
  4. $listenerId = $this->getListenerId();
  5. $listener = new DefinitionDecorator($listenerId);

    The Symfony\Component\DependencyInjection\DefinitionDecorator class has been deprecated in Symfony 3.3. Use the Symfony\Component\DependencyInjection\ChildDefinition class instead.

    Time to fix: about 2 hours
    Open Issue Permalink
    Last edited by Jérôme Vieilledent
  6. $listener->replaceArgument(2, $id);
  7. /* @var \Symfony\Component\DependencyInjection\ContainerBuilder $container */
  8. $listenerId .= '.' . $id;
  9. $container->setDefinition($listenerId, $listener);

Interfaces names should end with "Interface" 105

More information: https://insight.symfony.com/what-we-analyse/php.interface_has_no_interface_suffix

  1. namespace eZ\Publish\Core\MVC\Symfony\View;
  2. /**
  3. * A view that can embedded into another element.
  4. */
  5. interface EmbedView

    Interface EmbedView should be named EmbedViewInterface for better clarity.

    Time to fix: about 1 hour
    Open Issue Permalink
    Last edited by Bertrand Dunogier
  6. {
  7. /**
  8. * The default viewType for embed views.
  9. * @var string
  10. */
  1. */
  2. namespace eZ\Bundle\EzPublishCoreBundle\Imagine;
  3. use eZ\Publish\Core\FieldType\Image\Value as ImageValue;
  4. interface PlaceholderProvider

    Interface PlaceholderProvider should be named PlaceholderProviderInterface for better clarity.

    Time to fix: about 1 hour
    Open Issue Permalink
    Last edited by Adam Wójs
  5. {
  6. /**
  7. * Provides a placeholder image path for a given Image FieldType value.
  8. *
  9. * @param \eZ\Publish\Core\FieldType\Image\Value $value
  1. namespace eZ\Bundle\EzPublishCoreBundle\Imagine;
  2. /**
  3. * Generates the path to variations of original images.
  4. */
  5. interface VariationPathGenerator

    Interface VariationPathGenerator should be named VariationPathGeneratorInterface for better clarity.

    Time to fix: about 1 hour
    Open Issue Permalink
    Last edited by Bertrand Dunogier
  6. {
  7. /**
  8. * Returns the variation for image $originalPath with $filter.
  9. *
  10. * @param string $originalPath
  1. use Countable;
  2. /**
  3. * Iterates over BinaryFile id entries for original images.
  4. */
  5. interface ImageFileList extends Countable, Iterator

    Interface ImageFileList should be named ImageFileListInterface for better clarity.

    Time to fix: about 1 hour
    Open Issue Permalink
    Last edited by Bertrand Dunogier
  6. {
  7. }
  1. namespace eZ\Bundle\EzPublishCoreBundle\Imagine\VariationPurger;
  2. /**
  3. * Reads original image files from a data source.
  4. */
  5. interface ImageFileRowReader

    Interface ImageFileRowReader should be named ImageFileRowReaderInterface for better clarity.

    Time to fix: about 1 hour
    Open Issue Permalink
    Last edited by Bertrand Dunogier
  6. {
  7. /**
  8. * Initializes the reader.
  9. *
  10. * Can for instance be used to create and execute a database query.
  1. use eZ\Publish\Core\MVC\Symfony\SiteAccess\Matcher as BaseMatcher;
  2. /**
  3. * Interface for service based siteaccess matchers.
  4. */
  5. interface Matcher extends BaseMatcher

    Interface Matcher should be named MatcherInterface for better clarity.

    Time to fix: about 1 hour
    Open Issue Permalink
    Last edited by Jérôme Vieilledent
  6. {
  7. /**
  8. * Registers the matching configuration associated with the matcher.
  9. *
  10. * @param mixed $matchingConfiguration
  1. namespace eZ\Bundle\EzPublishCoreBundle\SiteAccess;
  2. /**
  3. * Allows to filter SiteAccess configuration before it gets processed.
  4. */
  5. interface SiteAccessConfigurationFilter

    Interface SiteAccessConfigurationFilter should be named SiteAccessConfigurationFilterInterface for better clarity.

    Time to fix: about 1 hour
    Open Issue Permalink
    Last edited by Bertrand Dunogier
  6. {
  7. /**
  8. * Receives the siteaccess configuration array and returns it.
  9. *
  10. * @param array $siteAccessConfiguration
  1. namespace eZ\Bundle\EzPublishCoreBundle\Translation;
  2. /**
  3. * Interface for collecting translations.
  4. */
  5. interface Collector

    Interface Collector should be named CollectorInterface for better clarity.

    Time to fix: about 1 hour
    Open Issue Permalink
    Last edited by Nicolas Bastien
  6. {
  7. /**
  8. * @return array
  9. */
  10. public function collect();
  1. * Required to:
  2. * - register an io handler
  3. * - add custom semantic configuration below ez_io.xxx_handler.<name>.<type>
  4. * - customize the custom handler services, and initialize extra services definitions
  5. */
  6. interface ConfigurationFactory

    Interface ConfigurationFactory should be named ConfigurationFactoryInterface for better clarity.

    Time to fix: about 1 hour
    Open Issue Permalink
    Last edited by Bertrand Dunogier
  7. {
  8. /**
  9. * Adds the handler's semantic configuration.
  10. *
  11. * Example:
  1. namespace eZ\Bundle\EzPublishIOBundle\Migration;
  2. /**
  3. * A registry of FileListerInterfaces.
  4. */
  5. interface FileListerRegistry

    Interface FileListerRegistry should be named FileListerRegistryInterface for better clarity.

    Time to fix: about 1 hour
    Open Issue Permalink
    Last edited by Gunnstein Lye
  6. {
  7. /**
  8. * Returns the FileListerInterface matching the argument.
  9. *
  10. * @param string $identifier An identifier string.
  1. * Simple SQL based installer interface for eZ Platform 1.0, will be replaced by a new interface in the future that
  2. * uses API/SPI (via future import/export functionality) to support cluster and several different storage engines.
  3. * Such change will also move responsibility of repository init (base schema and minimal data) to storage engine
  4. * so this is not in installers. Further info: https://jira.ez.no/browse/EZP-25368
  5. */
  6. interface Installer

    Interface Installer should be named InstallerInterface for better clarity.

    Time to fix: about 1 hour
    Open Issue Permalink
    Last edited by Bertrand Dunogier
  7. {
  8. /**
  9. * Handle inserting of schema, schema should ideally be in ISO SQL format.
  10. */
  11. public function importSchema();
  1. /**
  2. * Container interface.
  3. *
  4. * Starting point for getting all Public API's
  5. */
  6. interface Container

    Interface Container should be named ContainerInterface for better clarity.

    Time to fix: about 1 hour
    Open Issue Permalink
    Last edited by André R
  7. {
  8. /**
  9. * Get Repository object.
  10. *
  11. * Public API for
  1. * Bookmark Service.
  2. *
  3. * Service to handle bookmarking of Content item Locations. It works in the context of a current User (obtained from
  4. * the PermissionResolver).
  5. */
  6. interface BookmarkService

    Interface BookmarkService should be named BookmarkServiceInterface for better clarity.

    Time to fix: about 1 hour
    Open Issue Permalink
    Last edited by Adam Wójs
  7. {
  8. /**
  9. * Add location to bookmarks.
  10. *
  11. * @param \eZ\Publish\API\Repository\Values\Content\Location $location
  1. /**
  2. * This class provides service methods for managing content.
  3. *
  4. * @example Examples/content.php
  5. */
  6. interface ContentService

    Interface ContentService should be named ContentServiceInterface for better clarity.

    Time to fix: about 1 hour
    Open Issue Permalink
    Last edited by Patrick Allaert
  7. {
  8. /**
  9. * Loads a content info object.
  10. *
  11. * To load fields use loadContent
  1. use eZ\Publish\API\Repository\Values\ContentType\ContentTypeGroupCreateStruct;
  2. /**
  3. * @example Examples/contenttype.php
  4. */
  5. interface ContentTypeService

    Interface ContentTypeService should be named ContentTypeServiceInterface for better clarity.

    Time to fix: about 1 hour
    Open Issue Permalink
    Last edited by Christian Bacher
  6. {
  7. /**
  8. * Create a Content Type Group object.
  9. *
  10. * @throws \eZ\Publish\API\Repository\Exceptions\UnauthorizedException if the user is not allowed to create a content type group
  1. /**
  2. * Interface that FieldTypes expose to the public API.
  3. *
  4. * @see eZ\Publish\SPI\FieldType\FieldType For implementer doc
  5. */
  6. interface FieldType

    Interface FieldType should be named FieldTypeInterface for better clarity.

    Time to fix: about 1 hour
    Open Issue Permalink
    Last edited by Tobias Schlitt
  7. {
  8. /**
  9. * Returns the field type identifier for this field type.
  10. *
  11. * @return string