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

Source code should not contain tasks comments 11

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

  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. use Symfony\Component\HttpFoundation\Request;
  2. use Symfony\Component\HttpFoundation\RequestStack;
  3. use Symfony\Component\HttpFoundation\Response;
  4. use Symfony\Component\Routing\Annotation\Route;
  5. use Zikula\Core\Controller\AbstractController;
  6. use Zikula\Core\LinkContainer\LinkContainerCollector; // @todo remove

    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
  7. use Zikula\ExtensionsModule\Entity\RepositoryInterface\ExtensionRepositoryInterface;
  8. use Zikula\MenuModule\ExtensionMenu\ExtensionMenuCollector;
  9. use Zikula\ThemeModule\Engine\Asset;
  10. /**
  1. * Open the admin container
  2. */
  3. public function linksAction(
  4. RequestStack $requestStack,
  5. ExtensionRepositoryInterface $extensionRepository,
  6. LinkContainerCollector $linkCollector, // @todo remove

    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
  7. ExtensionMenuCollector $extensionMenuCollector
  8. ): Response {
  9. /** @var Request $masterRequest */
  10. $masterRequest = $requestStack->getMasterRequest();
  11. /** @var Request $currentRequest */
  1. // detect from masterRequest
  2. $links_type = '' !== $masterRequest->attributes->get('type') ? $masterRequest->attributes->get('type') : $links_type;
  3. // passed to currentRequest most important
  4. $links_type = '' !== $currentRequest->attributes->get('type') ? $currentRequest->attributes->get('type') : $links_type;
  5. // get the menu links
  6. $links = $linkCollector->getLinks($modname, $links_type); // @todo remove

    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
  7. $extensionMenu = $extensionMenuCollector->get($modname, $links_type);
  8. $extensionMenu->setChildrenAttribute('class', 'nav nav-modulelinks');
  9. }
  10. // menu css
  1. : '@ZikulaExtensionsModule/ExtensionsInterface/links.html.twig';
  2. return $this->render($template, [
  3. 'caller' => $caller,
  4. 'menu_css' => $menu_css,
  5. 'links' => $links, // @todo remove

    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
  6. 'extensionMenu' => $extensionMenu,
  7. 'current_path' => $masterRequest->getPathInfo()
  8. ]);
  9. }
  10. }
  1. {% endif %}
  2. {% endfor %}
  3. {% endmacro %}
  4. {% if extensionMenu|default %}
  5. {{ knp_menu_render(extensionMenu, {template: '@ZikulaMenuModule/Override/bootstrap_fontawesome.html.twig'}) }}
  6. {% elseif links|default %}{# @todo remove this and the macro above #}

    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
  7. <ul{% if menu_css.menuId is not empty %} id="{{ menu_css.menuId }}"{% endif %} class="nav nav-modulelinks{% if menu_css.menuClass is not empty %} {{ menu_css.menuClass }}{% endif %}">
  8. {{ _self.draw(links, menu_css, current_path, 1) }}
  9. </ul>
  10. {% endif %}
  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. }
  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. $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 ($request->hasSession() && ($session = $request->getSession())) {
  9. $session->set('_locale', $data['language_i18n']);
  10. }

Code should not be duplicated 10

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

  1. public function setIcon(string $icon): void
  2. {
  3. $this->icon = $icon ?? '';
  4. }
  5. public function getCr_date(): DateTime

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

    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 16 lines appear both in src/lib/Zikula/Bundle/CoreInstallerBundle/Controller/InstallerController.php:65 and src/lib/Zikula/Bundle/CoreInstallerBundle/Controller/UpgraderController.php:73.

    Time to fix: about 4 hours
    Open Issue Permalink
    Last edited by Craig Heydenburg
  7. if (null !== $session) {
  8. $session->getFlashBag()->add('danger', $wizard->getWarning());
  9. }
  10. return $this->renderResponse('@ZikulaCoreInstaller/error.html.twig', $templateParams);
  1. * @ORM\Column(name="sortorder", type="smallint", nullable=false)
  2. * @var int
  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:77 and src/lib/Zikula/Bundle/HookBundle/Dispatcher/Storage/Doctrine/Entity/HookRuntimeEntity.php:91.

    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. * 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 Symfony\Contracts\Translation\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/MailerModule/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 Symfony\Contracts\Translation\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 56 lines appear in src/system/BlocksModule/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 Symfony\Contracts\Translation\TranslatorInterface;
  8. use Zikula\Core\LinkContainer\LinkContainerInterface;
  9. use Zikula\PermissionsModule\Api\ApiInterface\PermissionApiInterface;
  1. * @Assert\Length(min="0", max="64", allowEmptyString="false")
  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:102 and src/system/ThemeModule/Entity/ThemeEntity.php:141.

    Time to fix: about 4 hours
    Open Issue Permalink
    Last edited by craigh
  6. {
  7. return $this->id;
  8. }
  9. public function setId(int $id): void
  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\GroupsModule\Form\Type;

    The next 26 lines appear both in src/system/GroupsModule/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. $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. }

