-
Notifications
You must be signed in to change notification settings - Fork 437
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(mongodb): Exception throwing fatal error, Broken handling of Mong… #1032
Conversation
…odbConnectionFactory config, Incorrect MongodbConnectionFactory documentation Closes: php-enqueue#1031, php-enqueue#1027
There are some CS issues (check Travis for more details). Could you take a look at it? Good to go once fixed. |
Yes, I have seen it. But am pretty confused as these violations are on lines I did NOT touch. |
CI is configured to look if files need fixing in terms of code style if they have been modified. They might have been in this state since some time, and since no one ever updated those, no longer conform to code style guidelines. |
Maybe, but the formatting it suggest looks broken. Do you really want me to break the formatting of code I didn't even author? |
The changes that PHP-CS-Fixer suggest are "only" those: --- Original
+++ New
@@ @@
if (false == isset($parsedUrl['scheme'])) {
- throw new \LogicException(sprintf(
- 'The given DSN schema "%s" is not supported. There are supported schemes: "%s".',
- $parsedUrl['scheme'],
- implode('", "', array_keys($supported))
- ));
+ throw new \LogicException(sprintf('The given DSN schema "%s" is not supported. There are supported schemes: "%s".', $parsedUrl['scheme'], implode('", "', array_keys($supported))));
} --- Original
+++ New
@@ @@
if (!is_int($delay)) {
- throw new \LogicException(sprintf(
- 'Delay must be integer but got: "%s"',
- is_object($delay) ? get_class($delay) : gettype($delay)
- ));
+ throw new \LogicException(sprintf('Delay must be integer but got: "%s"', is_object($delay) ? get_class($delay) : gettype($delay)));
@@ @@
if (!is_int($timeToLive)) {
- throw new \LogicException(sprintf(
- 'TimeToLive must be integer but got: "%s"',
- is_object($timeToLive) ? get_class($timeToLive) : gettype($timeToLive)
- ));
+ throw new \LogicException(sprintf('TimeToLive must be integer but got: "%s"', is_object($timeToLive) ? get_class($timeToLive) : gettype($timeToLive)));
} I understand that it's not your fault or concern - I can fix that for you if you prefer, and we will merge your PR on top of mine - it will just take a few hours more to get it merged. I'd like you to understand why it happened and why you were asked for it. Historically there was no PHP-CS used in enqueue-dev, but at some point it was introduced. Due to the fact that the code base was relatively large it was decided to not fix code style immediately and instead postpone it - PHP-CS-Fixer is specifically set up to only check files that changed in the branch in question. Obviously as you can tell it was wrong and code style should have been fixed then and there, but the choice was made and we have to live with it. If it's any consolation for you I wasn't present here in this repo at the time as well, so I had no influence over this. So, while it's not specifically your code, we will have to adjust anyway. Ignoring CI checks is worse offense in my view than adjusting a couple lines that are unrelated to your issue 😞 |
All understood. If you are okay with me changing parts of code that are not related to the issue and you are also okay with inferior formatting (And you already replied positively to both these concerns) I have no problem with that either :-) Will do. By this nagging, I only wanted to make absolutely clear that the problem is understood and this debate won't accidentally do more harm that good. I also consider this concert dismissed. |
On a completely unrelated note. Is it okay, that |
Highly possible 😄 |
Okay, I won't dare to try to fix this here as I may break something. |
…odbConnectionFactory config, Incorrect MongodbConnectionFactory documentation
Closes: #1031, #1027