From 13f8af452937a7d5b72d18714c1b69a14df89cbb Mon Sep 17 00:00:00 2001
From: Demian Katz <demian.katz@villanova.edu>
Date: Thu, 7 May 2020 09:21:20 -0400
Subject: [PATCH] PHPMD fixes.

---
 .../VuFindConsole/Command/Language/AbstractCommandFactory.php   | 2 ++
 .../src/VuFindConsole/Command/ScheduledSearch/NotifyCommand.php | 2 ++
 .../VuFindConsole/Command/Util/CleanUpRecordCacheCommand.php    | 2 ++
 .../src/VuFindConsole/Command/Util/CommitCommand.php            | 2 ++
 .../src/VuFindTest/Command/Language/DeleteCommandTest.php       | 1 -
 .../src/VuFindTest/Command/Util/AbstractExpireCommandTest.php   | 2 +-
 6 files changed, 9 insertions(+), 2 deletions(-)

diff --git a/module/VuFindConsole/src/VuFindConsole/Command/Language/AbstractCommandFactory.php b/module/VuFindConsole/src/VuFindConsole/Command/Language/AbstractCommandFactory.php
index 4e3bcfb5d48..20c2383b60f 100644
--- a/module/VuFindConsole/src/VuFindConsole/Command/Language/AbstractCommandFactory.php
+++ b/module/VuFindConsole/src/VuFindConsole/Command/Language/AbstractCommandFactory.php
@@ -56,6 +56,8 @@ class AbstractCommandFactory implements FactoryInterface
      * @throws ServiceNotCreatedException if an exception is raised when
      * creating a service.
      * @throws ContainerException if any other error occurs
+     *
+     * @SuppressWarnings(PHPMD.UnusedFormalParameter)
      */
     public function __invoke(ContainerInterface $container, $requestedName,
         array $options = null
diff --git a/module/VuFindConsole/src/VuFindConsole/Command/ScheduledSearch/NotifyCommand.php b/module/VuFindConsole/src/VuFindConsole/Command/ScheduledSearch/NotifyCommand.php
index 827575c2072..2bfc925b25a 100644
--- a/module/VuFindConsole/src/VuFindConsole/Command/ScheduledSearch/NotifyCommand.php
+++ b/module/VuFindConsole/src/VuFindConsole/Command/ScheduledSearch/NotifyCommand.php
@@ -231,6 +231,8 @@ class NotifyCommand extends Command implements TranslatorAwareInterface
      * @param OutputInterface $output Output object
      *
      * @return int 0 for success
+     *
+     * @SuppressWarnings(PHPMD.UnusedFormalParameter)
      */
     protected function execute(InputInterface $input, OutputInterface $output)
     {
diff --git a/module/VuFindConsole/src/VuFindConsole/Command/Util/CleanUpRecordCacheCommand.php b/module/VuFindConsole/src/VuFindConsole/Command/Util/CleanUpRecordCacheCommand.php
index 74a9bf05dcd..24578d1fde7 100644
--- a/module/VuFindConsole/src/VuFindConsole/Command/Util/CleanUpRecordCacheCommand.php
+++ b/module/VuFindConsole/src/VuFindConsole/Command/Util/CleanUpRecordCacheCommand.php
@@ -90,6 +90,8 @@ class CleanUpRecordCacheCommand extends Command
      * @param OutputInterface $output Output object
      *
      * @return int 0 for success
+     *
+     * @SuppressWarnings(PHPMD.UnusedFormalParameter)
      */
     protected function execute(InputInterface $input, OutputInterface $output)
     {
diff --git a/module/VuFindConsole/src/VuFindConsole/Command/Util/CommitCommand.php b/module/VuFindConsole/src/VuFindConsole/Command/Util/CommitCommand.php
index 8601805e5aa..56b4be62b1d 100644
--- a/module/VuFindConsole/src/VuFindConsole/Command/Util/CommitCommand.php
+++ b/module/VuFindConsole/src/VuFindConsole/Command/Util/CommitCommand.php
@@ -82,6 +82,8 @@ class CommitCommand extends AbstractSolrCommand
      * @param OutputInterface $output Output object
      *
      * @return int 0 for success
+     *
+     * @SuppressWarnings(PHPMD.UnusedFormalParameter)
      */
     protected function execute(InputInterface $input, OutputInterface $output)
     {
diff --git a/module/VuFindConsole/tests/unit-tests/src/VuFindTest/Command/Language/DeleteCommandTest.php b/module/VuFindConsole/tests/unit-tests/src/VuFindTest/Command/Language/DeleteCommandTest.php
index 24594ad32aa..1a560dc93df 100644
--- a/module/VuFindConsole/tests/unit-tests/src/VuFindTest/Command/Language/DeleteCommandTest.php
+++ b/module/VuFindConsole/tests/unit-tests/src/VuFindTest/Command/Language/DeleteCommandTest.php
@@ -101,7 +101,6 @@ class DeleteCommandTest extends \PHPUnit\Framework\TestCase
      */
     public function testDeletingNonExistentString()
     {
-        $expectedPath = realpath($this->languageFixtureDir) . '/foo/en.ini';
         $command = $this->getMockCommand();
         $commandTester = new CommandTester($command);
         $commandTester->execute(['target' => 'foo::barzap']);
diff --git a/module/VuFindConsole/tests/unit-tests/src/VuFindTest/Command/Util/AbstractExpireCommandTest.php b/module/VuFindConsole/tests/unit-tests/src/VuFindTest/Command/Util/AbstractExpireCommandTest.php
index 576d3c04382..cf299c2fa52 100644
--- a/module/VuFindConsole/tests/unit-tests/src/VuFindTest/Command/Util/AbstractExpireCommandTest.php
+++ b/module/VuFindConsole/tests/unit-tests/src/VuFindTest/Command/Util/AbstractExpireCommandTest.php
@@ -76,7 +76,7 @@ class AbstractExpireCommandTest extends \PHPUnit\Framework\TestCase
         $this->expectExceptionMessage(
             get_class($table) . ' does not support getExpiredIdRange()'
         );
-        $command = new $this->targetClass($table, 'foo');
+        new $this->targetClass($table, 'foo');
     }
 
     /**
-- 
GitLab