Object parameters should be type hinted

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

  1. }
  2. $requiredDependents = $this->dependencyHelper->getDependentExtensions($extension);
  3. if (!empty($requiredDependents)) {
  4. if ($input->isInteractive()) {
  5. $names = implode(', ', array_map(function ($dependent) {

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

    Time to fix: about 1 hour
    Open Issue Permalink
    Last edited by Craig Heydenburg
  6. return $dependent->getModname();
  7. }, $requiredDependents));
  8. $io->error(sprintf('The extension is a required dependency of [%s]. Please uninstall these extensions first.', $names));
  9. }

Error silenced by the at sign (@) 2

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

  1. }
  2. public function createInstanceFromBKey(string $bKey): BlockHandlerInterface
  3. {
  4. if (false !== mb_strpos($bKey, ':')) {
  5. @trigger_error('The BKey should not contain the module name with a colon as of Core-3.0.0');

    Adding "@" before trigger_error('The BKey should not contain the module name with a colon as of Core-3.0.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 Craig Heydenburg
  6. }
  7. return $this->blockFactory->getInstance($bKey);
  8. }
  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

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. }

Commented code should not be committed 14

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

  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. }
  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. /** @var AbstractCategoryAssignment $categoryAssignmentEntity */
  2. foreach ($value as $categoryAssignmentEntity) {
  3. $registryKey = 'registry_' . $categoryAssignmentEntity->getCategoryRegistryId();
  4. $category = $categoryAssignmentEntity->getCategory();
  5. if (false !== mb_strpos(get_class($category), 'DoctrineProxy')) {
  6. //$this->entityManager->detach($category);

    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. $category = $this->entityManager->find(CategoryEntity::class, $category->getId());
  8. //$this->entityManager->persist($category);
  9. }
  10. if ($this->multiple) {
  1. $registryKey = 'registry_' . $categoryAssignmentEntity->getCategoryRegistryId();
  2. $category = $categoryAssignmentEntity->getCategory();
  3. if (false !== mb_strpos(get_class($category), 'DoctrineProxy')) {
  4. //$this->entityManager->detach($category);
  5. $category = $this->entityManager->find(CategoryEntity::class, $category->getId());
  6. //$this->entityManager->persist($category);

    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. if ($this->multiple) {
  9. $data[$registryKey][] = $category;
  10. } else {
  1. }
  2. $event = new ModuleStateEvent($bundle, $extensionEntity->toArray());
  3. $eventDispatcher->dispatch($event, CoreEvents::MODULE_POSTINSTALL);
  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($event, MailerEvents::SEND_MESSAGE_FAILURE);
  4. //throw new RuntimeException($this->trans('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 Craig Heydenburg
  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['instance'] = ':(ZikulaRssTheme|ZikulaPrinterTheme|ZikulaAtomTheme):';
  2. $record['level'] = ACCESS_COMMENT; // 300
  3. $this->entityManager->persist($record);
  4. $lastPerm->setSequence($record->getSequence() + 1);
  5. $this->entityManager->flush();
  6. //$this->addFlash('success', $this->trans('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 Craig Heydenburg
  7. case '1.1.2':
  8. // future upgrade routines
  9. }
  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)) {

Unused method, property, variable or parameter 11

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

  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. $allowedContexts = ['controllerAction', 'api', 'helper', 'actionHandler', 'block', 'contentType', 'mailz'];
  9. if (!in_array($context, $allowedContexts, true)) {
  10. $context = 'controllerAction';
  11. }
  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. $allowedContexts = ['controllerAction', 'api', 'helper', 'actionHandler', 'block', 'contentType', 'mailz'];
  8. if (!in_array($context, $allowedContexts, true)) {
  9. $context = 'controllerAction';
  10. }
  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->trans('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. 'combined_assets',
  2. $this->lifetime,
  3. $this->kernel->getCacheDir() . '/assets/' . $type
  4. );
  5. $key = md5(serialize($assets)) . (int)$this->minify . (int)$this->compress . $this->lifetime . '.combined.' . $type;
  6. $data = $cacheService->get($key, function() use ($cachedFiles, $type) {

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

    Time to fix: about 15 minutes
    Open Issue Permalink
    Last edited by Guite
  7. $data = [];
  8. foreach ($cachedFiles as $k => $file) {
  9. $this->readFile($data, $file, $type);
  10. // avoid exposure of absolute server path
  11. $pathParts = explode($this->rootDir, $file);
  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', 'navbar-nav');
  9. $menu->addChild($this->trans('Home'), ['route' => 'home']);
  10. if ($this->permissionApi->hasPermission('ZikulaSettingsModule::', '::', ACCESS_ADMIN)) {

PHP code should follow PSR-1 basic coding standard 38

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

  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. public function setIcon(string $icon): void
  2. {
  3. $this->icon = $icon ?? '';
  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(): Collection
  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);