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

Update client compatibility for newer versions PHP >= 7.2, <= 8.1 #32

Open
wants to merge 16 commits into
base: master
Choose a base branch
from
2 changes: 1 addition & 1 deletion .atoum.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

include 'vendor/autoload.php';

use mageekguy\atoum;
use atoum\atoum;
use Symfony\Component\Debug\ErrorHandler;
use Symfony\Component\Debug\ExceptionHandler;

Expand Down
12 changes: 7 additions & 5 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
language: php
dist: trusty
dist: bionic

php:
- 5.6
- 7.0
- 7.1
- 7.2
- 7.3
- 7.4
- 8.0
- 8.1

env:
global:
Expand All @@ -26,10 +27,11 @@ before_script:
script:
# Reset CUPS and PDF Printer
- sudo apt-get remove -yqq cups cups-pdf
- sudo apt-get install -yqq cups cups-pdf
- sudo apt-get install -yqq cups cups-pdf cups-client
- sudo adduser travis lpadmin
- sudo service cups restart
# Test PDF Printer
- which lp
- lp -d PDF LICENSE && sleep 10
# Run Tests
- ./vendor/bin/atoum -d tests/ -ncc -utr
16 changes: 8 additions & 8 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,16 +10,16 @@
}
],
"require": {
"php": ">=5.6",
"php-http/socket-client": "*",
"php-http/client-common": "*",
"php-http/message": "*",
"guzzlehttp/psr7": "*",
"symfony/yaml": "*"
"php": ">=7.2",
"php-http/socket-client": "^2.1",
"php-http/client-common": "^2.6",
"php-http/message": "^1.13",
"guzzlehttp/psr7": "^1.9",
"symfony/yaml": "^4.4||^5.4"
},
"require-dev": {
"symfony/debug": "*",
"atoum/atoum": "*"
"symfony/debug": "^4.4||^5.4",
"atoum/atoum": "^4.0"
},
"minimum-stability": "dev",
"prefer-stable": true,
Expand Down
3 changes: 2 additions & 1 deletion src/Transport/Client.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
use Http\Client\Socket\Client as SocketHttpClient;
use Http\Message\MessageFactory\GuzzleMessageFactory;
use Psr\Http\Message\RequestInterface;
use Psr\Http\Message\ResponseInterface;
use Smalot\Cups\CupsException;

/**
Expand Down Expand Up @@ -116,7 +117,7 @@ public function setAuthType($authType)
/**
* (@inheritdoc}
*/
public function sendRequest(RequestInterface $request)
public function sendRequest(RequestInterface $request): ResponseInterface
{
if ($this->username || $this->password) {
switch ($this->authType) {
Expand Down
2 changes: 1 addition & 1 deletion tests/Builder/Builder.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

namespace Smalot\Cups\Tests\Units\Builder;

use mageekguy\atoum;
use atoum\atoum;
use Smalot\Cups\Model\Job;
use Smalot\Cups\Model\Printer;
use Smalot\Cups\Transport\Client;
Expand Down
2 changes: 1 addition & 1 deletion tests/Manager/JobManager.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

namespace Smalot\Cups\Tests\Units\Manager;

use mageekguy\atoum;
use atoum\atoum;
use Smalot\Cups\Builder\Builder;
use Smalot\Cups\Model\Job;
use Smalot\Cups\Model\Printer;
Expand Down
2 changes: 1 addition & 1 deletion tests/Manager/PrinterManager.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

namespace Smalot\Cups\Tests\Units\Manager;

use mageekguy\atoum;
use atoum\atoum;
use Smalot\Cups\Builder\Builder;
use Smalot\Cups\Model\Printer;
use Smalot\Cups\Model\PrinterInterface;
Expand Down
2 changes: 1 addition & 1 deletion tests/Model/Job.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

namespace Smalot\Cups\Tests\Units\Model;

use mageekguy\atoum;
use atoum\atoum;

/**
* Class Job
Expand Down
2 changes: 1 addition & 1 deletion tests/Model/Printer.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

namespace Smalot\Cups\Tests\Units\Model;

use mageekguy\atoum;
use atoum\atoum;

/**
* Class Printer
Expand Down
3 changes: 2 additions & 1 deletion tests/Transport/Client.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
namespace Smalot\Cups\Tests\Units\Transport;

use Psr\Http\Message\RequestInterface;
use Psr\Http\Message\ResponseInterface;
use Smalot\Cups\Transport\Client as BaseClient;

/**
Expand All @@ -26,7 +27,7 @@ class Client extends BaseClient
/**
* @inheritDoc
*/
public function sendRequest(RequestInterface $request)
public function sendRequest(RequestInterface $request): ResponseInterface
{
$this->lastRequest = $request;
$this->lastResponse = parent::sendRequest($request);
Expand Down