-
-
Notifications
You must be signed in to change notification settings - Fork 255
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
Fix PHP platform #430
Fix PHP platform #430
Conversation
@@ -7,7 +7,7 @@ | |||
"php": ">=7.3" | |||
}, | |||
"require-dev": { | |||
"phpunit/phpunit": "^9.0" | |||
"phpunit/phpunit": "^10" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since the Class and the filename does not match only PHPUnit 10 is able to work
* | ||
* @return {Boolean} true is the specified email is valid, false otherwise | ||
*/ | ||
namespace Fgribreau; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is the main error.
In composer, we said Fgribreau
namespace is in platform/php
. But this was wrong. It was Fgribreau\PHP
. So the class was not autoloadable.
Two way to fix it
- fix the namespace here, to remove PHP. I prefer this one.
PHP
in a PHP namespace brings nothing - fix in composer json, to append
\\PHP
As you can see, I choose. This is a BC Break. BUT since it does not work anyway, this is a bugfix
BTW, the README was already OK
@@ -39,9 +30,6 @@ public static function blacklist(): array | |||
return array_keys(self::$blacklist); | |||
} | |||
|
|||
/** | |||
* Check if an email is blacklisted or not. | |||
*/ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I removed useless PHPDoc
|
||
require_once __DIR__ . '/../platform/php/MailChecker.php'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We use the autoloader now, to ensure the composer setup is correct
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
sadly npm run test:php
does not run with these changes, I'm bringing it back:
require_once __DIR__ . '/../platform/php/MailChecker.php';
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I guess it's because you didn't run composer install
before running npm run test:php
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
indeed, we don't rely on composer currently (see package.json for the cross-language support)
No description provided.