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

4650 Classes in Http namespace marked as deprecated #47

Merged
merged 1 commit into from
Jun 27, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 0 additions & 17 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -96,23 +96,6 @@ jobs:
- name: Run tests
run: composer test

php73:
name: "php 7.3"
runs-on: ubuntu-latest
container: "nofutur3/php-tests:7.3"
steps:
- name: Checkout repository
uses: actions/checkout@v2

- name: Install dependencies
run: composer install --no-interaction

- name: Run static analysis
run: composer stan7

- name: Run tests
run: composer test

php72:
name: "php 7.2"
runs-on: ubuntu-latest
Expand Down
3 changes: 3 additions & 0 deletions src/Exception/CurlException.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@

use Exception;

/**
* @deprecated will be removed
*/
class CurlException extends Exception
{
}
22 changes: 22 additions & 0 deletions src/Http/CurlWrapper.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,30 @@

use ThePay\ApiClient\TheClient;

/**
* @deprecated will be replaced by https://www.php-fig.org/psr/psr-18/ interface
*/
class CurlWrapper
{
/**
* @deprecated will be private
*/
const METHOD_GET = 'GET';
/**
* @deprecated will be private
*/
const METHOD_POST = 'POST';
/**
* @deprecated will be private
*/
const METHOD_DELETE = 'DELETE';
/**
* @deprecated will be private
*/
const METHOD_PUT = 'PUT';
/**
* @deprecated will be removed
*/
const HEADER_HOST = 'Host';

/** @var \CurlHandle */
Expand All @@ -21,6 +39,8 @@ class CurlWrapper
private $defaultHeaders;

/**
* @deprecated will be replaced by https://www.php-fig.org/psr/psr-18/ interface
*
* @param \CurlHandle $curl
* @param array<string> $defaultHeaders
*/
Expand All @@ -32,6 +52,8 @@ public function __construct($curl, array $defaultHeaders = array())
}

/**
* @deprecated will be replaced by https://www.php-fig.org/psr/psr-18/ interface
*
* @param string $method
* @param string $url
* @param string $data
Expand Down
5 changes: 5 additions & 0 deletions src/Http/CurlWrapperFactory.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,14 @@

namespace ThePay\ApiClient\Http;

/**
* @deprecated will be replaced by https://www.php-fig.org/psr/psr-18/ interface
*/
class CurlWrapperFactory
{
/**
* @deprecated will be replaced by https://www.php-fig.org/psr/psr-18/ interface
*
* @param array<string> $defaultHeaders
* @return CurlWrapper
*/
Expand Down
29 changes: 25 additions & 4 deletions src/Http/HttpCurlService.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,22 @@

/**
* Class HttpCurlService is simple curl wrapper
*
* @deprecated will be replaced by https://www.php-fig.org/psr/psr-18/ interface
*/
class HttpCurlService implements HttpServiceInterface
{
/**
* @deprecated will be private
*/
const HEADER_SIGNATURE = 'Signature';
/**
* @deprecated will be private
*/
const HEADER_SIGNATURE_DATE = 'SignatureDate';
/**
* @deprecated will be private
*/
const HEADER_PLATFORM = 'Platform';

/** @var SignatureService */
Expand All @@ -21,17 +32,21 @@ class HttpCurlService implements HttpServiceInterface
private $curlWrapperFactory;

/**
* HttpCurlService constructor.
*
* @param SignatureService $signatureService
*/
* HttpCurlService constructor.
*
* @deprecated will be replaced by https://www.php-fig.org/psr/psr-18/ interface
*
* @param SignatureService $signatureService
*/
public function __construct(SignatureService $signatureService)
{
$this->signatureService = $signatureService;
$this->curlWrapperFactory = new CurlWrapperFactory();
}

/**
* @deprecated will be replaced by https://www.php-fig.org/psr/psr-18/ interface
*
* @param string $url
* @return HttpResponse
*/
Expand All @@ -42,6 +57,8 @@ public function get($url)
}

/**
* @deprecated will be replaced by https://www.php-fig.org/psr/psr-18/ interface
*
* @param string $url
* @param string $data POST request body content
* @return HttpResponse
Expand All @@ -53,6 +70,8 @@ public function post($url, $data = '')
}

/**
* @deprecated will be replaced by https://www.php-fig.org/psr/psr-18/ interface
*
* @param string $url
* @param string $data put request body content
* @return HttpResponse
Expand All @@ -64,6 +83,8 @@ public function put($url, $data = '')
}

/**
* @deprecated will be replaced by https://www.php-fig.org/psr/psr-18/ interface
*
* @param string $url
* @return HttpResponse
*/
Expand Down
22 changes: 22 additions & 0 deletions src/Http/HttpResponse.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@

namespace ThePay\ApiClient\Http;

/**
* @deprecated will be replaced by https://www.php-fig.org/psr/psr-7/ interface
*/
class HttpResponse
{
/**
Expand Down Expand Up @@ -31,6 +34,9 @@ class HttpResponse

/**
* HttpResponse constructor.
*
* @deprecated will be replaced by https://www.php-fig.org/psr/psr-7/ interface
*
* @param string|null $response
* @param int|null $code
* @param string $codeMessage
Expand All @@ -47,6 +53,8 @@ public function __construct($response = null, $code = null, $codeMessage = '', a
}

/**
* @deprecated will be replaced by https://www.php-fig.org/psr/psr-7/ interface
*
* @return string|null
*/
public function getResponse()
Expand All @@ -55,6 +63,8 @@ public function getResponse()
}

/**
* @deprecated will be replaced by https://www.php-fig.org/psr/psr-7/ interface
*
* @param string|null $response
* @return self
*/
Expand All @@ -65,6 +75,8 @@ public function setResponse($response)
}

