| @@ -6,72 +6,75 @@ | ||
| 6 | 6 | use WPDeveloper\BetterDocs\Utils\Enqueue; |
| 7 | 7 | use WPDeveloper\BetterDocs\Admin\Customizer\Sanitizer; |
| 8 | 8 | |
| 9 | 9 | abstract class Section { |
| 10 | - protected $customizer = null; | |
| 11 | - protected $defaults = null; | |
| 12 | - /** | |
| 13 | - * Customizer Panel ID | |
| 14 | - * | |
| 15 | - * @var string | |
| 16 | - */ | |
| 17 | - protected $panel_id = 'betterdocs_customize_options'; | |
| 10 | + protected $customizer = null; | |
| 11 | + protected $defaults = null; | |
| 12 | + /** | |
| 13 | + * Customizer Panel ID | |
| 14 | + * | |
| 15 | + * @var string | |
| 16 | + */ | |
| 17 | + protected $panel_id = 'betterdocs_customize_options'; | |
| 18 | 18 | |
| 19 | - /** | |
| 20 | - * Sanitizer | |
| 21 | - * | |
| 22 | - * @var Sanitizer | |
| 23 | - */ | |
| 24 | - protected $sanitizer; | |
| 19 | + /** | |
| 20 | + * Sanitizer | |
| 21 | + * | |
| 22 | + * @var Sanitizer | |
| 23 | + */ | |
| 24 | + protected $sanitizer; | |
| 25 | 25 | |
| 26 | - /** | |
| 27 | - * Settings | |
| 28 | - * @var Settings | |
| 29 | - */ | |
| 30 | - protected $settings; | |
| 31 | - protected $priority = 100; | |
| 26 | + /** | |
| 27 | + * Settings | |
| 28 | + * @var Settings | |
| 29 | + */ | |
| 30 | + protected $settings; | |
| 31 | + protected $priority = 100; | |
| 32 | 32 | |
| 33 | - abstract public function get_id(); | |
| 34 | - abstract public function get_title(); | |
| 33 | + abstract public function get_id(); | |
| 34 | + abstract public function get_title(); | |
| 35 | 35 | |
| 36 | - /** | |
| 37 | - * Enqueue Manager | |
| 38 | - * | |
| 39 | - * @var Enqueue | |
| 40 | - */ | |
| 41 | - protected $assets; | |
| 36 | + /** | |
| 37 | + * Enqueue Manager | |
| 38 | + * | |
| 39 | + * @var Enqueue | |
| 40 | + */ | |
| 41 | + protected $assets; | |
| 42 | 42 | |
| 43 | - public function __construct( Sanitizer $sanitizer, Settings $settings ) { | |
| 44 | - $this->sanitizer = $sanitizer; | |
| 45 | - $this->settings = $settings; | |
| 46 | - $this->assets = betterdocs()->assets; | |
| 47 | - } | |
| 43 | + public function __construct( Sanitizer $sanitizer, Settings $settings ) { | |
| 44 | + $this->sanitizer = $sanitizer; | |
| 45 | + $this->settings = $settings; | |
| 46 | + $this->assets = betterdocs()->assets; | |
| 47 | + } | |
| 48 | 48 | |
| 49 | - public function set_customizer( $customizer, $defaults ) { | |
| 50 | - $this->customizer = $customizer; | |
| 51 | - $this->defaults = $defaults; | |
| 52 | - } | |
| 49 | + public function set_customizer( $customizer, $defaults ) { | |
| 50 | + $this->customizer = $customizer; | |
| 51 | + $this->defaults = $defaults; | |
| 52 | + } | |
| 53 | 53 | |
| 54 | - public function section() { | |
| 55 | - $this->customizer->add_section( $this->get_id(), [ | |
| 56 | - 'title' => $this->get_title(), | |
| 57 | - 'priority' => $this->priority, | |
| 58 | - 'panel' => $this->panel_id | |
| 59 | - ] ); | |
| 60 | - } | |
| 54 | + public function section() { | |
| 55 | + $this->customizer->add_section( | |
| 56 | + $this->get_id(), | |
| 57 | + [ | |
| 58 | + 'title' => $this->get_title(), | |
| 59 | + 'priority' => $this->priority, | |
| 60 | + 'panel' => $this->panel_id | |
| 61 | + ] | |
| 62 | + ); | |
| 63 | + } | |
| 61 | 64 | |
| 62 | - public function register( $customizer, $defaults ) { | |
| 63 | - $this->set_customizer( $customizer, $defaults ); | |
| 64 | - $_methods = get_class_methods( $this ); | |
| 65 | - if ( ! empty( $_methods ) ) { | |
| 66 | - $this->section(); | |
| 65 | + public function register( $customizer, $defaults ) { | |
| 66 | + $this->set_customizer( $customizer, $defaults ); | |
| 67 | + $_methods = get_class_methods( $this ); | |
| 68 | + if ( ! empty( $_methods ) ) { | |
| 69 | + $this->section(); | |
| 67 | 70 | |
| 68 | - foreach ( $_methods as $method ) { | |
| 69 | - if ( in_array( $method, ['get_id', 'section', 'get_title', 'register', 'set_customizer', '__construct'] ) ) { | |
| 70 | - continue; | |
| 71 | - } | |
| 71 | + foreach ( $_methods as $method ) { | |
| 72 | + if ( in_array( $method, [ 'get_id', 'section', 'get_title', 'register', 'set_customizer', '__construct' ] ) ) { | |
| 73 | + continue; | |
| 74 | + } | |
| 72 | 75 | |
| 73 | - $this->{$method}(); | |
| 74 | - } | |
| 75 | - } | |
| 76 | - } | |
| 76 | + $this->{$method}(); | |
| 77 | + } | |
| 78 | + } | |
| 79 | + } | |
| 77 | 80 | } |