wordpress-stubs VS php-scoper

Compare wordpress-stubs vs php-scoper and see what are their differences.

wordpress-stubs

Up-to-date WordPress function and class declaration stubs for static analysis by PHPStan (by php-stubs)

php-scoper

๐Ÿ”จ Prefixes all PHP namespaces in a file/directory to isolate the code bundled in PHARs. (by humbug)
Our great sponsors
  • WorkOS - The modern identity platform for B2B SaaS
  • InfluxDB - Power Real-Time Data Analytics at Scale
  • SaaSHub - Software Alternatives and Reviews
wordpress-stubs php-scoper
2 2
131 676
2.3% 1.3%
8.0 9.2
10 days ago 1 day ago
PHP PHP
MIT License MIT License
The number of mentions indicates the total number of mentions that we've tracked plus the number of user suggested alternatives.
Stars - the number of stars that a project has on GitHub. Growth - month over month growth in stars.
Activity is a relative number indicating how actively a project is being developed. Recent commits have higher weight than older ones.
For example, an activity of 9.0 indicates that a project is amongst the top 10% of the most actively developed projects that we are tracking.

wordpress-stubs

Posts with mentions or reviews of wordpress-stubs. We have used some of these posts to build our list of alternatives and similar projects. The last one was on 2021-03-31.
  • wp-env IDE setup
    1 project | /r/Wordpress | 23 Dec 2021
  • ๐Ÿพ GraphQL API for WordPress is now scoped, thanks to PHP-Scoper!
    15 projects | dev.to | 31 Mar 2021
    return [ 'patchers' => [ function ( $file_path, $prefix, $contents ) { /* * There is currently no easy way to simply whitelist all global WordPress functions. * * This list here is a manual attempt after scanning through the AMP plugin, which means * it needs to be maintained and kept in sync with any changes to the dependency. * * As long as there's no built-in solution in PHP-Scoper for this, an alternative could be * to generate a list based on php-stubs/wordpress-stubs. devowlio/wp-react-starter/ seems * to be doing just this successfully. * * @see https://github.com/humbug/php-scoper/issues/303 * @see https://github.com/php-stubs/wordpress-stubs * @see https://github.com/devowlio/wp-react-starter/ */ $contents = str_replace( "\\$prefix\\_doing_it_wrong", '\\_doing_it_wrong', $contents ); $contents = str_replace( "\\$prefix\\__", '\\__', $contents ); $contents = str_replace( "\\$prefix\\esc_html_e", '\\esc_html_e', $contents ); $contents = str_replace( "\\$prefix\\esc_html", '\\esc_html', $contents ); $contents = str_replace( "\\$prefix\\esc_attr", '\\esc_attr', $contents ); $contents = str_replace( "\\$prefix\\esc_url", '\\esc_url', $contents ); $contents = str_replace( "\\$prefix\\do_action", '\\do_action', $contents ); // ... } ] ]

php-scoper

Posts with mentions or reviews of php-scoper. We have used some of these posts to build our list of alternatives and similar projects. The last one was on 2021-03-31.
  • ๐Ÿพ GraphQL API for WordPress is now scoped, thanks to PHP-Scoper!
    15 projects | dev.to | 31 Mar 2021
    return [ 'patchers' => [ function ( $file_path, $prefix, $contents ) { /* * There is currently no easy way to simply whitelist all global WordPress functions. * * This list here is a manual attempt after scanning through the AMP plugin, which means * it needs to be maintained and kept in sync with any changes to the dependency. * * As long as there's no built-in solution in PHP-Scoper for this, an alternative could be * to generate a list based on php-stubs/wordpress-stubs. devowlio/wp-react-starter/ seems * to be doing just this successfully. * * @see https://github.com/humbug/php-scoper/issues/303 * @see https://github.com/php-stubs/wordpress-stubs * @see https://github.com/devowlio/wp-react-starter/ */ $contents = str_replace( "\\$prefix\\_doing_it_wrong", '\\_doing_it_wrong', $contents ); $contents = str_replace( "\\$prefix\\__", '\\__', $contents ); $contents = str_replace( "\\$prefix\\esc_html_e", '\\esc_html_e', $contents ); $contents = str_replace( "\\$prefix\\esc_html", '\\esc_html', $contents ); $contents = str_replace( "\\$prefix\\esc_attr", '\\esc_attr', $contents ); $contents = str_replace( "\\$prefix\\esc_url", '\\esc_url', $contents ); $contents = str_replace( "\\$prefix\\do_action", '\\do_action', $contents ); // ... } ] ]
  • ๐Ÿ‘ท๐Ÿฝโ€โ™‚๏ธ Building the GraphQL API in the Open #1 (March '21)
    5 projects | dev.to | 19 Mar 2021
    ๐Ÿพ GraphQL API for WordPress is now scoped, thanks to PHP-Scoper! describes a strategy to scope a WordPress plugin using PHP-Scoper, as to avoid conflicts with other plugins.

What are some alternatives?

When comparing wordpress-stubs and php-scoper you can also consider the following projects:

phpstan-wordpress - WordPress extensions for PHPStan โ›๏ธ

wp-graphql - :rocket: GraphQL API for WordPress

mozart - Developers tool for WordPress plugins: Wraps all your projects dependencies in your own namespace, in order to prevent conflicts with other plugins loading the same dependencies in different versions.

wordpress-seo - Yoast SEO for WordPress

monorepo-builder - Composer tools to maintain a monorepo

wp-react-starter - ๐Ÿš€WordPress Plugin Boilerplate using modern web techs like TypeScript, SASS, and so on... on top of a local development environment with Docker and predefined GitLab CI for continous integration and deployment!

Symfony Dotenv - Registers environment variables from a .env file

site-kit-wp - Site Kit is a one-stop solution for WordPress users to use everything Google has to offer to make them successful on the web.