Skip to content
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

Added function to allow dot notation in Source->config array #28

Merged
merged 4 commits into from
Oct 14, 2024

Conversation

WilcoLouwerse
Copy link
Contributor

No description provided.

{

if(($diff = array_diff(self::REQUIRED_PARAMETERS_PASSWORD, array_keys(array: $configuration))) !== []) {
throw new BadRequestException(message: 'Some required parameters are not set: ['.implode(separator: ',', array: $diff).']');
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can the implode be assigned to a var on an empty line above?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We could try that, yes

@@ -3,9 +3,138 @@
namespace OCA\OpenConnector\Service;


use GuzzleHttp\Client;
use OAuthException;
use Symfony\Component\HttpFoundation\Exception\BadRequestException;

class AuthenticationService
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we want class docblocks in this repo?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There was no docblock yet, we can add it if we want to.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is not a question, we want docblocks

Comment on lines +186 to +198
// Check if there are keys containing a dot we want to map to a different position in the $config array.
foreach ($config as $key => $value) {
if (str_contains($key, '.')) {
$dotConfig->set($key, $value);
$unsetKeys[] = $key;
}
}

// Remove the old keys containing a dot that we mapped to a different position in the $config array.
$config = $dotConfig->all();
foreach ($unsetKeys as $key) {
unset($config[$key]);
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For my understanding, this is to prevent a key that contains a dot from being seen as another step deeper in the dotArray?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

To remove these:
image

Otherwise they would still be present here:
image

@WilcoLouwerse WilcoLouwerse merged commit 334dbf9 into development Oct 14, 2024
1 check passed
@WilcoLouwerse WilcoLouwerse deleted the feature/CONNECTOR-56/acato-tilburg-sync branch October 14, 2024 13:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants