Skip to content

Commit

Permalink
chore: Update Composer dev-deps and fix newly-surfaced PHPCS smells (#82
Browse files Browse the repository at this point in the history
)
  • Loading branch information
justlevine committed Apr 5, 2024
1 parent ab3e4d2 commit c3278b9
Show file tree
Hide file tree
Showing 13 changed files with 190 additions and 184 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@

## Unreleased

- chore: Update Composer dev-deps and fix newly-surfaced PHPCS smells.

## v0.1.1

This _minor_ release adds support for more social fields in the `RankMathSocialMetaSettings` and `RankMathUserSeo` types. Additionally, it fixes a bug where the `seo.openGraph.image` field would fail to resolve if provided a string image.
Expand Down
344 changes: 175 additions & 169 deletions composer.lock

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ public function get_query_args() {
if ( ! empty( $this->args['after'] ) ) {
$query_args['graphql_after_cursor'] = $this->get_after_offset();
}

if ( ! empty( $this->args['before'] ) ) {
$query_args['graphql_before_cursor'] = $this->get_before_offset();
}
Expand Down
1 change: 0 additions & 1 deletion src/Modules/Redirection/Data/Loader/RedirectionsLoader.php
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,6 @@ protected function loadKeys( array $keys ) {
);
}


$loaded[ $key ] = $redirections[ $index ];
}

Expand Down
2 changes: 1 addition & 1 deletion src/Type/WPInterface/Seo.php
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ public static function get_fields(): array {
'type' => OpenGraphMeta::get_type_name(),
'description' => __( 'The open graph meta properties.', 'wp-graphql-rank-math' ),
],

];

// Add breadcrumbs field.
Expand Down
2 changes: 1 addition & 1 deletion src/Type/WPObject/OpenGraph/Image.php
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ public static function get_fields(): array {
'type' => 'Float',
'description' => __( 'Height of image in pixels. ', 'wp-graphql-rank-math' ),
],

];
}
}
2 changes: 1 addition & 1 deletion src/Type/WPObject/OpenGraph/Product.php
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ public static function get_fields(): array {
'type' => OpenGraphProductAvailabilityEnum::get_type_name(),
'description' => __( 'The currency of the object price.', 'wp-graphql-rank-math' ),
],

];
}
}
4 changes: 2 additions & 2 deletions src/Type/WPObject/OpenGraph/Twitter.php
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ public static function get_fields(): array {
'type' => 'String',
'description' => __( '@username of content creator', 'wp-graphql-rank-math' ),
],

];
}

Expand All @@ -116,7 +116,7 @@ protected static function get_app_meta( array $source, string $type ): ?array {
if ( ! empty( $source[ 'app:url:' . $type ] ) ) {
$values['url'] = $source[ 'app:url:' . $type ];
}

return $values ?: null;
}
}
6 changes: 3 additions & 3 deletions src/Type/WPObject/OpenGraphMeta.php
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ public static function get_fields(): array {
'description' => __( 'The OpenGraph image meta', 'wp-graphql-rank-math' ),
'resolve' => static function ( $source ): ?array {
$values = ! empty( $source['og']['image'] ) ? $source['og']['image'] : [];

if ( ! empty( $source['og']['image'][0] ) ) {
$values['url'] = $source['og']['image'][0];
}
Expand All @@ -74,7 +74,7 @@ public static function get_fields(): array {
'type' => OpenGraph\Facebook::get_type_name(),
'description' => __( 'The Facebook OpenGraph meta values.', 'wp-graphql-rank-math' ),
'resolve' => static fn ( $source ): ?array => ! empty( $source['fb'] ) ? $source['fb'] : null,

],
'locale' => [
'type' => OpenGraphLocaleEnum::get_type_name(),
Expand Down Expand Up @@ -119,7 +119,7 @@ public static function get_fields(): array {
'description' => __( 'The Twitter OpenGraph meta values.', 'wp-graphql-rank-math' ),
'resolve' => static fn ( $source ): ?array => ! empty( $source['twitter'] ) ? $source['twitter'] : null,
],

'type' => [
'type' => 'String',
'description' => __( 'The OpenGraph object type.', 'wp-graphql-rank-math' ),
Expand Down
2 changes: 1 addition & 1 deletion src/Type/WPObject/Settings/Sitemap/ContentType.php
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ public static function get_fields(): array {
'type' => 'ContentTypeEnum',
'description' => __( 'The content type.', 'wp-graphql-rank-math' ),
],

];
}
}
1 change: 0 additions & 1 deletion src/TypeRegistry.php
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,6 @@ public static function init(): void {
// Initialize the registry.
self::initialize_registry();


/**
* Fires after all types have been registered.
*/
Expand Down
4 changes: 2 additions & 2 deletions vendor/composer/installed.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
'name' => 'axepress/wp-graphql-rank-math',
'pretty_version' => 'dev-develop',
'version' => 'dev-develop',
'reference' => '68c31b84bdd654febf24ebd5fd63e4ee1dd001d6',
'reference' => 'ab3e4d21add1fc3152fc7d043a65440fe262e0da',
'type' => 'wordpress-plugin',
'install_path' => __DIR__ . '/../../',
'aliases' => array(),
Expand All @@ -22,7 +22,7 @@
'axepress/wp-graphql-rank-math' => array(
'pretty_version' => 'dev-develop',
'version' => 'dev-develop',
'reference' => '68c31b84bdd654febf24ebd5fd63e4ee1dd001d6',
'reference' => 'ab3e4d21add1fc3152fc7d043a65440fe262e0da',
'type' => 'wordpress-plugin',
'install_path' => __DIR__ . '/../../',
'aliases' => array(),
Expand Down
2 changes: 1 addition & 1 deletion wp-graphql-rank-math.php
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ function graphql_seo_dependencies_not_ready(): array {
$deps['WPGraphQL'] = $wpgraphql_version;
}

if ( ! class_exists( '\RankMath' ) || defined( 'RANK_MATH_VERSION' ) && version_compare( RANK_MATH_VERSION, $rankmath_version, '<' ) ) {
if ( ! class_exists( '\RankMath' ) || ( defined( 'RANK_MATH_VERSION' ) && version_compare( RANK_MATH_VERSION, $rankmath_version, '<' ) ) ) {
$deps['RankMath SEO'] = $rankmath_version;
}

Expand Down

0 comments on commit c3278b9

Please sign in to comment.