Skip to content

Commit 82f4d40

Browse files
committed
Support PHP 8.0
1 parent a5addc6 commit 82f4d40

File tree

2 files changed

+7
-7
lines changed

2 files changed

+7
-7
lines changed

README.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -72,21 +72,21 @@ Please see [WooCommerce Stubs](https://github.com/php-stubs/woocommerce-stubs)
7272
- Write clean OOP code: 1 class per file, no other code in class files outside `class Name { ... }`
7373
- Structure your code: uniform class names (WPCS or PSR-4), keep classes in a separate directory `inc/`
7474
- Add proper PHPDoc blocks to classes, properties, methods, functions
75-
- Handle these only in your [main plugin file](https://github.com/kingkero/wordpress-demoplugin/blob/master/wordpress-demoplugin.php),
76-
another [main plugin file](https://github.com/pryley/site-reviews/blob/v5.0.1/site-reviews.php) example
75+
- Handle these only in your [main plugin file](https://github.com/kingkero/wordpress-demoplugin/blob/master/wordpress-demoplugin.php).
76+
Here is another [main plugin file](https://github.com/pryley/site-reviews/blob/v5.0.1/site-reviews.php) example.
7777
- Define constants, e.g. `MYPLUGIN_PATH`
7878
- Call `register_activation_hook()`, `register_deactivation_hook()`, `register_uninstall_hook()`
79-
- Class autoloading
79+
- Load class autoloader
8080
- Load translations
8181
- Support WP-CLI
8282
- Decide [what to load](https://github.com/szepeviktor/Toolkit4WP/blob/master/src/Is.php#L64-L73)
8383
- Start your plugin in a hook (`plugins_loaded`) - without direct execution
8484
- Avoid using core constants, use core functions or `MYPLUGIN_PATH`
8585
- Avoid bad parts of PHP
86-
- functions: eval, extract, compact, list
86+
- functions: `eval`, `extract`, `compact`, `list`
8787
- [type juggling](https://www.php.net/manual/en/language.types.type-juggling.php): `$a = '15'; if ($a) ...`
88-
- If you need robust code try avoiding all kinds of type casting (e.g. `if` needs a boolean),
88+
- If you need robust code try avoiding all kinds of type juggling (e.g. `if` needs a boolean),
8989
see [Variable handling functions](https://www.php.net/manual/en/ref.var.php)
90-
- If you are not bound by PHP 5.x consider following
90+
- If you are not bound by PHP 5 consider following
9191
[Neutron Standard](https://github.com/Automattic/phpcs-neutron-standard)
9292
- Do not enable `exit_error` in `WP_CLI::launch` or `WP_CLI::runcommand` to keep your code testable

composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
],
1212
"license": "MIT",
1313
"require": {
14-
"php": "~7.1",
14+
"php": "^7.1 || ^8.0",
1515
"php-stubs/wordpress-stubs": "^4.7 || ^5.0",
1616
"phpstan/phpstan": "^0.12.26",
1717
"symfony/polyfill-php73": "^1.12.0"

0 commit comments

Comments
 (0)