Skip to content

Added QueryDefaultsPlugin #67

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

Merged
merged 8 commits into from
Mar 30, 2017
Merged

Added QueryDefaultsPlugin #67

merged 8 commits into from
Mar 30, 2017

Conversation

Nyholm
Copy link
Member

@Nyholm Nyholm commented Mar 27, 2017

This will fix #66

CHANGELOG.md Outdated
@@ -1,5 +1,10 @@
# Change Log

## 1.5.0 - Unreleased
Copy link
Member

Choose a reason for hiding this comment

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

Hm, 1.5 or Unreleased? Using a version there is confusing, that's why we usually avoid it.

{
public function it_is_initializable()
{
$this->beConstructedWith([]);
Copy link
Member

Choose a reason for hiding this comment

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

you can add this to a let method, it's like setUp in phpunit. If you use beConstructedWith again, it will override the on in the let method.

public function it_is_initializable()
{
$this->beConstructedWith([]);
$this->shouldHaveType('Http\Client\Common\Plugin\QueryDefaultsPlugin');
Copy link
Member

Choose a reason for hiding this comment

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

I think we use ::class constants wherever possible. phpspec 3.0 generates specs like that by default.

private $queryParams = [];

/**
* @param array $queryParams Hashmap of query name to query value
Copy link
Contributor

Choose a reason for hiding this comment

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

if i read the code correctly, keys and values should not be http encoded, right? i think we should mention that here to avoid confusion and double-encoded parameters

@Nyholm
Copy link
Member Author

Nyholm commented Mar 28, 2017

Thank you for your reviews. I have updated the PR accordingly.


public function it_is_a_plugin()
{
$this->shouldImplement(Plugin::class);
Copy link
Member Author

Choose a reason for hiding this comment

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

This will break php 5.4 compatibility. Even though I think we should drop 5.4 support, this is not a good enough reason.

FYI @sagikazarmark

private $queryParams = [];

/**
* @param array $queryParams Hashmap of query name to query value. Names and values should not be url encoded.
Copy link
Contributor

Choose a reason for hiding this comment

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

"should" is too weak. i would say "Names and values must not be url encoded as this plugin will encode them"

@Nyholm Nyholm merged commit c53e999 into master Mar 30, 2017
@Nyholm
Copy link
Member Author

Nyholm commented Mar 30, 2017

Thank you for your reviews. New tag is coming up.

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.

[RFC] QueryDefaultPlugin
3 participants