Completed
Push — master ( 5061b6...54eaec )
by Michael
12:20 queued 12:16
created
xoops_lib/Xoops/Core/Assets.php 1 patch
Spacing   +15 added lines, -15 removed lines patch added patch discarded remove patch
@@ -131,15 +131,15 @@  discard block
 block discarded – undo
131 131
             $assetsPrefs = $xoops->cache()->read($this->assetsPrefsCacheKey);
132 132
             $file = $xoops->path($this->assetsPrefsFilename);
133 133
             $mtime = filemtime($file);
134
-            if ($assetsPrefs===false || !isset($assetsPrefs['mtime']) || !$mtime
135
-                || (isset($assetsPrefs['mtime']) && $assetsPrefs['mtime']<$mtime)) {
134
+            if ($assetsPrefs === false || !isset($assetsPrefs['mtime']) || !$mtime
135
+                || (isset($assetsPrefs['mtime']) && $assetsPrefs['mtime'] < $mtime)) {
136 136
                 if ($mtime) {
137 137
                     $assetsPrefs = Yaml::read($file);
138 138
                     if (!is_array($assetsPrefs)) {
139 139
                         $xoops->logger()->error("Invalid config in system_assets_prefs.yml");
140 140
                         $assetsPrefs = array();
141 141
                     } else {
142
-                        $assetsPrefs['mtime']=$mtime;
142
+                        $assetsPrefs['mtime'] = $mtime;
143 143
                         $xoops->cache()->write($this->assetsPrefsCacheKey, $assetsPrefs);
144 144
                         $this->copyBaseFileAssets();
145 145
                     }
@@ -212,7 +212,7 @@  discard block
 block discarded – undo
212 212
             $assets = array($assets); // just a single path name
213 213
         }
214 214
 
215
-        if ($filters==='default') {
215
+        if ($filters === 'default') {
216 216
             if (isset($this->default_filters[$type])) {
217 217
                 $filters = $this->default_filters[$type];
218 218
             } else {
@@ -311,7 +311,7 @@  discard block
 block discarded – undo
311 311
                 $filters
312 312
             );
313 313
             $asset_path = $asset->getTargetPath();
314
-            if (!is_readable($target_path . $asset_path)) {
314
+            if (!is_readable($target_path.$asset_path)) {
315 315
                 $assetKey = 'Asset '.$asset_path;
316 316
                 $xoops->events()->triggerEvent('debug.timer.start', $assetKey);
317 317
                 $oldumask = umask(0002);
@@ -320,7 +320,7 @@  discard block
 block discarded – undo
320 320
                 $xoops->events()->triggerEvent('debug.timer.stop', $assetKey);
321 321
             }
322 322
 
323
-            return $xoops->url('assets/' . $asset_path);
323
+            return $xoops->url('assets/'.$asset_path);
324 324
 
325 325
         } catch (\Exception $e) {
326 326
             $xoops->events()->triggerEvent('core.exception', $e);
@@ -360,7 +360,7 @@  discard block
 block discarded – undo
360 360
 
361 361
         try {
362 362
             if (is_scalar($assets)) {
363
-                $assets = array($assets);  // just a single path name
363
+                $assets = array($assets); // just a single path name
364 364
             }
365 365
             foreach ($assets as $a) {
366 366
                 // translate path if not a reference or absolute path
@@ -368,10 +368,10 @@  discard block
 block discarded – undo
368 368
                     && (substr_compare($a, '/', 0, 1) != 0)) {
369 369
                     $a = $xoops->path($a);
370 370
                 }
371
-                if (false===strpos($a, '*')) {
371
+                if (false === strpos($a, '*')) {
372 372
                     $assetArray[] = new FileAsset($a); // single file
373 373
                 } else {
374
-                    $assetArray[] = new GlobAsset($a);  // wild card match
374
+                    $assetArray[] = new GlobAsset($a); // wild card match
375 375
                 }
376 376
             }
377 377
 
@@ -452,9 +452,9 @@  discard block
 block discarded – undo
452 452
     {
453 453
         $xoops = \Xoops::getInstance();
454 454
 
455
-        $fromPath = $xoops->path($fromPath) . '/';
456
-        $toPath = $xoops->path('assets') . '/' . $output . '/';
457
-        $from = glob($fromPath . '/' . $pattern);
455
+        $fromPath = $xoops->path($fromPath).'/';
456
+        $toPath = $xoops->path('assets').'/'.$output.'/';
457
+        $from = glob($fromPath.'/'.$pattern);
458 458
 
459 459
         if (!is_dir($toPath)) {
460 460
             $oldUmask = umask(0);
@@ -468,8 +468,8 @@  discard block
 block discarded – undo
468 468
             foreach ($from as $filepath) {
469 469
                 $xoops->events()->triggerEvent('debug.timer.start', $filepath);
470 470
                 $filename = basename($filepath);
471
-                $status=copy($filepath, $toPath.$filename);
472
-                if (false===$status) {
471
+                $status = copy($filepath, $toPath.$filename);
472
+                if (false === $status) {
473 473
                     $xoops->logger()->warning('Failed to copy asset '.$filename);
474 474
                 } else {
475 475
                     //$xoops->logger()->debug('Copied asset '.$filename);
@@ -480,7 +480,7 @@  discard block
 block discarded – undo
480 480
             umask($oldUmask);
481 481
             return $count;
482 482
         } else {
483
-            $xoops->logger()->warning('Asset directory is not writable. ' . $output);
483
+            $xoops->logger()->warning('Asset directory is not writable. '.$output);
484 484
             return false;
485 485
         }
486 486
     }
Please login to merge, or discard this patch.
xoops_lib/Xoops/Core/Locale/Punic/Calendar.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -22,7 +22,7 @@
 block discarded – undo
22 22
     {
23 23
         switch ($count) {
24 24
             case 1:
25
-                return (string) ((int) $value->format('Y'));
25
+                return (string)((int)$value->format('Y'));
26 26
             case 2:
27 27
                 //return $value->format('y');
28 28
             default:
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/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.
xoops_lib/Xoops/Core/Service/Data/EmailAddress.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -58,15 +58,15 @@  discard block
 block discarded – undo
58 58
      */
59 59
     public function __construct(?string $email = null, ?string $displayName = null)
60 60
     {
61
-        if (null!==$email) {
61
+        if (null !== $email) {
62 62
             $email = trim($email);
63 63
             Assert::true(
64
-                false!==filter_var($email, FILTER_VALIDATE_EMAIL, FILTER_FLAG_EMAIL_UNICODE),
64
+                false !== filter_var($email, FILTER_VALIDATE_EMAIL, FILTER_FLAG_EMAIL_UNICODE),
65 65
                 static::MESSAGE_ADDRESS
66 66
             );
67 67
             $this->email = $email;
68 68
         }
69
-        if (null!==$displayName) {
69
+        if (null !== $displayName) {
70 70
             $displayName = trim($displayName);
71 71
             $displayName = empty($displayName) ? null : $displayName;
72 72
             Assert::nullOrStringNotEmpty($displayName, static::MESSAGE_NAME);
@@ -85,7 +85,7 @@  discard block
 block discarded – undo
85 85
     {
86 86
         try {
87 87
             Assert::true(
88
-                false!==filter_var($this->email, FILTER_VALIDATE_EMAIL, FILTER_FLAG_EMAIL_UNICODE),
88
+                false !== filter_var($this->email, FILTER_VALIDATE_EMAIL, FILTER_FLAG_EMAIL_UNICODE),
89 89
                 static::MESSAGE_ADDRESS
90 90
             );
91 91
         } catch (\InvalidArgumentException $e) {
Please login to merge, or discard this patch.