-
Notifications
You must be signed in to change notification settings - Fork 2
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
Error thrown in with usage of string in closure #16
Comments
Lemme guess, PHP 7.1 or older 🤦 |
That is correct. Seeing this issue on at least 7.3 and 7.4. |
Actually, seeing this in PHP 7.0 as well. |
Hmm, perhaps this isn't as simple as I had thought; PHP added typehint support for the Our autoloader also follows the FIG example of a PSR-4 autoloader pretty closely (though they forego typehinting). I'll rework the autoloader to explicitly cast to string rather than typehint, but could you please post a list of other plugins running in case there's a conflict with another autoloader? |
I have only been able to replicate this when trying to install a plugin through the Nexcess Dashboard Installer. |
Return as early as possible from the autoloader closure if we're not trying to access something in the `Nexcess\LimitOrders` namespace. Additionally, remove the `string` type-hint from the closure, as it may be contributing to #16.
Once 1.2.0 is tagged, let's make sure to retest this; everything in the codebase should be PHP 7.0+ compliant, so this may be a problem in the dashboard installer. |
Closing this, as we were able to sort out the issue (resolved in version 1.2.1 of the Nexcess Installer plugin). |
limit-orders/limit-orders.php
Line 24 in bd3acb9
[20-Apr-2020 15:51:12 UTC] PHP Catchable fatal error: Argument 1 passed to WP_CLI\Runner::Nexcess\LimitOrders{closure}() must be an instance of Nexcess\LimitOrders\string, string given in /chroot/home/aa5b74b2/ssldelay.watsonbot.com/html/wp-content/plugins/limit-orders/limit-orders.php on line 24
The text was updated successfully, but these errors were encountered: