-
Notifications
You must be signed in to change notification settings - Fork 79
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
Conflict with composer cmd scripts #780
Comments
To add to this bug report, I see that it also affects PHP unit tests in a plugin. Previously, running the unit tests script via command line at the plugin root directory would run without any issues. However, unit tests won't run if we load the Freemius SDK (version 2.10.1) via the composer vendor directory (autoloaded). I debugged this, and this is the issue: (
The problem is that when we execute tests in a command line environment - WordPress is never loaded, However, if you change the above line from Proposed solution:
Though I'm not sure about the consequences of using |
I can confirm the proposal of @codex-m solves the issue for phpstan and phpcs. In this context, I would propose to also add typings to the default sdk script output on the ui like this: /**
* Freemius init function
*
* @return Freemius
* @throws Freemius_Exception Thrown when an API call returns an exception.
*/
function my_fs(): Freemius {
} |
Thanks. It looks like a legit issue and the solution also looks good. @DanieleAlessandra please add this to our internal Asana and let's handle it soon. |
Same issue here. When using the composer package, all the vendor/bin/ utilities stop working; in my case:
|
🐞 bug report
Behavior:
Freemius composer package causes conflict by stopping composer scripts from running as intended.
When PHPCodeSniffer is installed via composer using
composer require --dev dealerdirect/phpcodesniffer-composer-installer
the bin files it createsphpcbf
andphpcs
should be able to be referenced like thisvendor/bin/phpcbf -p
that will cause the library to run its behavior. However with the latest version of the SDK this doesn't work.I reported to the PHPCodeSniffer team and they helped identify the issue. The discussion and reason for the issue can be seen here: PHPCSStandards/PHP_CodeSniffer#781
Versions: (*)
Freemius SDK Version:
2.10.1WordPress Version:
N/APHP Version:
8.1 (tried different versions, no difference)The text was updated successfully, but these errors were encountered: