Update webmozart/assert dependency and remove strict types#950
Update webmozart/assert dependency and remove strict types#950aaronbauman wants to merge 1 commit intomailgun:masterfrom
Conversation
|
Hoping to see this merged as I have a client that really needs mailgun to work due to limitations on their host and external SMTP and this old library dependency is preventing me from using the drupal/mailgun module. |
|
Yeah, i've banged on this for a few hours now across 2 different PRs and can't figure out how to achieve compatibility for both versions. I'll be running with the patched version, but someone else should feel free to pick this up. |
|
Hopefully maybe you'll get some support from the mailgun org |
|
@aaronbauman It looks like the implementation of the reportInvalidArgument method is the same in the mailgun implementation as it is in the parent Webmozart Assert. Is it possible to just delete the override so that it doesn't fail the build and just let the class use the parent version? |
|
Can you try following: namespace Mailgun;
use Mailgun\Exception\InvalidArgumentException;
if (version_compare(\Composer\InstalledVersions::getVersion('webmozart/assert'), '2.0.0', '>=')) {
final class Assert extends \Webmozart\Assert\Assert
{
protected static function reportInvalidArgument(string $message): never
{
throw new InvalidArgumentException($message);
}
}
} else {
final class Assert extends \Webmozart\Assert\Assert
{
protected static function reportInvalidArgument($message): void
{
throw new InvalidArgumentException($message);
}
}
} |
… of webmozart/assert
cb07099 to
f7c9d37
Compare
|
Nope. The static analysis is simply too aggressive. |
|
Seems like a major version release for mailgun-php would be appropriate, dropping support for PHP < 8 This would allow significant reduction in the tooling and testing coverage, as well as updates for packages like webmozart/assert. |
addresses #948