Skip to content

Commit

Permalink
fix merge
Browse files Browse the repository at this point in the history
  • Loading branch information
ziodave committed Oct 29, 2024
2 parents 4f96704 + 1910baa commit 66f7084
Show file tree
Hide file tree
Showing 571 changed files with 27,784 additions and 15,280 deletions.
6 changes: 0 additions & 6 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,12 +33,6 @@ jobs:
strategy:
matrix:
image:
- "php7.1-phpunit4.8-wordpress5.3"
- "php7.2-phpunit4.8-wordpress5.4"
- "php7.3-phpunit7.5-wordpress5.5"
- "php7.3-phpunit7.5-wordpress5.6"
- "php7.3-phpunit7.5-wordpress5.7"
- "php7.3-phpunit7.5-wordpress5.8"
- "php7.4-phpunit7.5-wordpress5.9"
- "php8.0-phpunit7.5woo-wordpress5.6"
phpunit-xml:
Expand Down
7 changes: 4 additions & 3 deletions phpcs.xml.dist
Original file line number Diff line number Diff line change
Expand Up @@ -96,11 +96,11 @@

<config name="text_domain" value="wordlift,default"/>

<!-- Check for cross-version support for PHP 5.6 and higher. -->
<!-- Check for cross-version support for PHP 7.4 and higher. -->
<rule ref="PHPCompatibility"/>

<config name="minimum_supported_wp_version" value="5.6-"/>
<config name="testVersion" value="5.6-"/>
<config name="minimum_supported_wp_version" value="7.4-"/>
<config name="testVersion" value="7.4-"/>

<arg name="extensions" value="php"/>

Expand All @@ -112,6 +112,7 @@

