Passed
Push — master ( 1f45e8...4e7cf6 )
by Paul
09:12 queued 04:19
created
views/partials/notices/welcome.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -1,3 +1,3 @@
 block discarded – undo
1 1
 <div class="notice notice-info is-dismissible glsr-notice" data-dismiss="welcome">
2
-    <p>Thanks for upgrading to Site Reviews v<?= glsr()->version; ?>, we hope you love it! &mdash; <a class="button button-small" href="<?= admin_url('edit.php?post_type='.glsr()->post_type.'&page=welcome'); ?>">See what's new</a></p> 
2
+    <p>Thanks for upgrading to Site Reviews v<?= glsr()->version; ?>, we hope you love it! &mdash; <a class="button button-small" href="<?= admin_url( 'edit.php?post_type='.glsr()->post_type.'&page=welcome' ); ?>">See what's new</a></p> 
3 3
 </div>
Please login to merge, or discard this patch.
plugin/Controllers/NoticeController.php 1 patch
Spacing   +27 added lines, -27 removed lines patch added patch discarded remove patch
@@ -17,18 +17,18 @@  discard block
 block discarded – undo
17 17
     public function filterAdminNotices()
18 18
     {
19 19
         $screen = glsr_current_screen();
20
-        $this->renderWelcomeNotice($screen->post_type);
21
-        $this->renderRebusifyNotice($screen->post_type);
22
-        $this->renderAddonsNotice($screen->id);
20
+        $this->renderWelcomeNotice( $screen->post_type );
21
+        $this->renderRebusifyNotice( $screen->post_type );
22
+        $this->renderAddonsNotice( $screen->id );
23 23
     }
24 24
 
25 25
     /**
26 26
      * @return void
27 27
      */
28
-    public function routerDismissNotice(array $request)
28
+    public function routerDismissNotice( array $request )
29 29
     {
30
-        if ($key = glsr_get($request, 'notice')) {
31
-            $this->dismissNotice($key);
30
+        if( $key = glsr_get( $request, 'notice' ) ) {
31
+            $this->dismissNotice( $key );
32 32
         }
33 33
     }
34 34
 
@@ -36,9 +36,9 @@  discard block
 block discarded – undo
36 36
      * @param string $key
37 37
      * @return void
38 38
      */
39
-    protected function dismissNotice($key)
39
+    protected function dismissNotice( $key )
40 40
     {
41
-        $this->setUserMeta($key, glsr()->version('major'));
41
+        $this->setUserMeta( $key, glsr()->version( 'major' ) );
42 42
     }
43 43
 
44 44
     /**
@@ -46,20 +46,20 @@  discard block
 block discarded – undo
46 46
      * @param mixed $fallback
47 47
      * @return mixed
48 48
      */
49
-    protected function getUserMeta($key, $fallback)
49
+    protected function getUserMeta( $key, $fallback )
50 50
     {
51
-        $meta = get_user_meta(get_current_user_id(), static::USER_META_KEY, true);
52
-        return glsr_get($meta, $key, $fallback);
51
+        $meta = get_user_meta( get_current_user_id(), static::USER_META_KEY, true );
52
+        return glsr_get( $meta, $key, $fallback );
53 53
     }
54 54
 
55 55
     /**
56 56
      * @param string $screenId
57 57
      * @return void
58 58
      */
59
-    protected function renderAddonsNotice($screenId)
59
+    protected function renderAddonsNotice( $screenId )
60 60
     {
61
-        if (Application::POST_TYPE.'_page_addons' == $screenId) {
62
-            echo glsr()->render('partials/notices/addons');
61
+        if( Application::POST_TYPE.'_page_addons' == $screenId ) {
62
+            echo glsr()->render( 'partials/notices/addons' );
63 63
         }
64 64
     }
65 65
 
@@ -67,12 +67,12 @@  discard block
 block discarded – undo
67 67
      * @param string $screenPostType
68 68
      * @return void
69 69
      */
70
-    protected function renderRebusifyNotice($screenPostType)
70
+    protected function renderRebusifyNotice( $screenPostType )
71 71
     {
72
-        if (Application::POST_TYPE == $screenPostType
73
-            && version_compare(glsr()->version('major'), $this->getUserMeta('rebusify', 0), '>')
74
-            && !glsr(OptionManager::class)->getBool('settings.general.rebusify')) {
75
-            echo glsr()->render('partials/notices/rebusify');
72
+        if( Application::POST_TYPE == $screenPostType
73
+            && version_compare( glsr()->version( 'major' ), $this->getUserMeta( 'rebusify', 0 ), '>' )
74
+            && !glsr( OptionManager::class )->getBool( 'settings.general.rebusify' ) ) {
75
+            echo glsr()->render( 'partials/notices/rebusify' );
76 76
         }
77 77
     }
78 78
 
@@ -80,11 +80,11 @@  discard block
 block discarded – undo
80 80
      * @param string $screenPostType
81 81
      * @return void
82 82
      */
83
-    protected function renderWelcomeNotice($screenPostType)
83
+    protected function renderWelcomeNotice( $screenPostType )
84 84
     {
85
-        if (Application::POST_TYPE == $screenPostType
86
-            && version_compare(glsr()->version('major'), $this->getUserMeta('welcome', 0), '>')) {
87
-            echo glsr()->render('partials/notices/welcome');
85
+        if( Application::POST_TYPE == $screenPostType
86
+            && version_compare( glsr()->version( 'major' ), $this->getUserMeta( 'welcome', 0 ), '>' ) ) {
87
+            echo glsr()->render( 'partials/notices/welcome' );
88 88
         }
89 89
     }
90 90
 
@@ -93,12 +93,12 @@  discard block
 block discarded – undo
93 93
      * @param mixed $fallback
94 94
      * @return mixed
95 95
      */
96
-    protected function setUserMeta($key, $value)
96
+    protected function setUserMeta( $key, $value )
97 97
     {
98 98
         $userId = get_current_user_id();
99
-        $meta = (array) get_user_meta($userId, static::USER_META_KEY, true);
100
-        $meta = array_filter(wp_parse_args($meta, []));
99
+        $meta = (array)get_user_meta( $userId, static::USER_META_KEY, true );
100
+        $meta = array_filter( wp_parse_args( $meta, [] ) );
101 101
         $meta[$key] = $value;
102
-        update_user_meta($userId, static::USER_META_KEY, $meta);
102
+        update_user_meta( $userId, static::USER_META_KEY, $meta );
103 103
     }
104 104
 }
Please login to merge, or discard this patch.