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

Fix PHP 7 incompatibilities #2

Merged
merged 7 commits into from
Sep 25, 2017
Merged

Fix PHP 7 incompatibilities #2

merged 7 commits into from
Sep 25, 2017

Conversation

emirb
Copy link
Contributor

@emirb emirb commented Sep 22, 2017

@emirb
Copy link
Contributor Author

emirb commented Sep 22, 2017

Can you please add Travis (or similar) continuous integration service to the repository?

* @param CurlHandler $ch optional initialized curl handle
* @param string $uri the URI to make the request to
* @param array $post the parameters to use for the POST body
* @param \GuzzleHttp\Ring\Client\CurlHandler $ch optional initialized curl handle
Copy link
Contributor

Choose a reason for hiding this comment

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

This is an actual Curl adapter that is not related to Guzzle. So this is an invalid change

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Can you please point me to the actual file where the adapter is defined?

Copy link
Contributor

Choose a reason for hiding this comment

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

THIS file.. the one you changed and we are commenting on :)

Copy link
Contributor Author

@emirb emirb Sep 25, 2017

Choose a reason for hiding this comment

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

Sorry, my bad. I was confused by the fact that CurlHandler class does not exist. If it existed in this file then it'd be a violation of PSR-0 autoloading because of class name/file name mismatch.

By your comment, the parameter should be changed to \schibsted\payment\sdk\adapters\Curl. However, the thing is that the the parameter will actually be a resource (check curl_init return), so the type-hint against anything except resource would be misleading. As this is just a part of the care-requiring codebase, I'll revert my changes, to not open a Pandora box. :)

Copy link
Contributor

Choose a reason for hiding this comment

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

The value that is returned does not have a class, it is type hinted only as "resource" in the php docs : http://php.net/manual/en/function.curl-init.php so I am not sure what typehint would would here. That docblock line was written like that for human to read not IDE I guess.

@@ -16,6 +16,7 @@
protected $_sdk = null;

protected $_sdk_class = '';
protected $name;
Copy link
Contributor

Choose a reason for hiding this comment

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

$name field has to be, and is, set on the sub classes. Abstract field, if there was such a thing.

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 was mostly for IDE complaints :-)

@alkemann
Copy link
Contributor

Ok Ill merge this and look at the issues with travis and the typehinting.

@alkemann alkemann merged commit cb591d5 into schibsted:master Sep 25, 2017
@emirb
Copy link
Contributor Author

emirb commented Sep 25, 2017

Thanks @alkemann!

@emirb emirb deleted the feature/update branch September 25, 2017 10:20
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.

2 participants