Missing use statement should be avoided 5

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

  1. *
  2. * @Action
  3. * @param string $name Instance name
  4. * @param string $selfedit Edit mouf or instance project
  5. */
  6. public function index($name = null, $selfedit = "false")

    The @Action annotation looks like a class annotation which resolves to the Mouf\Utils\I18n\Fine\Manage\Bo\Controller\Action class which PHP does not seem to be able to autoload.

    Time to fix: about 15 minutes
    Open Issue Permalink
    Last edited by Marc Teyssier
  7. {
  8. $this->selfedit = $selfedit;
  9. $this->instanceName = $name;
  10. $this->template->getWebLibraryManager()->addLibrary(new WebLibrary(
  1. /**
  2. * @Action
  3. * @param unknown $instanceName
  4. * @param string $selfedit
  5. */
  6. public function getAllTranslation($instanceName, $selfedit = "false")

    The @Action annotation looks like a class annotation which resolves to the Mouf\Utils\I18n\Fine\Manage\Bo\Controller\Action class which PHP does not seem to be able to autoload.

    Time to fix: about 15 minutes
    Open Issue Permalink
    Last edited by Marc Teyssier
  7. {
  8. $translations = $this->getAllMessagesFromService($selfedit, $instanceName);
  9. $invertTranslations = [];
  10. $languages = [];
  11. foreach ($translations as $language => $translation) {
  1. /**
  2. * @Action
  3. * @param unknown $instanceName
  4. * @param string $selfedit
  5. */
  6. public function getTranslationsOfKey($key, $instanceName, $selfedit = "false")

    The @Action annotation looks like a class annotation which resolves to the Mouf\Utils\I18n\Fine\Manage\Bo\Controller\Action class which PHP does not seem to be able to autoload.

    Time to fix: about 15 minutes
    Open Issue Permalink
    Last edited by Marc Teyssier
  7. {
  8. $translations = $this->getTranslationsForKeyFromService($selfedit, $instanceName, $key);
  9. echo json_encode($translations);
  10. }
  1. /**
  2. * @Action
  3. * @param unknown $instanceName
  4. * @param string $selfedit
  5. */
  6. public function setTranslationsOfKey($key, $translations, $instanceName, $selfedit = "false")

    The @Action annotation looks like a class annotation which resolves to the Mouf\Utils\I18n\Fine\Manage\Bo\Controller\Action class which PHP does not seem to be able to autoload.

    Time to fix: about 15 minutes
    Open Issue Permalink
    Last edited by Marc Teyssier
  7. {
  8. $translations = json_decode($translations, true);
  9. $this->setTranslationsForKeyFromService($selfedit, $instanceName, $key, $translations);
  10. echo json_encode(true);
  11. }
  1. /**
  2. * @Action
  3. * @param unknown $instanceName
  4. * @param string $selfedit
  5. */
  6. public function deleteTranslation($key, $instanceName, $selfedit = "false", $language = null)

    The @Action annotation looks like a class annotation which resolves to the Mouf\Utils\I18n\Fine\Manage\Bo\Controller\Action class which PHP does not seem to be able to autoload.

    Time to fix: about 15 minutes
    Open Issue Permalink
    Last edited by Marc Teyssier
  7. {
  8. $this->deleteTranslationFromService($selfedit, $instanceName, $key, $language);
  9. }
  10. }

Commented code should not be committed 2

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

  1. /*
  2. * Copyright (c) 2012-2015 Marc TEYSSIER
  3. *
  4. * See the file LICENSE.txt for copying permission.
  5. */
  6. //require '../../utils.i18n.fine.common/src/Ui/EditTranslationInterface.php';

    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 David Négrier
  7. //require 'Controller/ManageBoController.php';
  8. MoufUtils::registerMainMenu('htmlMainMenu', 'HTML', null, 'mainMenu', 40);
  9. MoufUtils::registerMenuItem('htmlFineMainMenu', 'Fine', null, 'htmlMainMenu', 10);
  10. MoufUtils::registerChooseInstanceMenuItem('htmlFineManageBoMenuItem', 'Manage translations', 'manageBo/', "Mouf\\Utils\\I18n\\Fine\\Common\\Ui\\EditTranslationInterface", 'htmlFineMainMenu', 20);
in src/ManageBoAdmin.php, line 10
  1. * Copyright (c) 2012-2015 Marc TEYSSIER
  2. *
  3. * See the file LICENSE.txt for copying permission.
  4. */
  5. //require '../../utils.i18n.fine.common/src/Ui/EditTranslationInterface.php';
  6. //require 'Controller/ManageBoController.php';

    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 David Négrier
  7. MoufUtils::registerMainMenu('htmlMainMenu', 'HTML', null, 'mainMenu', 40);
  8. MoufUtils::registerMenuItem('htmlFineMainMenu', 'Fine', null, 'htmlMainMenu', 10);
  9. MoufUtils::registerChooseInstanceMenuItem('htmlFineManageBoMenuItem', 'Manage translations', 'manageBo/', "Mouf\\Utils\\I18n\\Fine\\Common\\Ui\\EditTranslationInterface", 'htmlFineMainMenu', 20);