This PR can be summarized in the following changelog entry:
Deprecates Yoast_ACF_Analysis_Facade::get_filter_name(). Use hard-coded hook names instead.
This deprecates the yoast-acf-analysis/config filter hook in favour of the Yoast\WP\ACF\config hook.
This deprecates the yoast-acf-analysis/headlines filter hook in favour of the Yoast\WP\ACF\headlines hook.
This deprecates the yoast-acf-analysis/blacklist_type filter hook in favour of the Yoast\WP\ACF\blacklist_type hook.
This deprecates the yoast-acf-analysis/blacklist_name filter hook in favour of the Yoast\WP\ACF\blacklist_name hook.
This deprecates the yoast-acf-analysis/scraper_config filter hook in favour of the Yoast\WP\ACF\scraper_config hook.
This deprecates the yoast-acf-analysis/refresh_rate filter hook in favour of the Yoast\WP\ACF\refresh_rate hook.
This deprecates the yoast-acf-analysis/field_selectors filter hook in favour of the Yoast\WP\ACF\field_selectors hook.
This deprecates the yoast-acf-analysis/field_order filter hook in favour of the Yoast\WP\ACF\field_order hook.
Relevant technical choices:
:exclamation: This PR will be easiest to review by going through the commits individually.
PHPCS: Update to YoastCS 2.0.0
This updates the dependency in composer.json, as well as the PHPCS ruleset for YoastCS 2.0.0.
Includes:
A selective update of the composer.lock for just YoastCS and its dependencies.
Removing the tweaks to the Composer check-cs script to allow for different PHP requirements in different directories.
PHP 5.6 is now the minimum PHP version everywhere.
Having filter names created via a function call makes it impossible for documentation scrapers to document the available filters.
This commit deprecated the method which was used for this and changes all existing filter to hard-coded filter names.
The filter names, however, are still the same, so this does not constitute a BC-break.
CS: deprecate old-style hook and add new-style hook [1]
This deprecates the yoast-acf-analysis/config filter hook in favour of the Yoast\WP\ACF\config hook.
[This needs a changelog entry]
CS: deprecate old-style hook and add new-style hook [2]
This deprecates the yoast-acf-analysis/headlines filter hook in favour of the Yoast\WP\ACF\headlines hook.
[This needs a changelog entry]
CS: deprecate old-style hook and add new-style hook [3]
This deprecates the yoast-acf-analysis/blacklist_type filter hook in favour of the Yoast\WP\ACF\blacklist_type hook.
[This needs a changelog entry]
CS: deprecate old-style hook and add new-style hook [4]
This deprecates the yoast-acf-analysis/blacklist_name filter hook in favour of the Yoast\WP\ACF\blacklist_name hook.
Includes adjusting a previously deprecated filter which should now point to the new-style filter to use apply_filters_deprecated() and provide proper deprecation information.
[This needs a changelog entry]
CS: deprecate old-style hook and add new-style hook [5]
This deprecates the yoast-acf-analysis/scraper_config filter hook in favour of the Yoast\WP\ACF\scraper_config hook.
[This needs a changelog entry]
CS: deprecate old-style hook and add new-style hook [6]
This deprecates the yoast-acf-analysis/refresh_rate filter hook in favour of the Yoast\WP\ACF\refresh_rate hook.
[This needs a changelog entry]
CS: deprecate old-style hook and add new-style hook [7]
This deprecates the yoast-acf-analysis/field_selectors filter hook in favour of the Yoast\WP\ACF\field_selectors hook.
[This needs a changelog entry]
CS: deprecate old-style hook and add new-style hook [8]
This deprecates the yoast-acf-analysis/field_order filter hook in favour of the Yoast\WP\ACF\field_order hook.
[This needs a changelog entry]
CS: use short arrays (everywhere)
CS: don't use Yoda conditions
Test instructions
This PR can be tested by following these steps:
See the test instructions in the Yoast/wpseo-woocommerce#451 PR for guidance on how to test this PR.
Summary
This PR can be summarized in the following changelog entry:
Yoast_ACF_Analysis_Facade::get_filter_name()
. Use hard-coded hook names instead.yoast-acf-analysis/config
filter hook in favour of theYoast\WP\ACF\config
hook.yoast-acf-analysis/headlines
filter hook in favour of theYoast\WP\ACF\headlines
hook.yoast-acf-analysis/blacklist_type
filter hook in favour of theYoast\WP\ACF\blacklist_type
hook.yoast-acf-analysis/blacklist_name
filter hook in favour of theYoast\WP\ACF\blacklist_name
hook.yoast-acf-analysis/scraper_config
filter hook in favour of theYoast\WP\ACF\scraper_config
hook.yoast-acf-analysis/refresh_rate
filter hook in favour of theYoast\WP\ACF\refresh_rate
hook.yoast-acf-analysis/field_selectors
filter hook in favour of theYoast\WP\ACF\field_selectors
hook.yoast-acf-analysis/field_order
filter hook in favour of theYoast\WP\ACF\field_order
hook.Relevant technical choices:
:exclamation: This PR will be easiest to review by going through the commits individually.
PHPCS: Update to YoastCS 2.0.0
This updates the dependency in
composer.json
, as well as the PHPCS ruleset for YoastCS 2.0.0.Includes:
composer.lock
for just YoastCS and its dependencies.check-cs
script to allow for different PHP requirements in different directories. PHP 5.6 is now the minimum PHP version everywhere.Ref: https://github.com/Yoast/yoastcs/releases/tag/2.0.0
PHPCS: whitelist an acf hook used
Deprecate
Yoast_ACF_Analysis_Facade::get_filter_name()
Having filter names created via a function call makes it impossible for documentation scrapers to document the available filters.
This commit deprecated the method which was used for this and changes all existing filter to hard-coded filter names.
The filter names, however, are still the same, so this does not constitute a BC-break.
CS: deprecate old-style hook and add new-style hook [1]
This deprecates the
yoast-acf-analysis/config
filter hook in favour of theYoast\WP\ACF\config
hook.[This needs a changelog entry]
CS: deprecate old-style hook and add new-style hook [2]
This deprecates the
yoast-acf-analysis/headlines
filter hook in favour of theYoast\WP\ACF\headlines
hook.[This needs a changelog entry]
CS: deprecate old-style hook and add new-style hook [3]
This deprecates the
yoast-acf-analysis/blacklist_type
filter hook in favour of theYoast\WP\ACF\blacklist_type
hook.[This needs a changelog entry]
CS: deprecate old-style hook and add new-style hook [4]
This deprecates the
yoast-acf-analysis/blacklist_name
filter hook in favour of theYoast\WP\ACF\blacklist_name
hook.Includes adjusting a previously deprecated filter which should now point to the new-style filter to use
apply_filters_deprecated()
and provide proper deprecation information.[This needs a changelog entry]
CS: deprecate old-style hook and add new-style hook [5]
This deprecates the
yoast-acf-analysis/scraper_config
filter hook in favour of theYoast\WP\ACF\scraper_config
hook.[This needs a changelog entry]
CS: deprecate old-style hook and add new-style hook [6]
This deprecates the
yoast-acf-analysis/refresh_rate
filter hook in favour of theYoast\WP\ACF\refresh_rate
hook.[This needs a changelog entry]
CS: deprecate old-style hook and add new-style hook [7]
This deprecates the
yoast-acf-analysis/field_selectors
filter hook in favour of theYoast\WP\ACF\field_selectors
hook.[This needs a changelog entry]
CS: deprecate old-style hook and add new-style hook [8]
This deprecates the
yoast-acf-analysis/field_order
filter hook in favour of theYoast\WP\ACF\field_order
hook.[This needs a changelog entry]
CS: use short arrays (everywhere)
CS: don't use Yoda conditions
Test instructions
This PR can be tested by following these steps:
See the test instructions in the Yoast/wpseo-woocommerce#451 PR for guidance on how to test this PR.
Closes #228