Skip to content

Commit

Permalink
tweak: improve types for test frameworks (#84)
Browse files Browse the repository at this point in the history
  • Loading branch information
g105b committed Apr 29, 2023
1 parent 8c80353 commit a7e0856
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 4 deletions.
11 changes: 8 additions & 3 deletions src/Curl.php
Original file line number Diff line number Diff line change
Expand Up @@ -201,8 +201,13 @@ public function unescape(string $str):string {

/**
* Obtain the underlying curl resource, as created with curl_init.
* The return type is purposefully missing, to allow for test frameworks
* to extend this class to provide stubbed HTTP functionality.
*
* @return CurlHandle
* @noinspection PhpMissingReturnTypeInspection
*/
public function getHandle():CurlHandle {
public function getHandle() {
return $this->ch;
}

Expand All @@ -218,10 +223,10 @@ public function getAllInfo():array {
}

public function getHeaderFunction():?callable {
return $this->headerFunction ?? null;
return $this->headerFunction;
}

public function getWriteFunction():?callable {
return $this->writeFunction ?? null;
return $this->writeFunction;
}
}
7 changes: 6 additions & 1 deletion src/CurlInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -105,8 +105,13 @@ public function unescape(string $str):string;

/**
* Obtain the underlying curl resource, as created with curl_init.
* The return type is purposefully missing, to allow for test frameworks
* to extend this class to provide stubbed HTTP functionality.
*
* @return CurlHandle
* @noinspection PhpMissingReturnTypeInspection
*/
public function getHandle():CurlHandle;
public function getHandle();

/**
* Gets all CURLINFO_ data, identical to calling
Expand Down

0 comments on commit a7e0856

Please sign in to comment.