Your project should use Doctrine migrations

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

Use Doctrine Migrations to keep your production database synchronized

Time to fix: about 1 hour
Open Issue Permalink
Collective

Use interfaces instead of classes in typehints

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

  1. /**
  2. * @var int
  3. */
  4. private $cookieLifeTime = 604800;
  5. public function __construct(

    You should use the interface Symfony\Component\HttpFoundation\Session\SessionStorageInterface instead of the class Symfony\Component\HttpFoundation\Session\Storage\MetadataBag as a typehint.

    Time to fix: about 15 minutes
    Open Issue Permalink
    Last edited by Axel Guckelsberger
  6. VariableApiInterface $variableApi,
  7. array $options = [],
  8. SessionHandlerInterface $handler = null,
  9. MetadataBag $metaBag = null
  10. ) {

Source code should not contain tasks comments 11

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

  1. private function getDocCommentForNode(Node $node): ?string
  2. {
  3. // check if there is a doc comment for the ID argument
  4. // ->trans(/** @Desc("FOO") */ 'my.id')
  5. /* TODO check whether this can be entirely removed, refs #3941

    Tasks comments are left in the code when a feature (or a bug) isn't completely developed (or fixed). You should complete the implementation and remove the comment.

    Time to fix: about 2 hours
    Open Issue Permalink
    Last edited by Guite
  6. if (null !== $comment = $node->args[0]->getDocComment()) {
  7. return $comment->getText();
  8. }*/
  9. // this may be placed somewhere up in the hierarchy,
  1. */
  2. protected function initialize(): void
  3. {
  4. $this->loadResources();
  5. // TODO remove again

    Tasks comments are left in the code when a feature (or a bug) isn't completely developed (or fixed). You should complete the implementation and remove the comment.

    Time to fix: about 2 hours
    Open Issue Permalink
    Last edited by Guite
  6. if (empty($this->loaderIds)) {
  7. $this->loaderIds = [
  8. 'dummy' => [
  9. 'po' => PoFileLoader::class,
  10. 'pot' => MockPotFileLoader::class,
  1. * For this all registries are checked to see if the given category is contained in the corresponding subtree.
  2. * If yes, the mapping table of the corresponding module is checked to see if it contains the given category.
  3. */
  4. public function mayCategoryBeDeletedOrMoved(CategoryEntity $category): bool
  5. {
  6. // TODO #3920

    Tasks comments are left in the code when a feature (or a bug) isn't completely developed (or fixed). You should complete the implementation and remove the comment.

    Time to fix: about 2 hours
    Open Issue Permalink
    Last edited by Guite
  7. return true;
  8. // collect parents
  9. $isOnTop = false;
  10. $parentIds = [$category->getId()];
  1. {% endfor %}
  2. </tbody>
  3. </table>
  4. {{ pager({rowcount:pager.count, limit:pager.limit, route:'zikulaextensionsmodule_module_viewmodulelist'}) }}
  5. {{ adminFooter() }}
  6. {# todo move to own file #}

    Tasks comments are left in the code when a feature (or a bug) isn't completely developed (or fixed). You should complete the implementation and remove the comment.

    Time to fix: about 2 hours
    Open Issue Permalink
    Last edited by Guite
  7. {% set initScript %}
  8. <script>
  9. ( function($) {
  10. $(document).ready(function() {
  11. $('i[class*=fa-caret-]').on('click', function() {
  1. {{ adminHeader() }}{# @todo wrong header! see below #}

    Tasks comments are left in the code when a feature (or a bug) isn't completely developed (or fixed). You should complete the implementation and remove the comment.

    Time to fix: about 2 hours
    Open Issue Permalink
    Last edited by Craig Heydenburg
  2. {#{admincategorymenu}#}
  3. {#<div class="z-admin-content clearfix">#}
  4. {#{modgetinfo modname=$currentmodule info='displayname' assign='displayName'}#}
  5. {#{modgetimage modname=$currentmodule assign='image'}#}
  1. $container = $this->container;
  2. if ($route->getTranslatable()) {
  3. $languages = $container->get(LocaleApi::class)->getSupportedLocales();
  4. // TODO migrate this legacy call

    Tasks comments are left in the code when a feature (or a bug) isn't completely developed (or fixed). You should complete the implementation and remove the comment.

    Time to fix: about 2 hours
    Open Issue Permalink
    Last edited by Guite
  5. $isRequiredLangParam = true;//ZLanguage::isRequiredLangParam();
  6. if (!$isRequiredLangParam) {
  7. $defaultLanguage = $this->variableApi->getSystemVar('language_i18n');
  8. unset($languages[array_search($defaultLanguage, $languages, true)]);
  9. }
  1. }
  2. if ('Filter' === $namespace) {
  3. if (
  4. // Do not allow Filter.Custom for now. Causing errors.
  5. // TODO research why Filter.Custom is causing exceptions and correct.

    Tasks comments are left in the code when a feature (or a bug) isn't completely developed (or fixed). You should complete the implementation and remove the comment.

    Time to fix: about 2 hours
    Open Issue Permalink
    Last edited by Axel Guckelsberger
  6. ('Custom' === $directive)
  7. // Do not allow Filter.ExtractStyleBlock* for now. Causing errors.
  8. // TODO Filter.ExtractStyleBlock* requires CSSTidy
  9. || (false !== mb_stripos($directive, 'ExtractStyleBlock'))
  10. ) {
  1. if (
  2. // Do not allow Filter.Custom for now. Causing errors.
  3. // TODO research why Filter.Custom is causing exceptions and correct.
  4. ('Custom' === $directive)
  5. // Do not allow Filter.ExtractStyleBlock* for now. Causing errors.
  6. // TODO Filter.ExtractStyleBlock* requires CSSTidy

    Tasks comments are left in the code when a feature (or a bug) isn't completely developed (or fixed). You should complete the implementation and remove the comment.

    Time to fix: about 2 hours
    Open Issue Permalink
    Last edited by Axel Guckelsberger
  7. || (false !== mb_stripos($directive, 'ExtractStyleBlock'))
  8. ) {
  9. continue;
  10. }
  11. }
  1. // PHPIDS should run with PHP 5.1.2 but this is untested - set this value to force compatibilty with minor versions
  2. $config['General']['min_php_version'] = '5.1.6';
  3. // caching settings
  4. // @todo: add UI for those caching settings

    Tasks comments are left in the code when a feature (or a bug) isn't completely developed (or fixed). You should complete the implementation and remove the comment.

    Time to fix: about 2 hours
    Open Issue Permalink
    Last edited by Drak
  5. $config['Caching'] = [];
  6. // caching method (session|file|database|memcached|none), default file
  7. $config['Caching']['caching'] = 'none'; // deactivate caching for now
  8. $config['Caching']['expiration_time'] = 600;
  1. public function getBrowserLocale(string $default = 'en'): string
  2. {
  3. $request = null !== $this->requestStack ? $this->requestStack->getCurrentRequest() : null;
  4. // @todo consider http://php.net/manual/en/locale.acceptfromhttp.php and http://php.net/manual/en/locale.lookup.php

    Tasks comments are left in the code when a feature (or a bug) isn't completely developed (or fixed). You should complete the implementation and remove the comment.

    Time to fix: about 2 hours
    Open Issue Permalink
    Last edited by Craig Heydenburg
  5. if (null === $request || 'cli' === PHP_SAPI || !$request->server->has('HTTP_ACCEPT_LANGUAGE')) {
  6. return $default;
  7. }
  8. preg_match_all('~([\w-]+)(?:[^,\d]+([\d.]+))?~', mb_strtolower($request->server->get('HTTP_ACCEPT_LANGUAGE')), $matches, PREG_SET_ORDER);
  9. $availableLanguages = [];
  1. $variableApi->del(VariableApi::CONFIG, 'language');
  2. }
  3. foreach ($data as $name => $value) {
  4. $variableApi->set(VariableApi::CONFIG, $name, $value);
  5. }
  6. $variableApi->set(VariableApi::CONFIG, 'locale', $data['language_i18n']); // @todo which variable are we using?

    Tasks comments are left in the code when a feature (or a bug) isn't completely developed (or fixed). You should complete the implementation and remove the comment.

    Time to fix: about 2 hours
    Open Issue Permalink
    Last edited by Guite
  7. $multilingualRoutingHelper->reloadMultilingualRoutingSettings(); // resets config/dynamic/generated.yml & custom_parameters.yml
  8. if (null !== $request->getSession()) {
  9. $request->getSession()->set('_locale', $data['language_i18n']);
  10. }

Files should not be executable

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

Your project contains files with permissive permissions. In order to avoid opening a security breach, you should restrict execution rights on following files:

  • src/app/config/config.yml
  • src/app/config/dynamic/default.yml
  • src/app/config/parameters.yml
  • src/app/config/routing.yml

Time to fix: about 15 minutes
Open Issue Permalink
Collective
chmod a-x 'src/app/config/config.yml' \
    'src/app/config/dynamic/default.yml' \
    'src/app/config/parameters.yml' \
    'src/app/config/routing.yml'

Code should not be duplicated 15

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

  1. $status = $status ? 'A' : 'I';
  2. }
  3. $this->status = $status;
  4. }
  5. public function getCr_date(): DateTime

    The next 41 lines appear both in src/system/CategoriesModule/Entity/CategoryEntity.php:396 and src/system/CategoriesModule/Entity/CategoryRegistryEntity.php:169.

    Time to fix: about 4 hours
    Open Issue Permalink
    Last edited by Guite
  6. {
  7. return $this->cr_date;
  8. }
  9. public function setCr_date(DateTime $cr_date): void
  1. if ($currentStage instanceof WizardCompleteInterface) {
  2. return $currentStage->getResponse($request);
  3. }
  4. $templateParams = $this->controllerHelper->getTemplateGlobals($currentStage);
  5. $templateParams['headertemplate'] = '@ZikulaCoreInstaller/installheader.html.twig';
  6. if ($wizard->isHalted()) {

    The next 14 lines appear both in src/lib/Zikula/Bundle/CoreInstallerBundle/Controller/InstallerController.php:63 and src/lib/Zikula/Bundle/CoreInstallerBundle/Controller/UpgraderController.php:71.

    Time to fix: about 4 hours
    Open Issue Permalink
    Last edited by Craig Heydenburg
  7. $request->getSession()->getFlashBag()->add('danger', $wizard->getWarning());
  8. return $this->renderResponse('ZikulaCoreInstallerBundle::error.html.twig', $templateParams);
  9. }
  1. *
  2. * @ORM\Column(name="sortorder", type="smallint", nullable=false)
  3. */
  4. private $sortorder;
  5. public function getId(): int

    The next 54 lines appear both in src/lib/Zikula/Bundle/HookBundle/Dispatcher/Storage/Doctrine/Entity/HookBindingEntity.php:78 and src/lib/Zikula/Bundle/HookBundle/Dispatcher/Storage/Doctrine/Entity/HookRuntimeEntity.php:92.

    Time to fix: about 4 hours
    Open Issue Permalink
    Last edited by Guite
  6. {
  7. return $this->id;
  8. }
  9. public function setSowner(string $sowner): self
  1. /**
  2. * IdentityTranslator does not translate anything.
  3. */
  4. class IdentityTranslator extends SymfonyIdentityTranslator implements TranslatorInterface
  5. {
  6. public function __(string $msg, string $domain = null, string $locale = null): string

    The next 28 lines appear both in src/lib/Zikula/Common/Translator/IdentityTranslator.php:23 and src/lib/Zikula/Common/Translator/Translator.php:193.

    Time to fix: about 4 hours
    Open Issue Permalink
    Last edited by Guite
  7. {
  8. return $this->trans($msg, [], $domain, $locale);
  9. }
  10. public function _n(string $m1, string $m2, int $number, string $domain = null, string $locale = null): string
  1. *
  2. * For the full copyright and license information, please view the LICENSE
  3. * file that was distributed with this source code.
  4. */
  5. namespace Zikula\AdminModule\Form\Type;

    The next 41 lines appear both in src/system/AdminModule/Form/Type/ConfigType.php:14 and src/system/SearchModule/Form/Type/ConfigType.php:14.

    Time to fix: about 4 hours
    Open Issue Permalink
    Last edited by Axel Guckelsberger
  6. use Symfony\Component\Form\AbstractType;
  7. use Symfony\Component\Form\Extension\Core\Type\CheckboxType;
  8. use Symfony\Component\Form\Extension\Core\Type\ChoiceType;
  9. use Symfony\Component\Form\Extension\Core\Type\IntegerType;
  1. *
  2. * For the full copyright and license information, please view the LICENSE
  3. * file that was distributed with this source code.
  4. */
  5. namespace Zikula\AdminModule\Form\Type;

    The next 33 lines appear both in src/system/AdminModule/Form/Type/ConfigType.php:14 and src/system/GroupsModule/Form/Type/ConfigType.php:14.

    Time to fix: about 4 hours
    Open Issue Permalink
    Last edited by Axel Guckelsberger
  6. use Symfony\Component\Form\AbstractType;
  7. use Symfony\Component\Form\Extension\Core\Type\CheckboxType;
  8. use Symfony\Component\Form\Extension\Core\Type\ChoiceType;
  9. use Symfony\Component\Form\Extension\Core\Type\IntegerType;
  1. }
  2. public function buildForm(FormBuilderInterface $builder, array $options)
  3. {
  4. $builder
  5. ->add('name', TextType::class, [

    The next 37 lines appear both in src/system/AdminModule/Form/Type/CreateCategoryType.php:46 and src/system/AdminModule/Form/Type/EditCategoryType.php:48.

    Time to fix: about 4 hours
    Open Issue Permalink
    Last edited by Axel Guckelsberger
  6. 'label' => $this->__('Name'),
  7. 'attr' => [
  8. 'maxlength' => 50
  9. ]
  10. ])
  1. *
  2. * For the full copyright and license information, please view the LICENSE
  3. * file that was distributed with this source code.
  4. */
  5. namespace Zikula\BlocksModule\Container;

    The next 56 lines appear in src/system/BlocksModule/Container/LinkContainer.php:14, src/system/MailerModule/Container/LinkContainer.php:14, src/system/SettingsModule/Container/LinkContainer.php:14 and src/system/ThemeModule/Container/LinkContainer.php:14.

    Time to fix: about 4 hours
    Open Issue Permalink
    Last edited by Craig Heydenburg
  6. use Symfony\Component\Routing\RouterInterface;
  7. use Zikula\Common\Translator\TranslatorInterface;
  8. use Zikula\Core\LinkContainer\LinkContainerInterface;
  9. use Zikula\PermissionsModule\Api\ApiInterface\PermissionApiInterface;
  1. *
  2. * For the full copyright and license information, please view the LICENSE
  3. * file that was distributed with this source code.
  4. */
  5. namespace Zikula\BlocksModule\Container;

    The next 51 lines appear in src/system/BlocksModule/Container/LinkContainer.php:14, src/system/ExtensionsModule/Container/LinkContainer.php:14 and src/system/PermissionsModule/Container/LinkContainer.php:14.

    Time to fix: about 4 hours
    Open Issue Permalink
    Last edited by Craig Heydenburg
  6. use Symfony\Component\Routing\RouterInterface;
  7. use Zikula\Common\Translator\TranslatorInterface;
  8. use Zikula\Core\LinkContainer\LinkContainerInterface;
  9. use Zikula\PermissionsModule\Api\ApiInterface\PermissionApiInterface;
  1. *
  2. * For the full copyright and license information, please view the LICENSE
  3. * file that was distributed with this source code.
  4. */
  5. namespace Zikula\BlocksModule\Container;

    The next 50 lines appear both in src/system/BlocksModule/Container/LinkContainer.php:14 and src/system/MenuModule/Container/LinkContainer.php:14.

    Time to fix: about 4 hours
    Open Issue Permalink
    Last edited by Craig Heydenburg
  6. use Symfony\Component\Routing\RouterInterface;
  7. use Zikula\Common\Translator\TranslatorInterface;
  8. use Zikula\Core\LinkContainer\LinkContainerInterface;
  9. use Zikula\PermissionsModule\Api\ApiInterface\PermissionApiInterface;
  1. }
  2. $form = $this->createFormBuilder($this->getVars())
  3. ->add('collapseable', CheckboxType::class, [
  4. 'label' => $this->__('Enable block collapse icons'),
  5. 'required' => false

    The next 22 lines appear both in src/system/BlocksModule/Controller/ConfigController.php:49 and src/system/ExtensionsModule/Controller/ConfigController.php:65.

    Time to fix: about 4 hours
    Open Issue Permalink
    Last edited by Axel Guckelsberger
  6. ])
  7. ->add('save', SubmitType::class, [
  8. 'label' => $this->__('Save'),
  9. 'icon' => 'fa-check',
  10. 'attr' => [
  1. * @ORM\Column(type="string", length=64)
  2. * @var string
  3. */
  4. private $coreCompatibility;
  5. public function getId(): int

    The next 41 lines appear both in src/system/ExtensionsModule/Entity/ExtensionEntity.php:95 and src/system/ThemeModule/Entity/ThemeEntity.php:132.

    Time to fix: about 4 hours
    Open Issue Permalink
    Last edited by Guite
  6. {
  7. return $this->id;
  8. }
  9. public function setId(int $id): void
  1. $groupsCommon = new CommonHelper($this->translator);
  2. $typeChoices = array_flip($groupsCommon->gtypeLabels());
  3. $stateChoices = array_flip($groupsCommon->stateLabels());
  4. $builder
  5. ->add('name', TextType::class, [

    The next 25 lines appear both in src/system/GroupsModule/Form/Type/CreateGroupType.php:55 and src/system/GroupsModule/Form/Type/EditGroupType.php:57.

    Time to fix: about 4 hours
    Open Issue Permalink
    Last edited by Axel Guckelsberger
  6. 'label' => $this->__('Name'),
  7. 'attr' => [
  8. 'maxlength' => 30
  9. ],
  10. 'constraints' => [
  1. $query = $qb->getQuery();
  2. return (int)$query->getSingleScalarResult();
  3. }
  4. public function getResults(array $filters = [], array $sorting = [], int $limit = 0, int $offset = 0): array

    The next 33 lines appear both in src/system/SearchModule/Entity/Repository/SearchResultRepository.php:48 and src/system/SearchModule/Entity/Repository/SearchStatRepository.php:43.

    Time to fix: about 4 hours
    Open Issue Permalink
    Last edited by Guite
  5. {
  6. $qb = $this->createQueryBuilder('tbl')
  7. ->select('tbl');
  8. // add clauses for where
  1. *
  2. * For the full copyright and license information, please view the LICENSE
  3. * file that was distributed with this source code.
  4. */
  5. namespace Zikula\UsersModule\Validator\Constraints;

    The next 64 lines appear both in src/system/UsersModule/Validator/Constraints/ValidEmailValidator.php:14 and src/system/ZAuthModule/Validator/Constraints/ValidEmailValidator.php:14.

    Time to fix: about 4 hours
    Open Issue Permalink
    Last edited by Craig Heydenburg
  6. use Symfony\Component\Validator\Constraint;
  7. use Symfony\Component\Validator\Constraints\Email;
  8. use Symfony\Component\Validator\ConstraintValidator;
  9. use Symfony\Component\Validator\ConstraintViolationListInterface;

The Doctrine Entity Manager should not be passed as an argument

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

  1. public function getEntityManager(): ?EntityManagerInterface
  2. {
  3. return $this->entityManager;
  4. }
  5. public function setEntityManager(EntityManagerInterface $entityManager = null): void

    A Doctrine entity manager has been found as an argument.

    Time to fix: about 4 hours
    Open Issue Permalink
    Last edited by Guite
  6. {
  7. if ($this->entityManager !== $entityManager) {
  8. $this->entityManager = $entityManager;
  9. }
  10. }

Error silenced by the at sign (@)

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

  1. $this->entityManager->flush();
  2. }
  3. private function isSerialized($string): bool
  4. {
  5. return 'b:0;' === $string || false !== @unserialize($string);

    Adding "@" before unserialize($string) 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 Axel Guckelsberger
  6. }
  7. }

Boolean property should not be prefixed by "is" 4

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

  1. }
  2. /**
  3. * Alias for Symfony Forms.
  4. */
  5. public function getIsLocked(): bool

    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 Guite
  6. {
  7. return $this->getIs_locked();
  8. }
  9. public function setIs_locked(bool $is_locked): void
  1. }
  2. /**
  3. * Alias for Symfony Forms
  4. */
  5. public function setIsLocked(bool $isLocked): void

    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 Guite
  6. {
  7. $this->setIs_locked($isLocked);
  8. }
  9. public function getIs_leaf(): bool
  1. }
  2. /**
  3. * Alias for Symfony Forms
  4. */
  5. public function getIsLeaf(): bool

    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 Guite
  6. {
  7. return $this->getIs_leaf();
  8. }
  9. public function setIs_leaf(bool $is_leaf): void
  1. }
  2. /**
  3. * Alias for Symfony Forms
  4. */
  5. public function setIsLeaf(bool $isLeaf): void

    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 Guite
  6. {
  7. $this->setIs_leaf($isLeaf);
  8. }
  9. public function getName(): string

Form types should be in Form folders

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

A form type has been found outside Form folder

Time to fix: about 2 hours
Open Issue Permalink
Collective
  • src/lib/Zikula/Common/Content
    • AbstractContentFormType.php

      A form type has been found outside Form folder

    • AbstractContentType.php
    • ContentTypeInterface.php

Commented code should not be committed 19

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

  1. }
  2. }
  3. // foreach ($this->loaderIds as $id => $aliases) {
  4. // foreach ($aliases as $alias) {
  5. // $this->addLoader($alias, $this->container->get($id));

    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 Guite
  6. // }
  7. // }
  8. }
  9. /**
  1. $container = $this->container;
  2. if ($route->getTranslatable()) {
  3. $languages = $container->get(LocaleApi::class)->getSupportedLocales();
  4. // TODO migrate this legacy call
  5. $isRequiredLangParam = true;//ZLanguage::isRequiredLangParam();

    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 Guite
  6. if (!$isRequiredLangParam) {
  7. $defaultLanguage = $this->variableApi->getSystemVar('language_i18n');
  8. unset($languages[array_search($defaultLanguage, $languages, true)]);
  9. }
  10. if (count($languages) > 0) {
  1. if ($request->server->has('USER_AGENT')) {
  2. $requestArgs['USER_AGENT'] = $request->server->get('USER_AGENT');
  3. }
  4. // while i think that REQUEST_URI is unnecessary,
  5. // the REFERER would be important, but results in way too many false positives
  6. /*

    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 Axel Guckelsberger
  7. if ($request->server->has('REQUEST_URI')) {
  8. $requestArgs['REQUEST_URI'] = $request->server->get('REQUEST_URI');
  9. }
  10. if ($request->server->has('HTTP_REFERER')) {
  11. $requestArgs['REFERER'] = $request->server->get('HTTP_REFERER');
  1. $config['General']['filter_type'] = $this->getSystemVar('idsfilter', 'xml');
  2. if (empty($config['General']['filter_type'])) {
  3. $config['General']['filter_type'] = 'xml';
  4. }
  5. $config['General']['base_path'] = ''; //PHPIDS_PATH_PREFIX;

    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 Craig Heydenburg
  6. // we don't use the base path because the tmp directory is in zkTemp (see below)
  7. $config['General']['use_base_path'] = false;
  8. // path to the filters used
  9. $config['General']['filter_path'] = $this->getSystemVar('idsrulepath', 'system/SecurityCenterModule/Resources/config/phpids_zikula_default.xml');
  1. * @var ZikulaHttpKernelInterface
  2. * /
  3. private $kernel;*/
  4. public function __construct(ZikulaHttpKernelInterface $kernel)
  5. {
  6. //$this->kernel = $kernel;

    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 Guite
  7. parent::__construct($kernel);
  8. $this->setName('Zikula');
  9. $this->setVersion(ZikulaKernel::VERSION . /*' - ' . $kernel->getName() . */'/' . $kernel->getEnvironment() . ($kernel->isDebug() ? '/debug' : ''));
  1. }
  2. $response = $event->getResponse();
  3. $response->headers->set('X-Frame-Options', $this->xFrameOptions);
  4. //$response->headers->set('X-Content-Security-Policy', "frame-ancestors 'self'");

    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 Guite
  5. $response->headers->set('X-XSS-Protection', '1');
  6. }
  7. }
  1. $result = $this->upgradeModules();
  2. if (0 === count($result)) {
  3. return true;
  4. }
  5. return true; //$result;

    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 Axel Guckelsberger
  6. case 'regenthemes':
  7. return $this->regenerateThemes();
  8. case 'versionupgrade':
  9. return $this->versionUpgrade();
  10. case 'finalizeparameters':
  1. }
  2. try {
  3. $blockInstance = $this->blockApi->createInstanceFromBKey($block->getBkey());
  4. } catch (RuntimeException $exception) {
  5. //return 'Error during block creation: ' . $exception->getMessage();

    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 Guite
  6. return '';
  7. }
  8. $blockProperties = $block->getProperties();
  9. $blockProperties['bid'] = $block->getBid();
  10. $blockProperties['title'] = $block->getTitle();
  1. }
  2. $event = new ModuleStateEvent($bundle, $extensionEntity->toArray());
  3. $eventDispatcher->dispatch(CoreEvents::MODULE_POSTINSTALL, $event);
  4. }
  5. // currently commented out because it takes a long time.
  6. //$extensionHelper->installAssets();

    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 Guite
  7. }
  8. return $this->redirectToRoute('zikulaextensionsmodule_module_viewmodulelist', ['justinstalled' => json_encode($extensions)]);
  9. }
  1. }
  2. }
  3. public function isValid(): bool
  4. {
  5. //return 1 < count($this->getErrors());

    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 Guite
  6. return empty($this->getErrors());
  7. }
  8. public function getErrors(): array
  9. {
  1. $logger->addError("Could not send message to: ${emailList} :: " . $this->message->toString());
  2. }
  3. $this->eventDispatcher->dispatch(MailerEvents::SEND_MESSAGE_FAILURE, $event);
  4. //throw new RuntimeException($this->__('Error! A problem occurred while sending the e-mail message.'));

    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 Guite
  5. return false;
  6. }
  7. if ($this->dataValues['enableLogging']) {
  1. * MenuItemEntity constructor.
  2. */
  3. public function __construct()
  4. {
  5. $this->title = '';
  6. $this->options = []; /*new ArrayCollection();

    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 Guite
  7. $this->options = [
  8. 'routeParameters' => [],
  9. 'attributes' => [],
  10. 'linkAttributes' => [],
  11. 'childrenAttributes' => [],
  1. $record['level'] = ACCESS_COMMENT; // 300
  2. $record['bond'] = 0;
  3. $this->entityManager->persist($record);
  4. $lastPerm->setSequence($record->getSequence() + 1);
  5. $this->entityManager->flush();
  6. //$this->addFlash('success', $this->__('A permission rule was added to allow users access to "utility" themes. Please check the sequence.'));

    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 Guite
  7. case '1.1.2':
  8. // future upgrade routines
  9. }
  1. RouteEntity::class,
  2. ];
  3. public function install(): bool
  4. {
  5. //$logger = $this->container->get('logger');

    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 Guite
  6. // create all tables from according entity definitions
  7. try {
  8. $this->schemaTool->create($this->entities);
  9. } catch (Exception $exception) {
  1. // create all tables from according entity definitions
  2. try {
  3. $this->schemaTool->create($this->entities);
  4. } catch (Exception $exception) {
  5. $this->addFlash('error', $this->__('Doctrine Exception') . ': ' . $exception->getMessage());
  6. //$logger->error('{app}: Could not create the database tables during installation. Error details: {errorMessage}.', ['app' => 'ZikulaRoutesModule', 'errorMessage' => $exception->getMessage()]);

    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 Guite
  7. return false;
  8. }
  9. // set up all our vars with initial values
  1. return true;
  2. }
  3. public function uninstall(): bool
  4. {
  5. //$logger = $this->container->get('logger');

    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 Guite
  6. try {
  7. $this->schemaTool->drop($this->entities);
  8. } catch (Exception $exception) {
  9. $this->addFlash('error', $this->__('Doctrine Exception') . ': ' . $exception->getMessage());
  1. try {
  2. $this->schemaTool->drop($this->entities);
  3. } catch (Exception $exception) {
  4. $this->addFlash('error', $this->__('Doctrine Exception') . ': ' . $exception->getMessage());
  5. //$logger->error('{app}: Could not remove the database tables during uninstallation. Error details: {errorMessage}.', ['app' => 'ZikulaRoutesModule', 'errorMessage' => $exception->getMessage()]);

    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 Guite
  6. return false;
  7. }
  8. // remove all module vars
  1. if ($multilingual) {
  2. // get all available locales
  3. $langs = $installedLanguages;
  4. } else {
  5. // get only the default locale
  6. $langs = [$this->variableApi->getSystemVar('language_i18n', 'en')]; //$this->container->getParameter('locale');

    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 Guite
  7. }
  8. }
  9. $errors = '';
  1. $themeVarsPath = $this->getConfigPath() . '/variables.yml';
  2. if (!file_exists($themeVarsPath)) {
  3. return $defaultVars;
  4. }
  5. /*if (!$this->getContainer()) {

    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 Guite
  6. return $defaultVars;
  7. }*/
  8. $yamlVars = Yaml::parse(file_get_contents($themeVarsPath));
  9. if (!is_array($yamlVars)) {

PHP code should not contain unreachable code

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

  1. {
  2. // TODO #3920
  3. return true;
  4. // collect parents
  5. $isOnTop = false;
  6. $parentIds = [$category->getId()];
  7. $directParent = $category;
  8. while (false === $isOnTop) {
  9. $directParent = $category->getParent();
  10. if (null === $directParent) {
  11. $isOnTop = true;
  12. } else {
  13. $parentIds[] = $directParent->getId();
  14. }
  15. }
  16. // fetch registries
  17. $registries = $this->categoryRegistryRepository->findAll();
  18. // iterate over all registries
  19. foreach ($registries as $registry) {
  20. // check if the registry subtree contains our category
  21. if (!in_array($registry->getCategory()->getId(), $parentIds, true)) {
  22. continue;
  23. }
  24. // get information about responsible module
  25. if (!$this->kernel->isBundle($registry->getModname())) {
  26. continue;
  27. }
  28. $capabilities = $this->capabilityApi->getCapabilitiesOf($registry->getModname());
  29. foreach ($capabilities[CapabilityApi::CATEGORIZABLE] as $entityClass) {
  30. if (!is_subclass_of($entityClass, AbstractCategoryAssignment::class)) {
  31. continue;
  32. }
  33. // check if this mapping table contains a reference to the given category
  34. $mappings = $this->entityManager->getRepository($entityClass)
  35. ->findBy(['category' => $category]);
  36. if (count($mappings) > 0) {
  37. // existing reference found
  38. return false;
  39. }
  40. }
  41. }
  42. return true;

    This code is unreachable.

    Time to fix: about 1 hour
    Open Issue Permalink
    Last edited by Guite
  43. }
  44. }

Unused method, property, variable or parameter 12

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

  1. $boot->getPersistedBundles($this->kernel, $bundles);
  2. return true;
  3. }
  4. private function fireEvent(string $eventName, array $args = []): bool

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

    Time to fix: about 15 minutes
    Open Issue Permalink
    Last edited by Craig Heydenburg
  5. {
  6. $event = new GenericEvent();
  7. $event->setArguments($args);
  8. $this->eventDispatcher->dispatch($event);
  9. if ($event->isPropagationStopped()) {
  1. }
  2. /**
  3. * Helper function to sort modules.
  4. */
  5. private static function sortAdminModsByOrder(array $a, array $b): int

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

    Time to fix: about 15 minutes
    Open Issue Permalink
    Last edited by Guite
  6. {
  7. if ((int)$a['order'] === (int)$b['order']) {
  8. return strcmp($a['moduleName'], $b['moduleName']);
  9. }
  10. if ((int)$a['order'] > (int)$b['order']) {
  1. $this->setTranslator($translator);
  2. $this->factory = $factory;
  3. $this->capabilityApi = $capabilityApi;
  4. }
  5. public function createAdminMenu(array $options): ItemInterface

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

    Time to fix: about 15 minutes
    Open Issue Permalink
    Last edited by Guite
  6. {
  7. // @see https://gist.github.com/nateevans/9958390
  8. $menu = $this->factory->createItem('menuModuleAdminMenu');
  9. $menu->setChildrenAttribute('class', 'nav navbar-nav');
  1. $args['commandName'] = 'submit';
  2. $this->repeatCreateAction = true;
  3. }
  4. $action = $args['commandName'];
  5. $isRegularAction = 'delete' !== $action;

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

    Time to fix: about 15 minutes
    Open Issue Permalink
    Last edited by Guite
  6. $this->fetchInputData();
  7. $success = $this->applyAction($args);
  8. if (!$success) {
  1. }
  2. /**
  3. * Returns an array of additional template variables for view quick navigation forms.
  4. */
  5. protected function getViewQuickNavParametersForRoute(string $context = '', array $args = []): array

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

    Time to fix: about 15 minutes
    Open Issue Permalink
    Last edited by Guite
  6. {
  7. $parameters = [];
  8. $request = $this->requestStack->getCurrentRequest();
  9. if (null === $request) {
  10. return $parameters;
  1. }
  2. /**
  3. * Returns an array of additional template variables for view quick navigation forms.
  4. */
  5. protected function getViewQuickNavParametersForRoute(string $context = '', array $args = []): array

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

    Time to fix: about 15 minutes
    Open Issue Permalink
    Last edited by Guite
  6. {
  7. $parameters = [];
  8. $request = $this->requestStack->getCurrentRequest();
  9. if (null === $request) {
  10. return $parameters;
  1. /**
  2. * Returns an array of all allowed object types in ZikulaRoutesModule.
  3. *
  4. * @return string[] List of allowed object types
  5. */
  6. public function getObjectTypes(string $context = '', array $args = []): array

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

    Time to fix: about 15 minutes
    Open Issue Permalink
    Last edited by Guite
  7. {
  8. if (!in_array($context, ['controllerAction', 'api', 'helper', 'actionHandler', 'block', 'contentType', 'util'], true)) {
  9. $context = 'controllerAction';
  10. }
  1. }
  2. /**
  3. * Returns the default object type in ZikulaRoutesModule.
  4. */
  5. public function getDefaultObjectType(string $context = '', array $args = []): string

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

    Time to fix: about 15 minutes
    Open Issue Permalink
    Last edited by Guite
  6. {
  7. if (!in_array($context, ['controllerAction', 'api', 'helper', 'actionHandler', 'block', 'contentType', 'util'], true)) {
  8. $context = 'controllerAction';
  9. }
  1. /**
  2. * Filters a given collection of entities based on different permission checks.
  3. *
  4. * @param array|ArrayCollection $entities The given list of entities
  5. */
  6. public function filterCollection($objectType, $entities, int $permissionLevel, int $userId = null): array

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

    Time to fix: about 15 minutes
    Open Issue Permalink
    Last edited by Guite
  7. {
  8. $filteredEntities = [];
  9. foreach ($entities as $routes) {
  10. if (!$this->hasEntityPermission($routes, $permissionLevel, $userId)) {
  11. continue;
  1. }
  2. /**
  3. * Returns a translatable title for a certain action.
  4. */
  5. protected function getTitleForAction(string $currentState, string $actionId): string

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

    Time to fix: about 15 minutes
    Open Issue Permalink
    Last edited by Guite
  6. {
  7. $title = '';
  8. switch ($actionId) {
  9. case 'submit':
  10. $title = $this->translator->__('Submit');
  1. $entity = $event->getSubject();
  2. if (!$this->isEntityManagedByThisBundle($entity) || !method_exists($entity, 'get_objectType')) {
  3. return;
  4. }
  5. $objectType = $entity->get_objectType();

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

    Time to fix: about 15 minutes
    Open Issue Permalink
    Last edited by Axel Guckelsberger
  6. $permissionLevel = ACCESS_READ;
  7. $transitionName = $event->getTransition()->getName();
  8. $hasApproval = false;
  1. $this->setTranslator($translator);
  2. $this->factory = $factory;
  3. $this->permissionApi = $permissionApi;
  4. }
  5. public function createAdminMenu(array $options = []): ItemInterface

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

    Time to fix: about 15 minutes
    Open Issue Permalink
    Last edited by Guite
  6. {
  7. $menu = $this->factory->createItem('bootstrapThemeAdminMenu');
  8. $menu->setChildrenAttribute('class', 'nav navbar-nav');
  9. $menu->addChild($this->__('Home'), ['route' => 'home']);
  10. if ($this->permissionApi->hasPermission('ZikulaSettingsModule::', '::', ACCESS_ADMIN)) {

Web applications should contain a site.webmanifest file

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

in src/web

The web root doesn't contain a site.webmanifest file. The web app manifest provides information about a web application in a JSON text file, necessary for be presented to the user similarly to a native app

Time to fix: about 1 hour
Open Issue Permalink
Collective
  • src/web
    • uploads
    • favicon.ico
    • robots.txt

PHP code should follow PSR-1 basic coding standard 48

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

  1. public function __(string $msg, string $domain = null, string $locale = null): string
  2. {
  3. return $this->trans($msg, [], $domain, $locale);
  4. }
  5. public function _n(string $m1, string $m2, int $number, string $domain = null, string $locale = null): string

    Method names should be declared in camelCase.
    You should rename this method to comply with PSR-1.

    Time to fix: about 15 minutes
    Open Issue Permalink
    Last edited by Guite
  6. {
  7. $message = $this->chooseMessage($m1, $m2, $number, $domain);
  8. return $this->trans($message, ['%count%' => $number], $domain, $locale);
  9. }
  1. public function __f(string $msg, array $parameters = [], string $domain = null, string $locale = null): string
  2. {
  3. return $this->trans($msg, $parameters, $domain, $locale);
  4. }
  5. public function _fn(string $m1, string $m2, int $number, array $parameters = [], string $domain = null, string $locale = null): string

    Method names should be declared in camelCase.
    You should rename this method to comply with PSR-1.

    Time to fix: about 15 minutes
    Open Issue Permalink
    Last edited by Guite
  6. {
  7. $message = $this->chooseMessage($m1, $m2, $number, $domain);
  8. return $this->trans($message, ['%count%' => $number] + $parameters, $domain, $locale);
  9. }
  1. public function setChildren(Collection $children): void
  2. {
  3. $this->children = $children;
  4. }
  5. public function getIs_locked(): bool

    Method names should be declared in camelCase.
    You should rename this method to comply with PSR-1.

    Time to fix: about 15 minutes
    Open Issue Permalink
    Last edited by Guite
  6. {
  7. return $this->is_locked;
  8. }
  9. /**
  1. public function getIsLocked(): bool
  2. {
  3. return $this->getIs_locked();
  4. }
  5. public function setIs_locked(bool $is_locked): void

    Method names should be declared in camelCase.
    You should rename this method to comply with PSR-1.

    Time to fix: about 15 minutes
    Open Issue Permalink
    Last edited by Guite
  6. {
  7. $this->is_locked = $is_locked;
  8. }
  9. /**
  1. public function setIsLocked(bool $isLocked): void
  2. {
  3. $this->setIs_locked($isLocked);
  4. }
  5. public function getIs_leaf(): bool

    Method names should be declared in camelCase.
    You should rename this method to comply with PSR-1.

    Time to fix: about 15 minutes
    Open Issue Permalink
    Last edited by Guite
  6. {
  7. return $this->is_leaf;
  8. }
  9. /**
  1. public function getIsLeaf(): bool
  2. {
  3. return $this->getIs_leaf();
  4. }
  5. public function setIs_leaf(bool $is_leaf): void

    Method names should be declared in camelCase.
    You should rename this method to comply with PSR-1.

    Time to fix: about 15 minutes
    Open Issue Permalink
    Last edited by Guite
  6. {
  7. $this->is_leaf = $is_leaf;
  8. }
  9. /**
  1. }
  2. /**
  3. * @return array|string the category display name(s)
  4. */
  5. public function getDisplay_name(string $lang = null)

    Method names should be declared in camelCase.
    You should rename this method to comply with PSR-1.

    Time to fix: about 15 minutes
    Open Issue Permalink
    Last edited by Guite
  6. {
  7. if (!empty($lang)) {
  8. return $this->display_name[$lang] ?? $this->display_name['en'] ?? $this->name;
  9. }
  1. public function getDisplayName()
  2. {
  3. return $this->getDisplay_name();
  4. }
  5. public function setDisplay_name(array $display_name): void

    Method names should be declared in camelCase.
    You should rename this method to comply with PSR-1.

    Time to fix: about 15 minutes
    Open Issue Permalink
    Last edited by Guite
  6. {
  7. $this->display_name = $display_name;
  8. }
  9. /**
  1. }
  2. /**
  3. * @return array|string the category display description
  4. */
  5. public function getDisplay_desc(string $lang = null)

    Method names should be declared in camelCase.
    You should rename this method to comply with PSR-1.

    Time to fix: about 15 minutes
    Open Issue Permalink
    Last edited by Guite
  6. {
  7. if (!empty($lang)) {
  8. return $this->display_desc[$lang] ?? $this->display_desc['en'] ?? '';
  9. }
  1. public function getDisplayDesc(string $lang = null)
  2. {
  3. return $this->getDisplay_desc($lang);
  4. }
  5. public function setDisplay_desc(array $display_desc): void

    Method names should be declared in camelCase.
    You should rename this method to comply with PSR-1.

    Time to fix: about 15 minutes
    Open Issue Permalink
    Last edited by Guite
  6. {
  7. $this->display_desc = $display_desc;
  8. }
  9. /**
  1. $status = $status ? 'A' : 'I';
  2. }
  3. $this->status = $status;
  4. }
  5. public function getCr_date(): DateTime

    Method names should be declared in camelCase.
    You should rename this method to comply with PSR-1.

    Time to fix: about 15 minutes
    Open Issue Permalink
    Last edited by Guite
  6. {
  7. return $this->cr_date;
  8. }
  9. public function setCr_date(DateTime $cr_date): void
  1. public function getCr_date(): DateTime
  2. {
  3. return $this->cr_date;
  4. }
  5. public function setCr_date(DateTime $cr_date): void

    Method names should be declared in camelCase.
    You should rename this method to comply with PSR-1.

    Time to fix: about 15 minutes
    Open Issue Permalink
    Last edited by Guite
  6. {
  7. $this->cr_date = $cr_date;
  8. }
  9. public function getCr_uid(): UserEntity
  1. public function setCr_date(DateTime $cr_date): void
  2. {
  3. $this->cr_date = $cr_date;
  4. }
  5. public function getCr_uid(): UserEntity

    Method names should be declared in camelCase.
    You should rename this method to comply with PSR-1.

    Time to fix: about 15 minutes
    Open Issue Permalink
    Last edited by Guite
  6. {
  7. return $this->cr_uid;
  8. }
  9. public function setCr_uid(UserEntity $cr_uid): void
  1. public function getCr_uid(): UserEntity
  2. {
  3. return $this->cr_uid;
  4. }
  5. public function setCr_uid(UserEntity $cr_uid): void

    Method names should be declared in camelCase.
    You should rename this method to comply with PSR-1.

    Time to fix: about 15 minutes
    Open Issue Permalink
    Last edited by Guite
  6. {
  7. $this->cr_uid = $cr_uid;
  8. }
  9. public function getLu_date(): DateTime
  1. public function setCr_uid(UserEntity $cr_uid): void
  2. {
  3. $this->cr_uid = $cr_uid;
  4. }
  5. public function getLu_date(): DateTime

    Method names should be declared in camelCase.
    You should rename this method to comply with PSR-1.

    Time to fix: about 15 minutes
    Open Issue Permalink
    Last edited by Guite
  6. {
  7. return $this->lu_date;
  8. }
  9. public function setLu_date(DateTime $lu_date): void
  1. public function getLu_date(): DateTime
  2. {
  3. return $this->lu_date;
  4. }
  5. public function setLu_date(DateTime $lu_date): void

    Method names should be declared in camelCase.
    You should rename this method to comply with PSR-1.

    Time to fix: about 15 minutes
    Open Issue Permalink
    Last edited by Guite
  6. {
  7. $this->lu_date = $lu_date;
  8. }
  9. public function getLu_uid(): UserEntity
  1. public function setLu_date(DateTime $lu_date): void
  2. {
  3. $this->lu_date = $lu_date;
  4. }
  5. public function getLu_uid(): UserEntity

    Method names should be declared in camelCase.
    You should rename this method to comply with PSR-1.

    Time to fix: about 15 minutes
    Open Issue Permalink
    Last edited by Guite
  6. {
  7. return $this->lu_uid;
  8. }
  9. public function setLu_uid(UserEntity $lu_uid): void
  1. public function getLu_uid(): UserEntity
  2. {
  3. return $this->lu_uid;
  4. }
  5. public function setLu_uid(UserEntity $lu_uid): void

    Method names should be declared in camelCase.
    You should rename this method to comply with PSR-1.

    Time to fix: about 15 minutes
    Open Issue Permalink
    Last edited by Guite
  6. {
  7. $this->lu_uid = $lu_uid;
  8. }
  9. public function getAttributes(): ArrayCollection
  1. public function __(string $msg, string $domain = null, string $locale = null): string
  2. {
  3. return $this->trans($msg, [], $domain, $locale);
  4. }
  5. public function _n(string $m1, string $m2, int $number, string $domain = null, string $locale = null): string

    Method names should be declared in camelCase.
    You should rename this method to comply with PSR-1.

    Time to fix: about 15 minutes
    Open Issue Permalink
    Last edited by Guite
  6. {
  7. $message = $this->chooseMessage($m1, $m2, $number, $domain);
  8. return $this->trans($message, ['%count%' => $number], $domain, $locale);
  9. }
  1. public function __f(string $msg, array $parameters = [], string $domain = null, string $locale = null): string
  2. {
  3. return $this->trans($msg, $parameters, $domain, $locale);
  4. }
  5. public function _fn(string $m1, string $m2, int $number, array $parameters = [], string $domain = null, string $locale = null): string

    Method names should be declared in camelCase.
    You should rename this method to comply with PSR-1.

    Time to fix: about 15 minutes
    Open Issue Permalink
    Last edited by Guite
  6. {
  7. $message = $this->chooseMessage($m1, $m2, $number, $domain);
  8. return $this->trans($message, ['%count%' => $number] + $parameters, $domain, $locale);
  9. }
  1. $domain = $domain ?? $this->determineTranslationDomainFromContext($context);
  2. return $this->translator->__f(/** @Ignore */$message, $parameters, $domain, $locale);
  3. }
  4. public function _n(array $context, string $singular, string $plural, int $count, string $domain = null, string $locale = null): string

    Method names should be declared in camelCase.
    You should rename this method to comply with PSR-1.

    Time to fix: about 15 minutes
    Open Issue Permalink
    Last edited by Guite
  5. {
  6. $domain = $domain ?? $this->determineTranslationDomainFromContext($context);
  7. return $this->translator->_n(/** @Ignore */$singular, $plural, $count, $domain, $locale);
  8. }
  1. $domain = $domain ?? $this->determineTranslationDomainFromContext($context);
  2. return $this->translator->_n(/** @Ignore */$singular, $plural, $count, $domain, $locale);
  3. }
  4. public function _fn(array $context, string $singular, string $plural, int $count, array $parameters = [], string $domain = null, string $locale = null): string

    Method names should be declared in camelCase.
    You should rename this method to comply with PSR-1.

    Time to fix: about 15 minutes
    Open Issue Permalink
    Last edited by Guite
  5. {
  6. $domain = $domain ?? $this->determineTranslationDomainFromContext($context);
  7. return $this->translator->_fn(/** @Ignore */$singular, $plural, $count, $parameters, $domain, $locale);
  8. }
  1. }
  2. /**
  3. * Performs a plural translation.
  4. */
  5. public function _n(string $m1, string $m2, int $number, string $locale = null): string

    Method names should be declared in camelCase.
    You should rename this method to comply with PSR-1.

    Time to fix: about 15 minutes
    Open Issue Permalink
    Last edited by Guite
  6. {
  7. /** @Ignore */
  8. return $this->translator->_n($m1, $m2, $number, $this->domain, $locale);
  9. }
  1. }
  2. /**
  3. * Performs a format plural translation.
  4. */
  5. public function _fn(string $m1, string $m2, int $number, array $parameters = [], string $locale = null): string

    Method names should be declared in camelCase.
    You should rename this method to comply with PSR-1.

    Time to fix: about 15 minutes
    Open Issue Permalink
    Last edited by Guite
  6. {
  7. /** @Ignore */
  8. return $this->translator->_fn($m1, $m2, $number, $parameters, $this->domain, $locale);
  9. }
  1. }
  2. /**
  3. * Plural translations for modules.
  4. */
  5. public function _n(string $m1, string $m2, int $number, string $domain = null, string $locale = null): string

    Method names should be declared in camelCase.
    You should rename this method to comply with PSR-1.

    Time to fix: about 15 minutes
    Open Issue Permalink
    Last edited by Guite
  6. {
  7. return $this->translator->_n($m1, $m2, $number, $domain, $locale);
  8. }
  9. /**
  1. }
  2. /**
  3. * Format plural translations for modules.
  4. */
  5. public function _fn(string $m1, string $m2, int $number, array $parameters = [], string $domain = null, string $locale = null): string

    Method names should be declared in camelCase.
    You should rename this method to comply with PSR-1.

    Time to fix: about 15 minutes
    Open Issue Permalink
    Last edited by Guite
  6. {
  7. return $this->translator->_fn($m1, $m2, $number, $parameters, $domain, $locale);
  8. }
  9. public function getTranslator(): TranslatorInterface
  1. public function setActive(int $active): void
  2. {
  3. $this->active = $active;
  4. }
  5. public function getLast_Update(): DateTime

    Method names should be declared in camelCase.
    You should rename this method to comply with PSR-1.

    Time to fix: about 15 minutes
    Open Issue Permalink
    Last edited by Guite
  6. {
  7. return $this->last_update;
  8. }
  9. public function setLast_Update(): void
  1. public function getLast_Update(): DateTime
  2. {
  3. return $this->last_update;
  4. }
  5. public function setLast_Update(): void

    Method names should be declared in camelCase.
    You should rename this method to comply with PSR-1.

    Time to fix: about 15 minutes
    Open Issue Permalink
    Last edited by Guite
  6. {
  7. $this->last_update = new DateTime('now');
  8. }
  9. public function getLanguage(): string
  1. public function setCategory(CategoryEntity $category): void
  2. {
  3. $this->category = $category;
  4. }
  5. public function getCr_date(): DateTime

    Method names should be declared in camelCase.
    You should rename this method to comply with PSR-1.

    Time to fix: about 15 minutes
    Open Issue Permalink
    Last edited by Guite
  6. {
  7. return $this->cr_date;
  8. }
  9. public function setCr_date(DateTime $cr_date): void
  1. public function getCr_date(): DateTime
  2. {
  3. return $this->cr_date;
  4. }
  5. public function setCr_date(DateTime $cr_date): void

    Method names should be declared in camelCase.
    You should rename this method to comply with PSR-1.

    Time to fix: about 15 minutes
    Open Issue Permalink
    Last edited by Guite
  6. {
  7. $this->cr_date = $cr_date;
  8. }
  9. public function getCr_uid(): UserEntity
  1. public function setCr_date(DateTime $cr_date): void
  2. {
  3. $this->cr_date = $cr_date;
  4. }
  5. public function getCr_uid(): UserEntity

    Method names should be declared in camelCase.
    You should rename this method to comply with PSR-1.

    Time to fix: about 15 minutes
    Open Issue Permalink
    Last edited by Guite
  6. {
  7. return $this->cr_uid;
  8. }
  9. public function setCr_uid(UserEntity $cr_uid): void
  1. public function getCr_uid(): UserEntity
  2. {
  3. return $this->cr_uid;
  4. }
  5. public function setCr_uid(UserEntity $cr_uid): void

    Method names should be declared in camelCase.
    You should rename this method to comply with PSR-1.

    Time to fix: about 15 minutes
    Open Issue Permalink
    Last edited by Guite
  6. {
  7. $this->cr_uid = $cr_uid;
  8. }
  9. public function getLu_date(): DateTime
  1. public function setCr_uid(UserEntity $cr_uid): void
  2. {
  3. $this->cr_uid = $cr_uid;
  4. }
  5. public function getLu_date(): DateTime

    Method names should be declared in camelCase.
    You should rename this method to comply with PSR-1.

    Time to fix: about 15 minutes
    Open Issue Permalink
    Last edited by Guite
  6. {
  7. return $this->lu_date;
  8. }
  9. public function setLu_date(DateTime $lu_date): void
  1. public function getLu_date(): DateTime
  2. {
  3. return $this->lu_date;
  4. }
  5. public function setLu_date(DateTime $lu_date): void

    Method names should be declared in camelCase.
    You should rename this method to comply with PSR-1.

    Time to fix: about 15 minutes
    Open Issue Permalink
    Last edited by Guite
  6. {
  7. $this->lu_date = $lu_date;
  8. }
  9. public function getLu_uid(): UserEntity
  1. public function setLu_date(DateTime $lu_date): void
  2. {
  3. $this->lu_date = $lu_date;
  4. }
  5. public function getLu_uid(): UserEntity

    Method names should be declared in camelCase.
    You should rename this method to comply with PSR-1.

    Time to fix: about 15 minutes
    Open Issue Permalink
    Last edited by Guite
  6. {
  7. return $this->lu_uid;
  8. }
  9. public function setLu_uid(UserEntity $lu_uid): void
  1. public function getLu_uid(): UserEntity
  2. {
  3. return $this->lu_uid;
  4. }
  5. public function setLu_uid(UserEntity $lu_uid): void

    Method names should be declared in camelCase.
    You should rename this method to comply with PSR-1.

    Time to fix: about 15 minutes
    Open Issue Permalink
    Last edited by Guite
  6. {
  7. $this->lu_uid = $lu_uid;
  8. }
  9. public function getObj_status(): string
  1. public function setLu_uid(UserEntity $lu_uid): void
  2. {
  3. $this->lu_uid = $lu_uid;
  4. }
  5. public function getObj_status(): string

    Method names should be declared in camelCase.
    You should rename this method to comply with PSR-1.

    Time to fix: about 15 minutes
    Open Issue Permalink
    Last edited by Guite
  6. {
  7. return $this->obj_status;
  8. }
  9. public function setObj_status(string $obj_status): void
  1. public function getObj_status(): string
  2. {
  3. return $this->obj_status;
  4. }
  5. public function setObj_status(string $obj_status): void

    Method names should be declared in camelCase.
    You should rename this method to comply with PSR-1.

    Time to fix: about 15 minutes
    Open Issue Permalink
    Last edited by Guite
  6. {
  7. $this->obj_status = $obj_status;
  8. }
  9. }
  1. */
  2. public function __construct()
  3. {
  4. }
  5. public function get_objectType(): string

    Method names should be declared in camelCase.
    You should rename this method to comply with PSR-1.

    Time to fix: about 15 minutes
    Open Issue Permalink
    Last edited by Guite
  6. {
  7. return $this->_objectType;
  8. }
  9. public function set_objectType(string $_objectType): void
  1. public function get_objectType(): string
  2. {
  3. return $this->_objectType;
  4. }
  5. public function set_objectType(string $_objectType): void

    Method names should be declared in camelCase.
    You should rename this method to comply with PSR-1.

    Time to fix: about 15 minutes
    Open Issue Permalink
    Last edited by Guite
  6. {
  7. if ($this->_objectType !== $_objectType) {
  8. $this->_objectType = $_objectType ?? '';
  9. }
  10. }
  1. public function setActivated(int $activated): void
  2. {
  3. $this->activated = $activated;
  4. }
  5. public function getApproved_Date(): DateTime

    Method names should be declared in camelCase.
    You should rename this method to comply with PSR-1.

    Time to fix: about 15 minutes
    Open Issue Permalink
    Last edited by Guite
  6. {
  7. return $this->approved_date;
  8. }
  9. /**
  1. }
  2. /**
  3. * @param string|DateTime $approved_date the user's approved date
  4. */
  5. public function setApproved_Date($approved_date): void

    Method names should be declared in camelCase.
    You should rename this method to comply with PSR-1.

    Time to fix: about 15 minutes
    Open Issue Permalink
    Last edited by Guite
  6. {
  7. if ($approved_date instanceof DateTime) {
  8. $this->approved_date = $approved_date;
  9. } else {
  10. $this->approved_date = new DateTime($approved_date);
  1. } else {
  2. $this->approved_date = new DateTime($approved_date);
  3. }
  4. }
  5. public function getApproved_By(): int

    Method names should be declared in camelCase.
    You should rename this method to comply with PSR-1.

    Time to fix: about 15 minutes
    Open Issue Permalink
    Last edited by Guite
  6. {
  7. return $this->approved_by;
  8. }
  9. public function setApproved_By(int $approved_by): void
  1. public function getApproved_By(): int
  2. {
  3. return $this->approved_by;
  4. }
  5. public function setApproved_By(int $approved_by): void

    Method names should be declared in camelCase.
    You should rename this method to comply with PSR-1.

    Time to fix: about 15 minutes
    Open Issue Permalink
    Last edited by Guite
  6. {
  7. $this->approved_by = $approved_by;
  8. }
  9. public function isApproved(): bool
  1. public function isApproved(): bool
  2. {
  3. return 0 !== $this->approved_by;
  4. }
  5. public function getUser_Regdate(): DateTime

    Method names should be declared in camelCase.
    You should rename this method to comply with PSR-1.

    Time to fix: about 15 minutes
    Open Issue Permalink
    Last edited by Guite
  6. {
  7. return $this->user_regdate;
  8. }
  9. /**
  1. }
  2. /**
  3. * @param string|DateTime $user_regdate the user's regdate
  4. */
  5. public function setUser_Regdate($user_regdate): void

    Method names should be declared in camelCase.
    You should rename this method to comply with PSR-1.

    Time to fix: about 15 minutes
    Open Issue Permalink
    Last edited by Guite
  6. {
  7. if ($user_regdate instanceof DateTime) {
  8. $this->user_regdate = $user_regdate;
  9. } else {
  10. $this->user_regdate = new DateTime($user_regdate);
  1. public function setVerifycode(string $verifycode): void
  2. {
  3. $this->verifycode = $verifycode;
  4. }
  5. public function getCreated_Dt(): DateTime

    Method names should be declared in camelCase.
    You should rename this method to comply with PSR-1.

    Time to fix: about 15 minutes
    Open Issue Permalink
    Last edited by Guite
  6. {
  7. return $this->created_dt;
  8. }
  9. /**
  1. }
  2. /**
  3. * @param string|DateTime $created_dt the user verification's created date
  4. */
  5. public function setCreated_Dt($created_dt): void

    Method names should be declared in camelCase.
    You should rename this method to comply with PSR-1.

    Time to fix: about 15 minutes
    Open Issue Permalink
    Last edited by Guite
  6. {
  7. if ($created_dt instanceof DateTime) {
  8. $this->created_dt = $created_dt;
  9. } else {
  10. $this->created_dt = new DateTime($created_dt);