Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add return types #525

Merged
merged 1 commit into from
Aug 16, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/Admin/AbstractOptionsPage.php
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ public function render(): void {
/**
* Configure the admin page using the settings API.
*/
abstract public function configure();
abstract public function configure(): void;

/**
* Get the capability required to view the admin pages.
Expand Down Expand Up @@ -160,7 +160,7 @@ abstract public function enqueue_page_assets( string $hook ): void;
* @param string $page_slug The page slug.
* @param string $script_handle The script handle.
*/
abstract public function localize_script( string $page_slug, string $script_handle );
abstract public function localize_script( string $page_slug, string $script_handle ): void;

/**
* Add body class.
Expand Down
6 changes: 3 additions & 3 deletions src/Admin/MetaBox.php
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ public static function register( Options $options ): void {
/**
* Add "GTM Kit" meta box
*/
public function add_meta_boxes() {
public function add_meta_boxes(): void {
if ( current_user_can( 'manage_options' ) ) {
$post_types = get_post_types(
[
Expand Down Expand Up @@ -77,7 +77,7 @@ public function add_meta_boxes() {
/**
* Displays some checkbox to de/activate some cache options
*/
public function display_meta_boxes() {
public function display_meta_boxes(): void {
if ( current_user_can( 'manage_options' ) ) {
wp_nonce_field( 'gtmkit_box_option', '_gtmkitnonce', false );
$page_type = get_post_meta( get_the_ID(), 'gtmkit_page_type', true );
Expand All @@ -103,7 +103,7 @@ public function display_meta_boxes() {
/**
* Manage the cache options from the meta box.
*/
public function save_meta_box_options() {
public function save_meta_box_options(): void {
if ( current_user_can( 'manage_options' ) && isset( $_POST['post_ID'], $_POST['_gtmkitnonce'] ) ) {

check_admin_referer( 'gtmkit_box_option', '_gtmkitnonce' );
Expand Down
6 changes: 3 additions & 3 deletions src/Admin/SetupWizard.php
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ public static function get_site_url(): string {
/**
* Maybe redirect to the setup wizard after plugin activation.
*/
public function maybe_redirect_after_activation() {
public function maybe_redirect_after_activation(): void {

if ( wp_doing_ajax() || wp_doing_cron() ) {
return;
Expand Down Expand Up @@ -118,7 +118,7 @@ public function add_dashboard_page(): void {
*
* @param string $hook The asset hook.
*/
public function enqueue_assets( string $hook ) {
public function enqueue_assets( string $hook ): void {

if ( strpos( $hook, self::SLUG ) === false ) {
return;
Expand Down Expand Up @@ -159,7 +159,7 @@ public function enqueue_assets( string $hook ) {
/**
* Setup Wizard Content
*/
public function setup_wizard_content() {
public function setup_wizard_content(): void {
$admin_url = is_network_admin() ? network_admin_url() : admin_url();

$this->settings_error_page( 'gtmkit-settings', '<a class="gtmkit-text-color-grey gtmkit-text-sm" href="' . $admin_url . '">' . esc_html__( 'Go back to the Dashboard', 'gtm-kit' ) . '</a>' );
Expand Down
2 changes: 1 addition & 1 deletion src/Integration/WooCommerce.php
Original file line number Diff line number Diff line change
Expand Up @@ -1066,7 +1066,7 @@ public function Compatibility_With_TI_Wishlist( array $item_data ): array {
/**
* Registers the actual data into each endpoint.
*/
public function extend_store() {
public function extend_store(): void {

// Register into `cart/items`.
$this->extend->register_endpoint_data(
Expand Down
Loading