Passed
Pull Request — master (#583)
by Michael
14:01
created
xoops_lib/Xoops/Core/Locale/Time.php 1 patch
Spacing   +10 added lines, -10 removed lines patch added patch discarded remove patch
@@ -82,7 +82,7 @@  discard block
 block discarded – undo
82 82
         $data = Data::get('dateFields', $locale);
83 83
 
84 84
         $diff = $dateStart->diff($dateEnd, false);
85
-        $past = (boolean) $diff->invert;
85
+        $past = (boolean)$diff->invert;
86 86
         $value = 0;
87 87
         $key = '';
88 88
         if ($diff->y != 0) {
@@ -104,11 +104,11 @@  discard block
 block discarded – undo
104 104
             $key = 'second';
105 105
             $value = $diff->s;
106 106
         }
107
-        if ($value==0) {
107
+        if ($value == 0) {
108 108
             $key = 'second';
109 109
             $relKey = 'relative-type-0';
110 110
             $relPattern = null;
111
-        } elseif ($key === 'day' && $value >1 && $value <7) {
111
+        } elseif ($key === 'day' && $value > 1 && $value < 7) {
112 112
             $dow = $dateEnd->format('N') - 1;
113 113
             $days = array('mon', 'tue', 'wed', 'thu', 'fri', 'sat', 'sun');
114 114
             $key = $days[$dow];
@@ -121,11 +121,11 @@  discard block
 block discarded – undo
121 121
             } else {
122 122
                 $relKey = ($past) ? 'relativeTime-type-past' : 'relativeTime-type-future';
123 123
                 $rule = Plural::getRule($value, $locale);
124
-                $relPattern = 'relativeTimePattern-count-' . $rule;
124
+                $relPattern = 'relativeTimePattern-count-'.$rule;
125 125
             }
126 126
         }
127
-        if (!empty($width) && array_key_exists($key . '-' . $width, $data)) {
128
-            $key .= '-' . $width;
127
+        if (!empty($width) && array_key_exists($key.'-'.$width, $data)) {
128
+            $key .= '-'.$width;
129 129
         }
130 130
         if (empty($relPattern)) {
131 131
             $relativeString = $data[$key][$relKey];
@@ -234,7 +234,7 @@  discard block
 block discarded – undo
234 234
 
235 235
         $locales = array($locale, $language);
236 236
         foreach ($locales as $name) {
237
-            $i18nScript = 'media/jquery/ui/i18n/datepicker-' . $name . '.js';
237
+            $i18nScript = 'media/jquery/ui/i18n/datepicker-'.$name.'.js';
238 238
             if (file_exists($xoops->path($i18nScript))) {
239 239
                 $xoops->theme()->addBaseScriptAssets($i18nScript);
240 240
                 return;
@@ -338,7 +338,7 @@  discard block
 block discarded – undo
338 338
         }
339 339
 
340 340
         foreach ($pieces as $i => $piece) {
341
-            $piece = (int) ltrim($piece, '0');
341
+            $piece = (int)ltrim($piece, '0');
342 342
             switch ($order[$i]) {
343 343
                 case 'd':
344 344
                     $day = $piece;
@@ -352,7 +352,7 @@  discard block
 block discarded – undo
352 352
             }
353 353
         }
354 354
         if ($year < 100) {
355
-            if ($year<70) {
355
+            if ($year < 70) {
356 356
                 $year += 2000;
357 357
             } else {
358 358
                 $year += 1900;
@@ -445,7 +445,7 @@  discard block
 block discarded – undo
445 445
         }
446 446
 
447 447
         foreach ($pieces as $i => $piece) {
448
-            $piece = (int) ltrim($piece, '0');
448
+            $piece = (int)ltrim($piece, '0');
449 449
             switch ($order[$i]) {
450 450
                 case 'h':
451 451
                     $hour = $piece;
Please login to merge, or discard this patch.
xoops_lib/Xoops/Core/Locale/LegacyCodes.php 1 patch
Spacing   +28 added lines, -28 removed lines patch added patch discarded remove patch
@@ -39,34 +39,34 @@
 block discarded – undo
39 39
 class LegacyCodes
40 40
 {
41 41
     private static $rawCodes = array(
42
-        ['ar_SA', 'ar',      'ar-Arab-SA', ['arabic']],
43
-        ['bg_BG', 'bg',      'bg-Cyrl-BG', ['bulgarian']],
44
-        ['cs_CZ', 'cs',      'cs-Latn-CZ', ['czech']],
45
-        ['da_DK', 'da',      'da-Latn-DK', ['danish']],
46
-        ['de_DE', 'de',      'de-Latn-DE', ['german']],
47
-        ['el_GR', 'el',      'el-Grek-GR', ['greek']],
48
-        ['en_US', 'en',      'en-Latn-US', ['english']],
49
-        ['es_ES', 'es',      'es-Latn-ES', ['spanish']],
50
-        ['fa_IR', 'fa',      'fa-Arab-IR', ['persian']],
51
-        ['fr_FR', 'fr',      'fr-Latn-FR', ['french']],
52
-        ['hr_HR', 'hr',      'hr-Latn-HR', ['croatian']],
53
-        ['hu_HU', 'hu',      'hu-Latn-HU', ['hungarian']],
54
-        ['it_IT', 'it',      'it-Latn-IT', ['italian']],
55
-        ['ja_JP', 'ja',      'ja-Jpan-JP', ['japanese']],
56
-        ['ko_KR', 'ko',      'ko-Kore-KR', ['korean']],
57
-        ['ms_MY', 'ms',      'ms-Latn-MY', ['malaysian']],
58
-        ['nl_NL', 'nl',      'nl-Latn-NL', ['dutch']],
59
-        ['no_NO', 'no',      'no-Latn-NO', ['norwegian']],
60
-        ['pl_PL', 'pl',      'pl-Latn-PL', ['polish']],
61
-        ['pt_BR', 'pt',      'pt-Latn-BR', ['portuguesebr', 'brazilian']],
62
-        ['pt_PT', 'pt_PT',   'pt-Latn-PT', ['portuguese']],
63
-        ['ru_RU', 'ru',      'ru-Cyrl-RU', ['russian']],
64
-        ['sk_SK', 'sk',      'sk-Latn-SK', ['slovak']],
65
-        ['sl_SI', 'sl',      'sl-Latn-SI', ['slovenian']],
66
-        ['sv_SE', 'sv',      'sv-Latn-SE', ['swedish']],
67
-        ['th_TH', 'th',      'th-Thai-TH', ['thai']],
68
-        ['tr_TR', 'tr',      'tr-Latn-TR', ['turkish']],
69
-        ['vi_VN', 'vi',      'vi-Latn-VN', ['vietnamese']],
42
+        ['ar_SA', 'ar', 'ar-Arab-SA', ['arabic']],
43
+        ['bg_BG', 'bg', 'bg-Cyrl-BG', ['bulgarian']],
44
+        ['cs_CZ', 'cs', 'cs-Latn-CZ', ['czech']],
45
+        ['da_DK', 'da', 'da-Latn-DK', ['danish']],
46
+        ['de_DE', 'de', 'de-Latn-DE', ['german']],
47
+        ['el_GR', 'el', 'el-Grek-GR', ['greek']],
48
+        ['en_US', 'en', 'en-Latn-US', ['english']],
49
+        ['es_ES', 'es', 'es-Latn-ES', ['spanish']],
50
+        ['fa_IR', 'fa', 'fa-Arab-IR', ['persian']],
51
+        ['fr_FR', 'fr', 'fr-Latn-FR', ['french']],
52
+        ['hr_HR', 'hr', 'hr-Latn-HR', ['croatian']],
53
+        ['hu_HU', 'hu', 'hu-Latn-HU', ['hungarian']],
54
+        ['it_IT', 'it', 'it-Latn-IT', ['italian']],
55
+        ['ja_JP', 'ja', 'ja-Jpan-JP', ['japanese']],
56
+        ['ko_KR', 'ko', 'ko-Kore-KR', ['korean']],
57
+        ['ms_MY', 'ms', 'ms-Latn-MY', ['malaysian']],
58
+        ['nl_NL', 'nl', 'nl-Latn-NL', ['dutch']],
59
+        ['no_NO', 'no', 'no-Latn-NO', ['norwegian']],
60
+        ['pl_PL', 'pl', 'pl-Latn-PL', ['polish']],
61
+        ['pt_BR', 'pt', 'pt-Latn-BR', ['portuguesebr', 'brazilian']],
62
+        ['pt_PT', 'pt_PT', 'pt-Latn-PT', ['portuguese']],
63
+        ['ru_RU', 'ru', 'ru-Cyrl-RU', ['russian']],
64
+        ['sk_SK', 'sk', 'sk-Latn-SK', ['slovak']],
65
+        ['sl_SI', 'sl', 'sl-Latn-SI', ['slovenian']],
66
+        ['sv_SE', 'sv', 'sv-Latn-SE', ['swedish']],
67
+        ['th_TH', 'th', 'th-Thai-TH', ['thai']],
68
+        ['tr_TR', 'tr', 'tr-Latn-TR', ['turkish']],
69
+        ['vi_VN', 'vi', 'vi-Latn-VN', ['vietnamese']],
70 70
         ['zh_CN', 'zh_Hans', 'zh-Hans-CN', ['schinese']],
71 71
         ['zh_TW', 'zh_Hant', 'zh-Hant-TW', ['tchinese', 'chinese_zh']],
72 72
     );
Please login to merge, or discard this patch.
xoops_lib/Xoops/Core/ComposerUtility.php 1 patch
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -54,13 +54,13 @@  discard block
 block discarded – undo
54 54
         $this->output = array();
55 55
         $this->errors = array();
56 56
 
57
-        $options = ' ' . trim($this->exeOptions) . ' ';
57
+        $options = ' '.trim($this->exeOptions).' ';
58 58
 
59 59
         if (empty($this->exe)) {
60 60
             $exeFinder = new PhpExecutableFinder();
61 61
             $foundExe = $exeFinder->find();
62 62
             if ($foundExe) {
63
-                $this->exe = $foundExe . ' composer.phar';
63
+                $this->exe = $foundExe.' composer.phar';
64 64
             } else {
65 65
                 $this->errors[] = 'Cannot find PHP executable';
66 66
                 return false;
@@ -73,14 +73,14 @@  discard block
 block discarded – undo
73 73
         }
74 74
 
75 75
         set_time_limit(300); // don't want this script to timeout;
76
-        $command = $this->exe . $options . $command_line;
77
-        putenv('COMPOSER_HOME=' . \XoopsBaseConfig::get('var-path').'/composer');
76
+        $command = $this->exe.$options.$command_line;
77
+        putenv('COMPOSER_HOME='.\XoopsBaseConfig::get('var-path').'/composer');
78 78
         $process = new Process($command);
79 79
         //$process->setEnv(array('COMPOSER_HOME' => \XoopsBaseConfig::get('var-path').'/composer'));
80 80
         $process->setTimeout(120);
81 81
         try {
82 82
             $process->run(
83
-                function ($type, $buffer) use (&$errors, &$output) {
83
+                function($type, $buffer) use (&$errors, &$output) {
84 84
                     if (Process::ERR === $type) {
85 85
                         $errors[] = $buffer;
86 86
                     } else {
@@ -96,7 +96,7 @@  discard block
 block discarded – undo
96 96
             array_unshift($this->output, $process->getErrorOutput());
97 97
             return true;
98 98
         } else {
99
-            $this->errors[] = 'Failed: ' . $command;
99
+            $this->errors[] = 'Failed: '.$command;
100 100
             $this->errors[] = sprintf(
101 101
                 "Process exit code: %s, '%s'",
102 102
                 $process->getExitCode(),
Please login to merge, or discard this patch.
xoops_lib/Xoops/Core/Service/Manager.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -51,7 +51,7 @@  discard block
 block discarded – undo
51 51
      * Service Mode constant - Multiple mode where all located services will be
52 52
      * dispatched in priority order.
53 53
      */
54
-    const MODE_MULTIPLE  = 8;
54
+    const MODE_MULTIPLE = 8;
55 55
 
56 56
     /**
57 57
      * Provider priorities
@@ -252,12 +252,12 @@  discard block
 block discarded – undo
252 252
         } else {
253 253
             $xoops = \Xoops::getInstance();
254 254
             $provider = new Provider($this, $service);
255
-            $event = 'core.service.locate.' . $service;
255
+            $event = 'core.service.locate.'.$service;
256 256
             // locate service provider(s)
257 257
             // In response to trigger message, the contract implementor should register()
258 258
             $xoops->events()->triggerEvent($event, $provider);
259 259
             // get reference to the list of providers and prioritize it.
260
-            $registered=$provider->getRegistered();
260
+            $registered = $provider->getRegistered();
261 261
             if (count($registered)) {
262 262
                 $choices = isset($this->providerPrefs[$service]) ? $this->providerPrefs[$service] : array();
263 263
                 foreach ($registered as $p) {
Please login to merge, or discard this patch.
xoops_lib/Xoops/Core/Service/Response.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -49,7 +49,7 @@
 block discarded – undo
49 49
     {
50 50
         $this->value = $value;
51 51
         $this->success = $success;
52
-        if ($errorMessage!==null) {
52
+        if ($errorMessage !== null) {
53 53
             $this->addErrorMessage($errorMessage);
54 54
         }
55 55
     }
Please login to merge, or discard this patch.
xoops_lib/Xoops/Core/Service/Data/EmailAttachment.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -70,11 +70,11 @@  discard block
 block discarded – undo
70 70
      */
71 71
     public function __construct(?string $filename = null, ?string $mimeType = null)
72 72
     {
73
-        if (null!==$filename) {
73
+        if (null !== $filename) {
74 74
             Assert::fileExists($filename, static::MESSAGE_FILE);
75 75
             $this->filename = $filename;
76 76
         }
77
-        if (null!==$mimeType) {
77
+        if (null !== $mimeType) {
78 78
             Assert::regex($mimeType, static::MIME_REGEX, static::MESSAGE_MIME);
79 79
             $this->mimeType = $mimeType;
80 80
         }
@@ -245,6 +245,6 @@  discard block
 block discarded – undo
245 245
      */
246 246
     public function getInlineAttribute() : bool
247 247
     {
248
-        return (bool) $this->inline;
248
+        return (bool)$this->inline;
249 249
     }
250 250
 }
Please login to merge, or discard this patch.
xoops_lib/Xoops/Core/Service/Data/EmailAttachmentSet.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -54,7 +54,7 @@
 block discarded – undo
54 54
      */
55 55
     public function __construct(?array $attachments = null)
56 56
     {
57
-        if (null!==$attachments) {
57
+        if (null !== $attachments) {
58 58
             Assert::allIsInstanceOf($attachments, EmailAttachment::class, static::MESSAGE_ATTACHMENT);
59 59
             try {
60 60
                 /** @var EmailAttachment $attachment */
Please login to merge, or discard this patch.
xoops_lib/Xoops/Core/Service/Data/Message.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -66,21 +66,21 @@
 block discarded – undo
66 66
      */
67 67
     public function __construct(?string $subject = null, ?string $body = null, ?int $fromId = null, ?int $toId = null)
68 68
     {
69
-        if (null!==$subject) {
69
+        if (null !== $subject) {
70 70
             $subject = trim($subject);
71 71
             Assert::stringNotEmpty($subject, static::MESSAGE_SUBJECT);
72 72
             $this->subject = $subject;
73 73
         }
74
-        if (null!==$body) {
74
+        if (null !== $body) {
75 75
             $body = trim($body);
76 76
             Assert::stringNotEmpty($body, static::MESSAGE_BODY);
77 77
             $this->body = $body;
78 78
         }
79
-        if (null!==$fromId) {
79
+        if (null !== $fromId) {
80 80
             Assert::greaterThan($fromId, 0, static::MESSAGE_FROM);
81 81
             $this->fromId = $fromId;
82 82
         }
83
-        if (null!==$toId) {
83
+        if (null !== $toId) {
84 84
             Assert::greaterThan($toId, 0, static::MESSAGE_TO);
85 85
             $this->toId = $toId;
86 86
         }
Please login to merge, or discard this patch.
xoops_lib/Xoops/Core/Service/Data/EmailAddressList.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -53,7 +53,7 @@
 block discarded – undo
53 53
      */
54 54
     public function __construct(?array $addresses = null)
55 55
     {
56
-        if (null!==$addresses) {
56
+        if (null !== $addresses) {
57 57
             Assert::allIsInstanceOf($addresses, EmailAddress::class, static::MESSAGE_ADDRESS);
58 58
             try {
59 59
                 /** @var EmailAddress $address */
Please login to merge, or discard this patch.