-
Notifications
You must be signed in to change notification settings - Fork 80
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
Add transport method to url #24
base: master
Are you sure you want to change the base?
Add transport method to url #24
Conversation
yield ['http']; | ||
yield ['https']; | ||
} | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why are you using yield here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Data providers do not indeed need an array as a return, but an iterator can fit better for making them a little more readable.
{ | ||
$adapter = new APC(); | ||
$registry = new CollectorRegistry($adapter); | ||
|
||
$counter = $registry->registerCounter('test', 'some_counter', 'it increases', ['type']); | ||
$counter->incBy(6, ['blue']); | ||
|
||
$pushGateway = new PushGateway('pushgateway:9091'); | ||
$pushGateway = new PushGateway('pushgateway:9091', $transport); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Your code here doesn't match the constructor signature.
@igordrnobrega, any updates to the PR review above? |
d3269e2
to
82218c8
Compare
Sorry for the, almost, 2 months delay on this, but I was really busy this end of the year. |
Problem
I think is a problem to have transport method hardcoded in line 81 cause it removes the flexibility of the code.
Solution
I'm adding the viability of setting it in the constructor without the need of creating or setting a new client for it and letting the class handle the client.
I also made some fix on some standards like optional parameters at the end of function declaration and type hinted
$method
indoRequest
function