Skip to content

Commit

Permalink
Update tools, dependencies and styles to align more closely with VuFi…
Browse files Browse the repository at this point in the history
…nd 9.0. (#19)
  • Loading branch information
demiankatz committed Sep 15, 2022
1 parent 351e384 commit a9281a5
Show file tree
Hide file tree
Showing 6 changed files with 51 additions and 28 deletions.
8 changes: 4 additions & 4 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,14 +11,14 @@ jobs:
VUFIND_LOCAL_DIR: $GITHUB_WORKSPACE/local
strategy:
matrix:
php-version: ['7.3', '7.4', '8.0']
php-version: ['7.4', '8.0', '8.1']
include:
- php-version: 7.3
phing_tasks: "phpunitfast"
- php-version: 7.4
phing_tasks: "phpunitfast phpcs-console php-cs-fixer-dryrun phpstan-console"
phing_tasks: "phpunitfast"
- php-version: 8.0
phing_tasks: "phpunitfast"
- php-version: 8.1
phing_tasks: "phpunitfast phpcs-console php-cs-fixer-dryrun phpstan-console"

steps:
- name: Setup PHP
Expand Down
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ All notable changes to this project will be documented in this file, in reverse

### Changed

- The minimum PHP version requirement has been raised to 7.3.
- The minimum PHP version requirement has been raised to 7.4.1.

### Deprecated

Expand Down
2 changes: 1 addition & 1 deletion build.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<property name="builddir" value="${tmp}/build/${phing.project.name}" override="true" />
<property name="srcdir" value="${project.basedir}" override="true" />
<property name="skip_phpdoc" value="false" />
<property name="phpdoc_version" value="3.0.0" />
<property name="phpdoc_version" value="3.3.1" />

<!-- Main Target -->
<target name="main" description="main target">
Expand Down
16 changes: 8 additions & 8 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,24 +20,24 @@
},
"config": {
"platform": {
"php": "7.3"
"php": "7.4.1"
}
},
"require": {
"php": ">=7.3",
"php": ">=7.4.1",
"laminas/laminas-http": ">=2.2"
},
"require-dev": {
"friendsofphp/php-cs-fixer": "2.19.0",
"friendsofphp/php-cs-fixer": "3.8.0",
"laminas/laminas-uri": ">=2.2",
"pear/http_request2": "2.4.2",
"phploc/phploc": "7.0.2",
"phpmd/phpmd": "2.10.0",
"phpstan/phpstan": "0.12.85",
"phpunit/phpunit": "9.5.4",
"phing/phing": "2.16.4",
"phpmd/phpmd": "2.12.0",
"phpstan/phpstan": "1.6.8",
"phpunit/phpunit": "9.5.20",
"phing/phing": "2.17.3",
"sebastian/phpcpd": "6.0.3",
"squizlabs/php_codesniffer": "3.6.0"
"squizlabs/php_codesniffer": "3.6.2"
},
"autoload": {
"psr-0": {
Expand Down
32 changes: 23 additions & 9 deletions src/VuFindHttp/HttpService.php
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ class HttpService implements HttpServiceInterface
*
* @var string
*/
const LOCAL_ADDRESS_RE = '@^(localhost|127(\.\d+){3}|\[::1\])@';
public const LOCAL_ADDRESS_RE = '@^(localhost|127(\.\d+){3}|\[::1\])@';

/**
* Proxy configuration.
Expand Down Expand Up @@ -88,8 +88,10 @@ class HttpService implements HttpServiceInterface
*
* @return void
*/
public function __construct(array $proxyConfig = [],
array $defaults = [], array $config = []
public function __construct(
array $proxyConfig = [],
array $defaults = [],
array $config = []
) {
$this->proxyConfig = $proxyConfig;
$this->defaults = $defaults;
Expand Down Expand Up @@ -186,7 +188,10 @@ public function proxify(\Laminas\Http\Client $client, array $options = [])
*
* @return \Laminas\Http\Response
*/
public function get($url, array $params = [], $timeout = null,
public function get(
$url,
array $params = [],
$timeout = null,
array $headers = []
) {
if ($params) {
Expand Down Expand Up @@ -216,8 +221,12 @@ public function get($url, array $params = [], $timeout = null,
*
* @return \Laminas\Http\Response
*/
public function post($url, $body = null, $type = 'application/octet-stream',
$timeout = null, array $headers = []
public function post(
$url,
$body = null,
$type = 'application/octet-stream',
$timeout = null,
array $headers = []
) {
$client = $this
->createClient($url, \Laminas\Http\Request::METHOD_POST, $timeout);
Expand All @@ -244,7 +253,10 @@ public function postForm($url, array $params = [], $timeout = null)
{
$body = $this->createQueryString($params);
return $this->post(
$url, $body, \Laminas\Http\Client::ENC_URLENCODED, $timeout
$url,
$body,
\Laminas\Http\Client::ENC_URLENCODED,
$timeout
);
}

Expand All @@ -270,8 +282,10 @@ public function setDefaultAdapter(
*
* @return \Laminas\Http\Client
*/
public function createClient($url = null,
$method = \Laminas\Http\Request::METHOD_GET, $timeout = null
public function createClient(
$url = null,
$method = \Laminas\Http\Request::METHOD_GET,
$timeout = null
) {
$client = new \Laminas\Http\Client();
$client->setMethod($method);
Expand Down
19 changes: 14 additions & 5 deletions src/VuFindHttp/HttpServiceInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,10 @@ public function proxify(\Laminas\Http\Client $client, array $options = []);
*
* @return \Laminas\Http\Response
*/
public function get($url, array $params = [], $timeout = null,
public function get(
$url,
array $params = [],
$timeout = null,
array $headers = []
);

Expand All @@ -76,8 +79,12 @@ public function get($url, array $params = [], $timeout = null,
*
* @return \Laminas\Http\Response
*/
public function post($url, $body = null, $type = 'application/octet-stream',
$timeout = null, array $headers = []
public function post(
$url,
$body = null,
$type = 'application/octet-stream',
$timeout = null,
array $headers = []
);

/**
Expand All @@ -100,7 +107,9 @@ public function postForm($url, array $params = [], $timeout = null);
*
* @return \Laminas\Http\Client
*/
public function createClient($url = null,
$method = \Laminas\Http\Request::METHOD_GET, $timeout = null
public function createClient(
$url = null,
$method = \Laminas\Http\Request::METHOD_GET,
$timeout = null
);
}

0 comments on commit a9281a5

Please sign in to comment.