-
Notifications
You must be signed in to change notification settings - Fork 805
Add DataDog tracing stub #1653
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
base: master
Are you sure you want to change the base?
Add DataDog tracing stub #1653
Conversation
* @var int | ||
* @cvalue DD_TRACE_DBM_PROPAGATION_DISABLED | ||
*/ | ||
const DBM_PROPAGATION_DISABLED = UNKNOWN; |
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.
Could you please change UNKNOWN to the valid values for all constants?
namespace DDTrace { | ||
/** | ||
* @var int | ||
* @cvalue DD_TRACE_DBM_PROPAGATION_DISABLED |
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.
Could you please clarify what is the puprose of @cvalue
tag? Could you please remove these tags? Tests checks PHPDocs for validness based on "canonical" list of PHPDoc tags (https://docs.phpdoc.org/3.0/guide/guides/docblocks.html#more-on-docblocks) and with such tags test will fail. Also after you change the value of constant to a valid scalar, @var
tag also can be removed as redundant in other declarations
@@ -0,0 +1,1051 @@ | |||
<?php | |||
|
|||
/** @generate-class-entries */ |
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.
This line probably can be just removed
public string $spanId; | ||
|
||
/** | ||
* @var string $traceState |
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.
This PHPDoc and some other similar below also can be removed as redundant since declaration already defines the name and the type of property
public function getLink(): SpanLink {} | ||
|
||
/** | ||
* @return Returns the span id as zero-padded 16 character hexadecimal string. |
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.
@return
tag doesn't declare type here. Please change to @return string Returns the span id .....
* | ||
* @param \DDTrace\Span $span the span associated with this user request. | ||
* @param array $data an array with keys named '_GET', '_POST', '_SERVER', '_FILES', '_COOKIE' | ||
* @param string|resource|null $body the body of the request (a string or a seekable resource) |
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.
Are there any advantages of string|resource|null
comparing to ?mixed
type hint here? Maybe replace it to ?mixed
equal to signature?
|
||
/** | ||
* Notifies the user request listeners of the imminence of a commit, and allows for the replacement of the response. | ||
* @param \DDTrace\Span $span the span associated with this user request. |
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.
The same issues as above
* @return string|null The app name, else the fallback name. Return 'null' if the app name isn't set and no | ||
* fallback name is provided. | ||
*/ | ||
function ddtrace_config_app_name(?string $fallbackName = null): null|string {} |
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.
Maybe change return type to ?string
instead of union type?
* @param mixed $args,... Arguments of the function | ||
* @return mixed false if void function was properly executed, else the return value of it | ||
*/ | ||
function dd_trace_internal_fn(string $functionName, mixed ...$args) {} |
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.
Does it make sense to declare return type mixed
in signature as well?
function dd_trace_close_all_spans_and_flush(): void {} | ||
|
||
/** | ||
* @alias DDTrace_trace_function |
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.
Could you please change @alias
tag to @see
. Stub tests check PHPDoc tags based on canonical
list of tags https://docs.phpdoc.org/3.0/guide/guides/docblocks.html#more-on-docblocks and these tags don't contain @alias
This PR adds the DataDog
ddtracing
extensions stubs.These stubs are copied from their repository: https://github.com/DataDog/dd-trace-php/blob/master/ext/ddtrace.stub.php
Their code is dual-licensed Apache2/BSD3, so it's compatible with this repo: https://github.com/DataDog/dd-trace-php/blob/master/LICENSE