Passed
Pull Request — master (#100)
by Guido
05:27
created
src/Thumbnail.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -45,7 +45,7 @@  discard block
 block discarded – undo
45 45
     {
46 46
         $idPrefix = $this->site->idSitePrefix();
47 47
 
48
-        $attachmentId = (int)filter_input(
48
+        $attachmentId = (int) filter_input(
49 49
             INPUT_POST,
50 50
             self::META_KEY_THUMBNAIL_ID,
51 51
             FILTER_SANITIZE_NUMBER_INT
@@ -110,7 +110,7 @@  discard block
 block discarded – undo
110 110
     {
111 111
         // phpcs:enable
112 112
 
113
-        $attachmentId = (int)$attachmentId;
113
+        $attachmentId = (int) $attachmentId;
114 114
         $idPrefix = $this->site->idSitePrefix();
115 115
 
116 116
         if (false === $this->idPrefixIncludedInAttachmentId($attachmentId, $idPrefix)) {
@@ -172,7 +172,7 @@  discard block
 block discarded – undo
172 172
 
173 173
         // phpcs:enable
174 174
 
175
-        $attachmentId = (int)$attachmentId;
175
+        $attachmentId = (int) $attachmentId;
176 176
         $siteId = $this->site->id();
177 177
         $idPrefix = $this->site->idSitePrefix();
178 178
 
Please login to merge, or discard this patch.
src/Site.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -21,7 +21,7 @@  discard block
 block discarded – undo
21 21
      */
22 22
     public function id(): int
23 23
     {
24
-        return (int)apply_filters(self::SITE_ID, 1);
24
+        return (int) apply_filters(self::SITE_ID, 1);
25 25
     }
26 26
 
27 27
     /**
@@ -45,6 +45,6 @@  discard block
 block discarded – undo
45 45
      */
46 46
     public function isMediaSite(): bool
47 47
     {
48
-        return ($this->id() === (int)$GLOBALS['current_blog']->blog_id);
48
+        return ($this->id() === (int) $GLOBALS['current_blog']->blog_id);
49 49
     }
50 50
 }
Please login to merge, or discard this patch.
src/Attachment.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -47,7 +47,7 @@  discard block
 block discarded – undo
47 47
     {
48 48
         $idPrefix = $this->site->idSitePrefix();
49 49
 
50
-        $response['id'] = (int) ($idPrefix.$response['id']); // Unique ID, must be a number.
50
+        $response['id'] = (int) ($idPrefix . $response['id']); // Unique ID, must be a number.
51 51
         $response['nonces']['update'] = false;
52 52
         $response['nonces']['edit'] = false;
53 53
         $response['nonces']['delete'] = false;
@@ -147,10 +147,10 @@  discard block
 block discarded – undo
147 147
     public function mediaSendToEditor(string $html, int $id): string
148 148
     {
149 149
         $idPrefix = $this->site->idSitePrefix();
150
-        $newId = $idPrefix.$id; // Unique ID, must be a number.
150
+        $newId = $idPrefix . $id; // Unique ID, must be a number.
151 151
 
152
-        $search = 'wp-image-'.$id;
153
-        $replace = 'wp-image-'.$newId;
152
+        $search = 'wp-image-' . $id;
153
+        $replace = 'wp-image-' . $newId;
154 154
 
155 155
         return str_replace($search, $replace, $html);
156 156
     }
Please login to merge, or discard this patch.
src/Helper.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -20,7 +20,7 @@  discard block
 block discarded – undo
20 20
         string $siteIdPrefix
21 21
     ): bool {
22 22
 
23
-        return false !== strpos((string)$attachmentId, $siteIdPrefix);
23
+        return false !== strpos((string) $attachmentId, $siteIdPrefix);
24 24
     }
25 25
 
26 26
     /**
@@ -32,6 +32,6 @@  discard block
 block discarded – undo
32 32
      */
33 33
     private function stripSiteIdPrefixFromAttachmentId(string $idPrefix, int $attachmentId): int
34 34
     {
35
-        return (int)str_replace($idPrefix, '', (string)$attachmentId);
35
+        return (int) str_replace($idPrefix, '', (string) $attachmentId);
36 36
     }
37 37
 }
Please login to merge, or discard this patch.
multisite-global-media.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -26,7 +26,7 @@  discard block
 block discarded – undo
26 26
 // phpcs:disable
27 27
 
28 28
 $bootstrap = \Closure::bind(
29
-    static function () {
29
+    static function() {
30 30
     /**
31 31
      * @param string $message
32 32
      * @param string $noticeType
@@ -38,7 +38,7 @@  discard block
 block discarded – undo
38 38
 
39 39
         add_action(
40 40
             'admin_notices',
41
-            function () use ($message, $noticeType, $allowedMarkup) {
41
+            function() use ($message, $noticeType, $allowedMarkup) {
42 42
                 ?>
43 43
                 <div class="notice notice-<?= esc_attr($noticeType) ?>">
44 44
                     <p><?= wp_kses($message, $allowedMarkup) ?></p>
Please login to merge, or discard this patch.
src/Rest/Rest.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -78,8 +78,8 @@
 block discarded – undo
78 78
         }
79 79
 
80 80
         $idPrefix = $this->site->idSitePrefix();
81
-        $attachmentId = (int)$request[self::REST_FIELD_THUMBNAIL_ID];
82
-        $postId = (int)$request['id'];
81
+        $attachmentId = (int) $request[self::REST_FIELD_THUMBNAIL_ID];
82
+        $postId = (int) $request['id'];
83 83
         if ($attachmentId && $this->idPrefixIncludedInAttachmentId($attachmentId, $idPrefix)) {
84 84
             update_post_meta($postId, self::META_KEY_THUMBNAIL_ID, $attachmentId);
85 85
 
Please login to merge, or discard this patch.
src/Rest/RestController.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -57,7 +57,7 @@  discard block
 block discarded – undo
57 57
         // phpcs:enable
58 58
         $idPrefix = $this->site->idSitePrefix();
59 59
 
60
-        if (!$this->idPrefixIncludedInAttachmentId((int)$request['id'], $idPrefix)) {
60
+        if (!$this->idPrefixIncludedInAttachmentId((int) $request['id'], $idPrefix)) {
61 61
             return parent::get_item_permissions_check($request);
62 62
         }
63 63
 
@@ -65,7 +65,7 @@  discard block
 block discarded – undo
65 65
         $requestClone = clone $request;
66 66
         $requestClone['id'] = $this->stripSiteIdPrefixFromAttachmentId(
67 67
             $idPrefix,
68
-            (int)$request['id']
68
+            (int) $request['id']
69 69
         );
70 70
 
71 71
         $this->siteSwitcher->switchToBlog($this->site->id());
@@ -88,11 +88,11 @@  discard block
 block discarded – undo
88 88
         // phpcs:enable
89 89
         $idPrefix = $this->site->idSitePrefix();
90 90
 
91
-        if (!$this->idPrefixIncludedInAttachmentId((int)$request['id'], $idPrefix)) {
91
+        if (!$this->idPrefixIncludedInAttachmentId((int) $request['id'], $idPrefix)) {
92 92
             return parent::get_item($request);
93 93
         }
94 94
 
95
-        $attachmentId = (int)$request['id'];
95
+        $attachmentId = (int) $request['id'];
96 96
         $request['id'] = $this->stripSiteIdPrefixFromAttachmentId($idPrefix, $attachmentId);
97 97
         $this->siteSwitcher->switchToBlog($this->site->id());
98 98
         $response = parent::get_item($request);
Please login to merge, or discard this patch.