Skip to content

Commit 490ead6

Browse files
committed
fix: phpstan errors
1 parent b191b83 commit 490ead6

File tree

4 files changed

+30
-20
lines changed

4 files changed

+30
-20
lines changed

inc/core/styles/frontend.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1083,7 +1083,7 @@ private function setup_scroll_to_top() {
10831083
/**
10841084
* Get scroll to top CSS variables rules.
10851085
*
1086-
* @return array
1086+
* @return array<string, array<string, mixed>>
10871087
*/
10881088
private function get_scroll_to_top_rules() {
10891089
$rules = [

inc/customizer/options/scroll_to_top.php

Lines changed: 18 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,8 @@ class Scroll_To_Top extends Base_Customizer {
2828

2929
/**
3030
* Base initialization.
31+
*
32+
* @return void
3133
*/
3234
public function init() {
3335
parent::init();
@@ -36,6 +38,8 @@ public function init() {
3638

3739
/**
3840
* Live refresh for scroll to top controls.
41+
*
42+
* @return void
3943
*/
4044
public function live_refresh_scripts() {
4145
if ( ! is_customize_preview() ) {
@@ -94,9 +98,10 @@ public function add_controls() {
9498

9599
/**
96100
* Register customizer section for the module
101+
*
102+
* @return void
97103
*/
98104
private function scroll_to_top_section() {
99-
100105
$this->add_section(
101106
new Section(
102107
'neve_scroll_to_top',
@@ -112,9 +117,10 @@ private function scroll_to_top_section() {
112117

113118
/**
114119
* Register option toggle in customizer
120+
*
121+
* @return void
115122
*/
116123
private function scroll_to_top_options() {
117-
118124
$this->add_control(
119125
new Control(
120126
'neve_scroll_to_top_status',
@@ -321,9 +327,10 @@ class_exists( 'Neve\Customizer\Controls\React\Range' ) ? 'Neve\Customizer\Contro
321327

322328
/**
323329
* Add style controls for Scroll to top module.
330+
*
331+
* @return void
324332
*/
325333
private function scroll_to_top_style_controls() {
326-
327334
$this->add_control(
328335
new Control(
329336
'neve_scroll_to_top_style',
@@ -642,6 +649,8 @@ class_exists( 'Neve\Customizer\Controls\React\Range' ) ? 'Neve\Customizer\Contro
642649

643650
/**
644651
* Active callback for controls that are available only if scroll to top is an image
652+
*
653+
* @return bool
645654
*/
646655
public function is_image_type_control() {
647656
if ( ! $this->is_module_enabled() ) {
@@ -653,6 +662,8 @@ public function is_image_type_control() {
653662

654663
/**
655664
* Active callback for controls that are available only if scroll to top is an icon
665+
*
666+
* @return bool
656667
*/
657668
public function is_icon_type_control() {
658669
if ( ! $this->is_module_enabled() ) {
@@ -696,6 +707,8 @@ public function sanitize_scroll_to_top_side( $value ) {
696707

697708
/**
698709
* Check if Scroll to Top is enabled.
710+
*
711+
* @return bool
699712
*/
700713
public static function is_enabled() {
701714
// Check old option first for backward compatibility.
@@ -717,6 +730,8 @@ public static function is_enabled() {
717730

718731
/**
719732
* Active callback for scroll to top controls.
733+
*
734+
* @return bool
720735
*/
721736
public function is_module_enabled() {
722737
return self::is_enabled();

inc/customizer/options/upsells.php

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -28,13 +28,6 @@ class Upsells extends Base_Customizer {
2828
*/
2929
private $upsell_url = '';
3030

31-
/**
32-
* Scroll to top upsell url
33-
*
34-
* @var string
35-
*/
36-
private $stt_upsell_url = '';
37-
3831
/**
3932
* Init function
4033
*
@@ -45,8 +38,7 @@ public function init() {
4538
return;
4639
}
4740

48-
$this->stt_upsell_url = esc_url_raw( apply_filters( 'neve_upgrade_link_from_child_theme_filter', $this->get_upgrade_url( 'scrolltotop' ) ) );
49-
$this->upsell_url = esc_url_raw( apply_filters( 'neve_upgrade_link_from_child_theme_filter', $this->get_upgrade_url( 'learnmorebtn' ) ) );
41+
$this->upsell_url = esc_url_raw( apply_filters( 'neve_upgrade_link_from_child_theme_filter', $this->get_upgrade_url( 'learnmorebtn' ) ) );
5042

5143
parent::init();
5244

inc/views/scroll_to_top.php

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -27,14 +27,16 @@ public function init() {
2727

2828
/**
2929
* Scroll to top amp observer.
30+
*
31+
* @return void
3032
*/
3133
public function scroll_to_top_amp() {
3234
if ( ! Scroll_To_Top_Options::is_enabled() ) {
33-
return false;
35+
return;
3436
}
3537

3638
if ( ! neve_is_amp() ) {
37-
return false;
39+
return;
3840
}
3941

4042
echo '<amp-position-observer on="enter:hideAnim.start; exit:showAnim.start" layout="nodisplay"></amp-position-observer>';
@@ -81,11 +83,12 @@ public function scroll_to_top_amp() {
8183
</script>
8284
</amp-animation>
8385
';
84-
return true;
8586
}
8687

8788
/**
8889
* Enqueue module scripts
90+
*
91+
* @return void
8992
*/
9093
public function enqueue_scripts() {
9194
if ( ! Scroll_To_Top_Options::is_enabled() ) {
@@ -114,7 +117,7 @@ public function enqueue_scripts() {
114117
/**
115118
* Send offset to the JS object
116119
*
117-
* @return array
120+
* @return array<string, mixed>
118121
*/
119122
private function localize_scroll() {
120123
return array(
@@ -124,10 +127,12 @@ private function localize_scroll() {
124127

125128
/**
126129
* Display scroll to top button
130+
*
131+
* @return void
127132
*/
128133
public function render_button() {
129134
if ( ! Scroll_To_Top_Options::is_enabled() ) {
130-
return false;
135+
return;
131136
}
132137

133138
$position = get_theme_mod( 'neve_scroll_to_top_side', 'right' );
@@ -161,8 +166,6 @@ public function render_button() {
161166
}
162167

163168
echo '</button>';
164-
165-
return true;
166169
}
167170

168171
/**

0 commit comments

Comments
 (0)