Skip to content

Commit 573fecb

Browse files
authored
Merge pull request #67 from wp-graphql/feat/prevent-conflicts-with-old-plugin
fix: prevent conflicts with old plugin
2 parents 295d4c8 + c59319c commit 573fecb

20 files changed

+273
-122
lines changed

.github/workflows/testing-integration.yml

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -18,21 +18,19 @@ jobs:
1818
runs-on: ubuntu-latest
1919
strategy:
2020
matrix:
21-
php: [ '8.0', '7.4' ]
22-
wordpress: [ '6.1', '5.9' ]
21+
php: [ '8.1', '8.0' ]
22+
wordpress: [ '6.2', '6.1' ]
2323
acf_pro: [ true, false ]
2424
acf_version: [ 5.12.4, 6.1.6 ]
2525
include:
26-
- php: '8.1'
27-
wordpress: '6.1'
28-
acf_pro: true
29-
acf_version: '6.1.0-alpha1'
3026
- php: '8.1'
3127
wordpress: '6.1'
3228
acf_pro: true
3329
coverage: 1
3430
- php: '8.1'
3531
wordpress: '5.9'
32+
- php: '7.4'
33+
wordpress: '6.1'
3634
- php: '7.3'
3735
wordpress: '5.9'
3836
fail-fast: false

access-functions.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
*/
99
function register_graphql_acf_field_type( string $acf_field_type, $config = [] ): void {
1010

11-
add_action( 'graphql_acf_register_field_types', static function ( \WPGraphQL\Acf\FieldTypeRegistry $registry ) use ( $acf_field_type, $config ) {
11+
add_action( 'wpgraphql/acf/register_field_types', static function ( \WPGraphQL\Acf\FieldTypeRegistry $registry ) use ( $acf_field_type, $config ) {
1212
$registry->register_field_type( $acf_field_type, $config );
1313
} );
1414

composer.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@
3030
"wp-graphql/wp-graphql-testcase": "~2.3",
3131
"wp-graphql/wp-graphql": "^1.14",
3232
"phpunit/phpunit": "^9.5",
33+
"slevomat/coding-standard": "^8.9",
3334
"simpod/php-coveralls-mirror": "^3.0",
3435
"phpstan/extension-installer": "^1.3"
3536
},

composer.lock

Lines changed: 130 additions & 18 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

phpcs.ruleset.xml

Lines changed: 0 additions & 10 deletions
This file was deleted.

phpcs.xml.dist

Lines changed: 19 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,13 @@
88
<!-- Check against minimum WP version. -->
99
<config name="minimum_supported_wp_version" value="5.0" />
1010

11+
<!--
12+
Prevent errors caused by WordPress Coding Standards not supporting PHP 8.0+.
13+
See: https://github.com/WordPress/WordPress-Coding-Standards/issues/2035
14+
See: https://github.com/WordPress/WordPress-Coding-Standards/issues/2035#issuecomment-1325532520
15+
-->
16+
<ini name="error_reporting" value="E_ALL &#38; ~E_DEPRECATED" />
17+
1118
<!--
1219
Pass some flags to PHPCS:
1320
p flag: Show progress of the run.
@@ -41,19 +48,20 @@
4148
<exclude-pattern>*/node_modules/*</exclude-pattern>
4249
<exclude-pattern>*/vendor/*</exclude-pattern>
4350

51+
<!-- This defines custom escapting functions, such as ACF escaping functions -->
4452
<rule ref="WordPress.Security.EscapeOutput">
45-
<properties>
46-
<property type="array" name="customAutoEscapedFunctions">
53+
<properties>
54+
<property name="customAutoEscapedFunctions" type="array">
4755
<element value="acf_esc_attr"/>
4856
<element value="acf_esc_attr_e"/>
4957
<element value="acf_esc_attrs"/>
5058
<element value="acf_esc_atts"/>
5159
<element value="acf_esc_atts_e"/>
5260
<element value="acf_esc_html"/>
5361
<element value="acf_punctify"/>
54-
</property>
55-
</properties>
56-
</rule>
62+
</property>
63+
</properties>
64+
</rule>
5765

5866
<rule ref="WordPress.WP.I18n">
5967
<properties>
@@ -80,6 +88,9 @@
8088
<exclude name="PHPCompatibility.Keywords.ForbiddenNamesAsDeclared.objectFound"/>
8189
<exclude name="Squiz.PHP.DisallowMultipleAssignments.FoundInControlStructure"/>
8290

91+
<!-- excluded because we are using namespaced hooks, such as "wpgraphql/acf/$action_name" -->
92+
<exclude name="WordPress.NamingConventions.ValidHookName.UseUnderscores"/>
93+
8394
<!-- Should maybe Add Back Later -->
8495
<exclude name="PEAR.Functions.FunctionCallSignature.ContentAfterOpenBracket"/>
8596
<exclude name="PEAR.Functions.FunctionCallSignature.CloseBracketLine"/>
@@ -113,4 +124,7 @@
113124

114125
<!-- Enforce short array syntax -->
115126
<rule ref="Generic.Arrays.DisallowLongArraySyntax"/>
127+
128+
<!-- Use FQCN for PHPDoc types -->
129+
<rule ref="SlevomatCodingStandard.Namespaces.FullyQualifiedClassNameInAnnotation"/>
116130
</ruleset>

src/AcfGraphQLFieldResolver.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,19 +7,19 @@
77
class AcfGraphQLFieldResolver {
88

99
/**
10-
* @var AcfGraphQLFieldType
10+
* @var \WPGraphQL\Acf\AcfGraphQLFieldType
1111
*/
1212
protected $acf_graphql_field_type;
1313

1414
/**
15-
* @param AcfGraphQLFieldType $acf_graphql_field_type
15+
* @param \WPGraphQL\Acf\AcfGraphQLFieldType $acf_graphql_field_type
1616
*/
1717
public function __construct( AcfGraphQLFieldType $acf_graphql_field_type ) {
1818
$this->acf_graphql_field_type = $acf_graphql_field_type;
1919
}
2020

2121
/**
22-
* @return AcfGraphQLFieldType
22+
* @return \WPGraphQL\Acf\AcfGraphQLFieldType
2323
*/
2424
public function get_acf_graphql_field_type(): AcfGraphQLFieldType {
2525
return $this->acf_graphql_field_type;

0 commit comments

Comments
 (0)