Skip to content

Docs: Fix constant/function assignment in WP example #1094

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

Merged
merged 2 commits into from
Jan 12, 2025
Merged
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
19 changes: 10 additions & 9 deletions docs/further-reading.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
- [Function aliases](#function-aliases)
- [Laravel support](#laravel-support)
- [Symfony support](#symfony-support)
- [Wordpress support](#wordpress-support)
- [WordPress support](#wordpress-support)


### How to deal with unknown third-party symbols
Expand Down Expand Up @@ -155,9 +155,9 @@ return [
Note that the path is the "regular path(s)" that can be passed to patchers.


### Wordpress Support
### WordPress Support

When writing a Wordpress plugin, you need to [exclude Wordpress' symbols](#excluded-symbols). To facilitate
When writing a WordPress plugin, you need to [exclude WordPress' symbols](#excluded-symbols). To facilitate
this task, [Snicco] created a third-party CLI tool [php-scoper-excludes] that can be used to generate
PHP-Scoper compatible symbol lists for any PHP codebase you point it.

Expand All @@ -180,14 +180,15 @@ function getWpExcludedSymbols(string $fileName): array
);
}

$wp_classes = getWpExcludedSymbols('exclude-wordpress-classes.json');
$wp_functions = getWpExcludedSymbols('exclude-wordpress-functions.json');
$wp_constants = getWpExcludedSymbols('exclude-wordpress-constants.json');
$wpConstants = getWpExcludedSymbols('exclude-wordpress-constants.json');
$wpClasses = getWpExcludedSymbols('exclude-wordpress-classes.json');
$wpFunctions = getWpExcludedSymbols('exclude-wordpress-functions.json');


return [
'exclude-classes' => $wp_classes,
'exclude-constants' => $wp_functions,
'exclude-functions' => $wp_constants,
'exclude-constants' => $wpConstants,
'exclude-classes' => $wpClasses,
'exclude-functions' => $wpFunctions,
// ...
];
```
Expand Down