Passed
Pull Request — master (#123)
by
unknown
05:05
created
Classes/Task/SuggestBuildTask.php 1 patch
Braces   +2 added lines, -4 removed lines patch added patch discarded remove patch
@@ -23,10 +23,8 @@
 block discarded – undo
23 23
  *
24 24
  * @access public
25 25
  */
26
-class SuggestBuildTask extends BaseTask
27
-{
28
-    public function execute()
29
-    {
26
+class SuggestBuildTask extends BaseTask {
27
+    public function execute() {
30 28
         $inputArray = [];
31 29
         $inputArray['-s'] = $this->solr;
32 30
 
Please login to merge, or discard this patch.
Classes/Command/SuggestBuildCommand.php 2 patches
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -74,12 +74,12 @@
 block discarded – undo
74 74
         $solr = Solr::getInstance($input->getOption('solr'));
75 75
         // Connect to Solr server.
76 76
         if (!$solr->ready) {
77
-            $io->error('ERROR: Connection to Solr core ("' . $input->getOption('solr') . '") not possible \n');
77
+            $io->error('ERROR: Connection to Solr core ("'.$input->getOption('solr').'") not possible \n');
78 78
             return BaseCommand::FAILURE;
79 79
         }
80 80
 
81 81
         if (!$solr->suggestBuild()) {
82
-            $io->error('ERROR: Sending the command suggest.build=true to Solr core ("' . $input->getOption('solr') . '") not possible \n');
82
+            $io->error('ERROR: Sending the command suggest.build=true to Solr core ("'.$input->getOption('solr').'") not possible \n');
83 83
             return BaseCommand::FAILURE;
84 84
         }
85 85
 
Please login to merge, or discard this patch.
Braces   +1 added lines, -2 removed lines patch added patch discarded remove patch
@@ -27,8 +27,7 @@
 block discarded – undo
27 27
  *
28 28
  * @access public
29 29
  */
30
-class SuggestBuildCommand extends Command
31
-{
30
+class SuggestBuildCommand extends Command {
32 31
 
33 32
     /**
34 33
      * Configure the command by defining the name, options and arguments
Please login to merge, or discard this patch.
Classes/Validation/XmlSchemesValidator.php 2 patches
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -46,7 +46,7 @@
 block discarded – undo
46 46
     {
47 47
         $xsd = '<?xml version="1.0" encoding="utf-8"?><xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified">';
48 48
         foreach ($this->schemes as $scheme) {
49
-            $xsd .= '<xs:import namespace="' . $scheme["namespace"] . '" schemaLocation="' . $scheme["schemaLocation"] . '"/>';
49
+            $xsd .= '<xs:import namespace="'.$scheme["namespace"].'" schemaLocation="'.$scheme["schemaLocation"].'"/>';
50 50
         }
51 51
         $xsd .= '</xs:schema>';
52 52
         return $value->schemaValidateSource($xsd);
Please login to merge, or discard this patch.
Braces   +2 added lines, -4 removed lines patch added patch discarded remove patch
@@ -24,14 +24,12 @@
 block discarded – undo
24 24
  *
25 25
  * @access public
26 26
  */
27
-class XmlSchemesValidator extends AbstractDlfValidator
28
-{
27
+class XmlSchemesValidator extends AbstractDlfValidator {
29 28
     use LibXmlTrait;
30 29
 
31 30
     private array $schemes;
32 31
 
33
-    public function __construct(array $configuration)
34
-    {
32
+    public function __construct(array $configuration) {
35 33
         parent::__construct(DOMDocument::class);
36 34
         $this->schemes = $configuration;
37 35
     }
Please login to merge, or discard this patch.
Classes/Validation/DOMDocumentValidationStack.php 1 patch
Braces   +2 added lines, -4 removed lines patch added patch discarded remove patch
@@ -22,10 +22,8 @@
 block discarded – undo
22 22
  *
23 23
  * @access public
24 24
  */
25
-class DOMDocumentValidationStack extends AbstractDlfValidationStack
26
-{
27
-    public function __construct(array $configuration)
28
-    {
25
+class DOMDocumentValidationStack extends AbstractDlfValidationStack {
26
+    public function __construct(array $configuration) {
29 27
         parent::__construct(\DOMDocument::class);
30 28
         $this->addValidators($configuration);
31 29
     }
Please login to merge, or discard this patch.
Classes/Validation/LibXmlTrait.php 2 patches
Braces   +1 added lines, -2 removed lines patch added patch discarded remove patch
@@ -14,8 +14,7 @@
 block discarded – undo
14 14
  * LICENSE.txt file that was distributed with this source code.
15 15
  */
16 16
 
17
-trait LibXmlTrait
18
-{
17
+trait LibXmlTrait {
19 18
     /**
20 19
      * Add the errors from the libxml error buffer as validation error.
21 20
      *
Please login to merge, or discard this patch.
Upper-Lower-Casing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -34,11 +34,11 @@
 block discarded – undo
34 34
 
35 35
     public function enableErrorBuffer(): void
36 36
     {
37
-        libxml_use_internal_errors(true);
37
+        libxml_use_internal_errors(TRUE);
38 38
     }
39 39
 
40 40
     public function disableErrorBuffer(): void
41 41
     {
42
-        libxml_use_internal_errors(false);
42
+        libxml_use_internal_errors(FALSE);
43 43
     }
44 44
 }
Please login to merge, or discard this patch.
Classes/Validation/AbstractDlfValidationStack.php 3 patches
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -54,7 +54,7 @@  discard block
 block discarded – undo
54 54
     {
55 55
         foreach ($configuration as $configurationItem) {
56 56
             if (!class_exists($configurationItem["className"])) {
57
-                $this->logger->error('Unable to load class ' . $configurationItem["className"] . '.');
57
+                $this->logger->error('Unable to load class '.$configurationItem["className"].'.');
58 58
                 throw new InvalidArgumentException('Unable to load validator class.', 1723200537037);
59 59
             }
60 60
             $breakOnError = !isset($configurationItem["breakOnError"]) || $configurationItem["breakOnError"] !== "false";
@@ -83,7 +83,7 @@  discard block
 block discarded – undo
83 83
         }
84 84
 
85 85
         if (!$validator instanceof AbstractDlfValidator) {
86
-            $this->logger->error($className . ' must be an instance of AbstractDlfValidator.');
86
+            $this->logger->error($className.' must be an instance of AbstractDlfValidator.');
87 87
             throw new InvalidArgumentException('Class must be an instance of AbstractDlfValidator.', 1723121212747);
88 88
         }
89 89
 
@@ -104,7 +104,7 @@  discard block
 block discarded – undo
104 104
     protected function isValid($value): void
105 105
     {
106 106
         if (!$value instanceof $this->valueClassName) {
107
-            $this->logger->error('Value must be an instance of ' . $this->valueClassName . '.');
107
+            $this->logger->error('Value must be an instance of '.$this->valueClassName.'.');
108 108
             throw new InvalidArgumentException('Type of value is not valid.', 1723127564821);
109 109
         }
110 110
 
Please login to merge, or discard this patch.
Braces   +2 added lines, -4 removed lines patch added patch discarded remove patch
@@ -26,8 +26,7 @@  discard block
 block discarded – undo
26 26
  *
27 27
  * @access public
28 28
  */
29
-abstract class AbstractDlfValidationStack extends AbstractDlfValidator
30
-{
29
+abstract class AbstractDlfValidationStack extends AbstractDlfValidator {
31 30
     use LoggerAwareTrait;
32 31
 
33 32
     const ITEM_KEY_TITLE = "title";
@@ -36,8 +35,7 @@  discard block
 block discarded – undo
36 35
 
37 36
     protected array $validatorStack = [];
38 37
 
39
-    public function __construct(string $valueClassName)
40
-    {
38
+    public function __construct(string $valueClassName) {
41 39
         parent::__construct($valueClassName);
42 40
     }
43 41
 
Please login to merge, or discard this patch.
Upper-Lower-Casing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -74,9 +74,9 @@
 block discarded – undo
74 74
      *
75 75
      * @return void
76 76
      */
77
-    protected function addValidator(string $className, string $title, bool $breakOnError = true, array $configuration = null): void
77
+    protected function addValidator(string $className, string $title, bool $breakOnError = TRUE, array $configuration = NULL): void
78 78
     {
79
-        if ($configuration === null) {
79
+        if ($configuration === NULL) {
80 80
             $validator = GeneralUtility::makeInstance($className);
81 81
         } else {
82 82
             $validator = GeneralUtility::makeInstance($className, $configuration);
Please login to merge, or discard this patch.
Classes/Validation/SaxonXslToSvrlValidator.php 3 patches
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -61,11 +61,11 @@
 block discarded – undo
61 61
     protected function process(mixed $value): string
62 62
     {
63 63
         // using source from standard input
64
-        $process = new Process(['java', '-jar', $this->jar, '-xsl:' . $this->xsl, '-s:-'], null, null, $value->saveXML());
64
+        $process = new Process(['java', '-jar', $this->jar, '-xsl:'.$this->xsl, '-s:-'], null, null, $value->saveXML());
65 65
         $process->run();
66 66
         // executes after the command finish
67 67
         if (!$process->isSuccessful()) {
68
-            $this->logger->error('Processing exits with code "' . $process->getExitCode() . '"');
68
+            $this->logger->error('Processing exits with code "'.$process->getExitCode().'"');
69 69
             throw new InvalidArgumentException('Processing was not successful.', 1724862680);
70 70
         }
71 71
         return $process->getOutput();
Please login to merge, or discard this patch.
Upper-Lower-Casing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -61,7 +61,7 @@
 block discarded – undo
61 61
     protected function process(mixed $value): string
62 62
     {
63 63
         // using source from standard input
64
-        $process = new Process(['java', '-jar', $this->jar, '-xsl:' . $this->xsl, '-s:-'], null, null, $value->saveXML());
64
+        $process = new Process(['java', '-jar', $this->jar, '-xsl:' . $this->xsl, '-s:-'], NULL, NULL, $value->saveXML());
65 65
         $process->run();
66 66
         // executes after the command finish
67 67
         if (!$process->isSuccessful()) {
Please login to merge, or discard this patch.
Braces   +2 added lines, -4 removed lines patch added patch discarded remove patch
@@ -30,14 +30,12 @@
 block discarded – undo
30 30
  *
31 31
  * @access public
32 32
  */
33
-class SaxonXslToSvrlValidator extends AbstractDlfValidator implements LoggerAwareInterface
34
-{
33
+class SaxonXslToSvrlValidator extends AbstractDlfValidator implements LoggerAwareInterface {
35 34
     private string $jar;
36 35
 
37 36
     private string $xsl;
38 37
 
39
-    public function __construct(array $configuration)
40
-    {
38
+    public function __construct(array $configuration) {
41 39
         parent::__construct(DOMDocument::class);
42 40
         $this->jar = GeneralUtility::getFileAbsFileName($configuration["jar"] ?? '');
43 41
         $this->xsl = GeneralUtility::getFileAbsFileName($configuration["xsl"] ?? '');
Please login to merge, or discard this patch.
Classes/Middleware/DOMDocumentValidation.php 3 patches
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -78,19 +78,19 @@
 block discarded – undo
78 78
         $validation = GeneralUtility::makeInstance(DOMDocumentValidationStack::class, $settings['domDocumentValidationValidators']);
79 79
 
80 80
         if (!GeneralUtility::isValidUrl($urlParam)) {
81
-            $this->logger->debug('Parameter "' . $urlParam . '" is not a valid url.');
81
+            $this->logger->debug('Parameter "'.$urlParam.'" is not a valid url.');
82 82
             throw new InvalidArgumentException('Value of url parameter is not a valid url.', 1724852611);
83 83
         }
84 84
 
85 85
         $content = GeneralUtility::getUrl($urlParam);
86 86
         if ($content === false) {
87
-            $this->logger->debug('Error while loading content of "' . $urlParam . '"');
87
+            $this->logger->debug('Error while loading content of "'.$urlParam.'"');
88 88
             throw new InvalidArgumentException('Error while loading content of url.', 1724420640);
89 89
         }
90 90
 
91 91
         $document = new DOMDocument();
92 92
         if ($document->loadXML($content) === false) {
93
-            $this->logger->debug('Error converting content of "' . $urlParam . '" to xml.');
93
+            $this->logger->debug('Error converting content of "'.$urlParam.'" to xml.');
94 94
             throw new InvalidArgumentException('Error converting content to xml.', 1724420648);
95 95
         }
96 96
 
Please login to merge, or discard this patch.
Braces   +1 added lines, -2 removed lines patch added patch discarded remove patch
@@ -33,8 +33,7 @@
 block discarded – undo
33 33
  * @subpackage dlf
34 34
  * @access public
35 35
  */
36
-class DOMDocumentValidation implements MiddlewareInterface
37
-{
36
+class DOMDocumentValidation implements MiddlewareInterface {
38 37
     use LoggerAwareTrait;
39 38
 
40 39
     /**
Please login to merge, or discard this patch.
Upper-Lower-Casing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -83,13 +83,13 @@
 block discarded – undo
83 83
         }
84 84
 
85 85
         $content = GeneralUtility::getUrl($urlParam);
86
-        if ($content === false) {
86
+        if ($content === FALSE) {
87 87
             $this->logger->debug('Error while loading content of "' . $urlParam . '"');
88 88
             throw new InvalidArgumentException('Error while loading content of url.', 1724420640);
89 89
         }
90 90
 
91 91
         $document = new DOMDocument();
92
-        if ($document->loadXML($content) === false) {
92
+        if ($document->loadXML($content) === FALSE) {
93 93
             $this->logger->debug('Error converting content of "' . $urlParam . '" to xml.');
94 94
             throw new InvalidArgumentException('Error converting content to xml.', 1724420648);
95 95
         }
Please login to merge, or discard this patch.
Tests/Unit/Validation/SaxonXslToSvrlValidatorTest.php 3 patches
Braces   +1 added lines, -2 removed lines patch added patch discarded remove patch
@@ -28,8 +28,7 @@
 block discarded – undo
28 28
  *
29 29
  * @access public
30 30
  */
31
-class SaxonXslToSvrlValidatorTest extends UnitTestCase
32
-{
31
+class SaxonXslToSvrlValidatorTest extends UnitTestCase {
33 32
     const SVRL = <<<SVRL
34 33
         <svrl:schematron-output
35 34
             xmlns:svrl="http://purl.oclc.org/dsdl/schematron">
Please login to merge, or discard this patch.
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -48,7 +48,7 @@  discard block
 block discarded – undo
48 48
     {
49 49
         parent::setUp();
50 50
         $this->resetSingletonInstances = true;
51
-        $this->dlfExtensionPath = Environment::getExtensionsPath() . 'dlf';
51
+        $this->dlfExtensionPath = Environment::getExtensionsPath().'dlf';
52 52
     }
53 53
 
54 54
     public function testJarFileNotFound(): void
@@ -63,12 +63,12 @@  discard block
 block discarded – undo
63 63
         $this->expectException(InvalidArgumentException::class);
64 64
         $this->expectExceptionMessage("XSL Schematron file not found.");
65 65
         // It only checks if a file exists at the specified path, so we can use one of the test files.
66
-        new SaxonXslToSvrlValidator(["jar" => $this->dlfExtensionPath . '/Tests/Fixtures/Format/alto.xml']);
66
+        new SaxonXslToSvrlValidator(["jar" => $this->dlfExtensionPath.'/Tests/Fixtures/Format/alto.xml']);
67 67
     }
68 68
 
69 69
     public function testValidation(): void
70 70
     {
71
-        $saxonXslToSvrlValidator = new SaxonXslToSvrlValidator(["jar" => $this->dlfExtensionPath . '/Tests/Fixtures/Format/alto.xml', "xsl" => $this->dlfExtensionPath . '/Tests/Fixtures/Format/alto.xml']);
71
+        $saxonXslToSvrlValidator = new SaxonXslToSvrlValidator(["jar" => $this->dlfExtensionPath.'/Tests/Fixtures/Format/alto.xml', "xsl" => $this->dlfExtensionPath.'/Tests/Fixtures/Format/alto.xml']);
72 72
         $reflection = new ReflectionClass($saxonXslToSvrlValidator);
73 73
 
74 74
         $result = $reflection->getProperty("result");
Please login to merge, or discard this patch.
Upper-Lower-Casing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -47,7 +47,7 @@  discard block
 block discarded – undo
47 47
     public function setUp(): void
48 48
     {
49 49
         parent::setUp();
50
-        $this->resetSingletonInstances = true;
50
+        $this->resetSingletonInstances = TRUE;
51 51
         $this->dlfExtensionPath = Environment::getExtensionsPath() . 'dlf';
52 52
     }
53 53
 
@@ -72,11 +72,11 @@  discard block
 block discarded – undo
72 72
         $reflection = new ReflectionClass($saxonXslToSvrlValidator);
73 73
 
74 74
         $result = $reflection->getProperty("result");
75
-        $result->setAccessible(true);
75
+        $result->setAccessible(TRUE);
76 76
         $result->setValue($saxonXslToSvrlValidator, new Result());
77 77
 
78 78
         $method = $reflection->getMethod("addErrorsOfSvrl");
79
-        $method->setAccessible(true);
79
+        $method->setAccessible(TRUE);
80 80
         $method->invoke($saxonXslToSvrlValidator, self::SVRL);
81 81
 
82 82
         self::assertTrue($result->getValue($saxonXslToSvrlValidator)->hasErrors());
Please login to merge, or discard this patch.