Issues (924)

classes/class-frontend.php (19 issues)

1
<?php
2
/**
3
 * LSX_Sharing_Frontend
4
 *
5
 * @package lsx-sharing
6
 */
7
8
namespace lsx\sharing\classes;
9
10
/**
11
 * LSX Sharing front-end class.
12
 *
13
 * @package lsx-sharing
14
 */
15
class Frontend {
16
17
18
    /**
19
     * Holds class instance
20
     *
21
     * @since 1.0.0
22
     *
23
     * @var object \lsx\sharing\classes\Frontend()
24
     */
25
    protected static $instance = null;
0 ignored issues
show
Expected 1 blank line(s) before first member var; 2 found
Loading history...
26
27
    /**
28
     * Holds the output class.
29
     *
30
     * @var object \lsx\sharing\classes\frontend\Output()
31
     */
32
    public $output = null;
33
34
    /**
35
     * Constructor.
36
     */
37
    public function __construct() {
0 ignored issues
show
Expected 2 blank lines before function; 1 found
Loading history...
38
         $this->load_classes();
39
40
    }
0 ignored issues
show
Expected 2 blank lines after function; 1 found
Loading history...
41
42
    /**
43
     * Return an instance of this class.
44
     *
45
     * @since 1.0.0
46
     *
47
     * @return object \lsx\sharing\classes\Frontend()    A single instance of this class.
48
     */
49
    public static function get_instance() {
50
         // If the single instance hasn't been set, set it now.
51
        if ( null == self::$instance ) {
0 ignored issues
show
Expected 0 spaces after opening bracket; 1 found
Loading history...
Expected 0 spaces before closing bracket; 1 found
Loading history...
52
            self::$instance = new self();
53
        }
0 ignored issues
show
No blank line found after control structure
Loading history...
54
        return self::$instance;
55
    }
0 ignored issues
show
Expected 2 blank lines after function; 1 found
Loading history...
Expected 1 blank line before closing function brace; 0 found
Loading history...
56
57
    /**
58
     * Loads the plugin functions.
59
     */
60
    private function load_classes() {
61
         include_once LSX_SHARING_PATH . '/classes/frontend/class-button.php';
62
        include_once LSX_SHARING_PATH . '/classes/frontend/class-output.php';
63
        $this->output = \lsx\sharing\classes\frontend\Output::get_instance();
64
    }
0 ignored issues
show
Expected 2 blank lines after function; 1 found
Loading history...
Expected 1 blank line before closing function brace; 0 found
Loading history...
65
66
    /**
0 ignored issues
show
Coding Style Documentation introduced by
Doc comment for parameter "$buttons" missing
Loading history...
Coding Style Documentation introduced by
Doc comment for parameter "$echo" missing
Loading history...
Coding Style Documentation introduced by
Doc comment for parameter "$post_id" missing
Loading history...
67
     * Backwards compatabile function for the sharing buttons.
68
     */
69
    public function sharing_buttons( $buttons = array( 'facebook', 'twitter', 'pinterest' ), $echo = false, $post_id = false ) {
70
         wc_deprecated_function('LSX_Sharing_Frontend::sharing_buttons()', '1.2.0', 'lsx_sharing()->frontend->output->sharing_buttons()');
0 ignored issues
show
Expected 1 spaces after opening parenthesis; 0 found
Loading history...
Expected 1 spaces before closing parenthesis; 0 found
Loading history...
71
        $this->output->sharing_buttons($buttons, $echo, $post_id);
0 ignored issues
show
Expected 1 spaces after opening parenthesis; 0 found
Loading history...
Expected 1 spaces before closing parenthesis; 0 found
Loading history...
72
    }
0 ignored issues
show
Expected 2 blank lines after function; 0 found
Loading history...
Expected 1 blank line before closing function brace; 0 found
Loading history...
73
}
74