<exclude-pattern>*/vendor/*</exclude-pattern>
<exclude-pattern>src/libraries/action-scheduler/*</exclude-pattern>
<exclude-pattern>src/modules/*</exclude-pattern>
<exclude-pattern>*/ext/dependencies/*</exclude-pattern>
<exclude-pattern>*/modules/food-kg/includes/polyfills/mbstring.php</exclude-pattern>
<exclude-pattern>*/modules/**/scoper.inc.php</exclude-pattern>
Expand Down
2 changes: 1 addition & 1 deletion src/admin/class-wordlift-admin-entity-type-settings.php
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ public function admin_menu() {
*/
// @todo: use the new {@link Wordlift_Admin_Page}.
add_submenu_page(
null,
'wl_entity_type_settings',
__( 'Edit Entity term', 'wordlift' ),
__( 'Edit Entity term', 'wordlift' ),
'manage_options',
Expand Down
2 changes: 1 addition & 1 deletion src/admin/elements/class-wordlift-admin-select-element.php
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ class="<?php echo esc_attr( $params['class'] ); ?>"
$this->print_notice( $params['notice'] );

// Print the field description.
echo wp_kses( $this->get_description( $params['description'] ), array( 'p' => array() ) );
echo wp_kses( $this->get_description( $params['description'] ) ?? '', array( 'p' => array() ) );

return $this;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ private function is_started( $state ) {
*/
public function start() {
$action = $this->get_action_key();
$this->log->debug( "Trying to start ${action}..." );
$this->log->debug( sprintf( 'Trying to start %s...', $action ) );
// Create a new Sync_Model state of `started`.
if ( ! $this->is_started( self::get_state() ) ) {
$this->log->debug( 'Starting...' );
Expand Down Expand Up @@ -96,7 +96,7 @@ public function start() {
public function cancel() {

$action = $this->action;
$this->log->debug( "Cancelling ${action}..." );
$this->log->debug( sprintf( 'Cancelling %s...', $action ) );

// Cleanup the process data.
$this->cancel_process();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@ public function get_type() {
return $this->type;
}

#[\ReturnTypeWillChange]
public function jsonSerialize() {
return array(
'id' => $this->id,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ public function get_menu_title() {
}

protected function get_parent_slug() {
return null;
return 'wl_google_addon_import';
}

public function render() {
Expand Down
2 changes: 1 addition & 1 deletion src/classes/mappings/pages/class-edit-mappings-page.php
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ private function load_text_settings_for_edit_mapping_page( array $edit_mapping_s
* @return null return null to avoid this page to be displayed in WordLift's menu.
*/
protected function get_parent_slug() {
return null;
return 'wl_edit_mappings';
}

/**
Expand Down
1 change: 1 addition & 0 deletions src/classes/relation/class-relation.php
Original file line number Diff line number Diff line change
Expand Up @@ -147,6 +147,7 @@ public static function from_relation_instances( $instance ) {
);
}

#[\ReturnTypeWillChange]
public function jsonSerialize() {
return array(
'subject' => $this->get_subject(),
Expand Down
8 changes: 5 additions & 3 deletions src/classes/relation/class-relations.php
Original file line number Diff line number Diff line change
Expand Up @@ -61,22 +61,23 @@ public function contains( Relation ...$values ) {
return true;
}

public function offsetSet( $offset, $value ) {
public function offsetSet( $offset, $value ): void {
if ( $offset === null ) {
$this->container[] = $value;
} else {
$this->container[ $offset ] = $value;
}
}

public function offsetExists( $offset ) {
public function offsetExists( $offset ): bool {
return isset( $this->container[ $offset ] );
}

public function offsetUnset( $offset ) {
public function offsetUnset( $offset ): void {
unset( $this->container[ $offset ] );
}

#[\ReturnTypeWillChange]
public function offsetGet( $offset ) {
return isset( $this->container[ $offset ] ) ? $this->container[ $offset ] : null;
}
Expand All @@ -85,6 +86,7 @@ public function toArray() {
return $this->container;
}

#[\ReturnTypeWillChange]
public function jsonSerialize() {
return $this->container;
}
Expand Down
4 changes: 2 additions & 2 deletions src/classes/vocabulary-terms/class-entity-type.php
Original file line number Diff line number Diff line change
Expand Up @@ -104,8 +104,8 @@ public function save_field( $term_id ) {
public function init_ui_and_save_handlers() {
$taxonomies = Terms_Compat::get_public_taxonomies();
foreach ( $taxonomies as $taxonomy ) {
add_action( "${taxonomy}_edit_form_fields", array( $this, 'render_ui' ), 1 );
add_action( "edited_${taxonomy}", array( $this, 'save_field' ) );
add_action( "{$taxonomy}_edit_form_fields", array( $this, 'render_ui' ), 1 );
add_action( "edited_{$taxonomy}", array( $this, 'save_field' ) );
}
}

Expand Down
4 changes: 2 additions & 2 deletions src/classes/vocabulary-terms/class-term-metabox.php
Original file line number Diff line number Diff line change
Expand Up @@ -54,8 +54,8 @@ public function save_field( $term_id ) {
public function init_all_custom_fields() {
$taxonomies = Terms_Compat::get_public_taxonomies();
foreach ( $taxonomies as $taxonomy ) {
add_action( "${taxonomy}_edit_form", array( $this, 'render_ui' ), 1 );
add_action( "edited_${taxonomy}", array( $this, 'save_field' ) );
add_action( "{$taxonomy}_edit_form", array( $this, 'render_ui' ), 1 );
add_action( "edited_{$taxonomy}", array( $this, 'save_field' ) );
}
}

Expand Down
2 changes: 1 addition & 1 deletion src/classes/vocabulary-terms/jsonld/class-post-jsonld.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ public function init() {

public function wl_post_jsonld_array( $data, $post_id ) {

$relations = $data['relations'];
$relations = $data['relations'] ?? null;

if ( ! is_a( $relations, 'Wordlift\Relation\Relations' ) ) {
return $data;
Expand Down
8 changes: 6 additions & 2 deletions src/includes/class-wordlift-entity-type-service.php
Original file line number Diff line number Diff line change
Expand Up @@ -456,11 +456,15 @@ function ( $item ) {
*
* @param int $term_id The term ID.
*
* @return array An array of custom fields (see `custom_fields` in Wordlift_Schema_Service).
* @return array|null An array of custom fields (see `custom_fields` in Wordlift_Schema_Service).
* @since 3.32.0
*/
public function get_custom_fields_for_term( $term_id ) {
$selected_entity_types = get_term_meta( $term_id, 'wl_entity_type' );
$selected_entity_types = get_term_meta( $term_id, 'wl_entity_type' );
if ( ! is_array( $selected_entity_types ) ) {
return null;
}

$selected_entity_types[] = 'thing';
$selected_entity_types = array_unique( $selected_entity_types );

Expand Down
4 changes: 3 additions & 1 deletion src/includes/class-wordlift.php
Original file line number Diff line number Diff line change
Expand Up @@ -1698,7 +1698,9 @@ private function define_admin_hooks( $that ) {
* @since 3.23.0
*/
add_filter(
'allowed_block_types',
version_compare( get_bloginfo( 'version' ), '5.8', '>=' )
? 'allowed_block_types_all'
: 'allowed_block_types',
function ( $value ) {

if ( true === $value ) {
Expand Down
24 changes: 0 additions & 24 deletions src/libraries/action-scheduler/.editorconfig

This file was deleted.

14 changes: 0 additions & 14 deletions src/libraries/action-scheduler/.gitattributes

This file was deleted.

15 changes: 0 additions & 15 deletions src/libraries/action-scheduler/.github/release-drafter.yml

This file was deleted.

97 changes: 0 additions & 97 deletions src/libraries/action-scheduler/.github/workflows/pr-unit-tests.yml

This file was deleted.

5 changes: 0 additions & 5 deletions src/libraries/action-scheduler/.gitignore

This file was deleted.

Loading

0 comments on commit 66f7084

Please sign in to comment.