/**
* @deprecated will be replaced by https://www.php-fig.org/psr/psr-7/ interface
*
* @return int|null
*/
public function getCode()
Expand All @@ -73,6 +85,8 @@ public function getCode()
}

/**
* @deprecated will be replaced by https://www.php-fig.org/psr/psr-7/ interface
*
* @return string
*/
public function getCodeMessage()
Expand All @@ -81,6 +95,8 @@ public function getCodeMessage()
}

/**
* @deprecated will be replaced by https://www.php-fig.org/psr/psr-7/ interface
*
* @param int|null $code
* @return self
*/
Expand All @@ -91,6 +107,8 @@ public function setCode($code)
}

/**
* @deprecated will be replaced by https://www.php-fig.org/psr/psr-7/ interface
*
* @return array<string, string>|null
*/
public function getHeaders()
Expand All @@ -99,6 +117,8 @@ public function getHeaders()
}

/**
* @deprecated will be replaced by https://www.php-fig.org/psr/psr-7/ interface
*
* @param non-empty-string $key
* @return string|null
*/
Expand All @@ -114,6 +134,8 @@ public function getHeader($key)
}

/**
* @deprecated will be replaced by https://www.php-fig.org/psr/psr-7/ interface
*
* @return string|null
*/
public function getBody()
Expand Down
10 changes: 10 additions & 0 deletions src/Http/HttpServiceInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,30 +4,40 @@

/**
* Interface is an abstract HTTP requests layer
*
* @deprecated will be replaced by https://www.php-fig.org/psr/psr-18/ interface
*/
interface HttpServiceInterface
{
/**
* @deprecated will be replaced by https://www.php-fig.org/psr/psr-18/ interface
*
* @param string $url
* @return HttpResponse
*/
public function get($url);

/**
* @deprecated will be replaced by https://www.php-fig.org/psr/psr-18/ interface
*
* @param string $url
* @param string $data POST request body content
* @return HttpResponse
*/
public function post($url, $data = '');

/**
* @deprecated will be replaced by https://www.php-fig.org/psr/psr-18/ interface
*
* @param string $url
* @param string $data PUT request body content
* @return HttpResponse
*/
public function put($url, $data = '');

/**
* @deprecated will be replaced by https://www.php-fig.org/psr/psr-18/ interface
*
* @param string $url
* @return HttpResponse
*/
Expand Down