Skip to content

Commit

Permalink
upgrade requirements
Browse files Browse the repository at this point in the history
  • Loading branch information
ins0 committed Apr 25, 2024
1 parent 035a264 commit 855683d
Show file tree
Hide file tree
Showing 8 changed files with 27 additions and 23 deletions.
4 changes: 1 addition & 3 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,5 @@ jobs:
run: php -v
- name: Install Dependencies
run: composer install -q --no-ansi --no-interaction --no-scripts --no-suggest --no-progress --prefer-dist
- name: Downloading
run: wget https://github.com/vimeo/psalm/releases/download/5.9.0/psalm.phar
- name: Typechecking
run: php psalm.phar
run: php ./vendor/bin/psalm
9 changes: 5 additions & 4 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,16 +6,17 @@
"description": "A PHP client library for 'Vault by HashiCorp'",
"require": {
"ext-json": "*",
"guzzlehttp/psr7": "^2.4.4",
"php": "^7.0 || ^8.0",
"php-http/httplug": ">=1.1.0"
"guzzlehttp/psr7": "2.6.2",
"php": "^7.2.5 || ^8.0",
"php-http/httplug": "2.4.0"
},
"suggest": {
"php-http/curl-client": "CURL Client Adapter",
"tuupola/http-factory": "HTTP Factory"
},
"require-dev": {
"phpunit/phpunit": ">=5.0.0"
"phpunit/phpunit": "9.6.19",
"vimeo/psalm": "5.23.1"
},
"authors": [
{
Expand Down
8 changes: 2 additions & 6 deletions phpunit.xml.dist
Original file line number Diff line number Diff line change
@@ -1,13 +1,9 @@
<?xml version="1.0" encoding="utf-8"?>
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" bootstrap="./tests/bootstrap.php" xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/11.1/phpunit.xsd" cacheDirectory=".phpunit.cache">
<phpunit bootstrap="./tests/bootstrap.php" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="vendor/phpunit/phpunit/phpunit.xsd">
<testsuites>
<testsuite name="The project's test suite">
<directory>./tests</directory>
</testsuite>
</testsuites>
<source>
<include>
<directory suffix=".php">./src/</directory>
</include>
</source>
</phpunit>
6 changes: 3 additions & 3 deletions src/VaultPHP/Authentication/Provider/AppRole.php
Original file line number Diff line number Diff line change
Expand Up @@ -28,10 +28,10 @@ class AppRole extends AbstractAuthenticationProvider

/**
* AppRole constructor.
* @param $roleId
* @param $secretId
* @param string $roleId
* @param string $secretId
*/
public function __construct($roleId, $secretId)
public function __construct(string $roleId, string $secretId)
{
$this->roleId = $roleId;
$this->secretId= $secretId;
Expand Down
3 changes: 2 additions & 1 deletion src/VaultPHP/Response/BulkEndpointResponse.php
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,8 @@ public function hasErrors() {
/**
* @return array
*/
public function getBatchResults() {
public function getBatchResults(): array
{
return $this->batch_results;
}

Expand Down
3 changes: 2 additions & 1 deletion src/VaultPHP/Response/EndpointResponse.php
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,8 @@ final public function __construct($data = [], $meta = [])
* @param $response
* @return array
*/
protected static function getResponseContent(ResponseInterface $response) {
protected static function getResponseContent(ResponseInterface $response): array
{
$responseBody = $response->getBody();
$responseBody->rewind();
$responseBodyContents = $responseBody->getContents();
Expand Down
9 changes: 8 additions & 1 deletion src/VaultPHP/SecretEngines/Engines/Transit/Transit.php
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,15 @@
*/
final class Transit extends AbstractSecretEngine
{
private string $APIPath = 'transit';
/**
* @var string
*/
private $APIPath = 'transit';

/**
* @param string $path
* @return void
*/
public function setAPIPath(string $path)
{
$this->APIPath = $path;
Expand Down
8 changes: 4 additions & 4 deletions src/VaultPHP/VaultClient.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
namespace VaultPHP;

use GuzzleHttp\Psr7\Request;
use Http\Client\HttpClient;
use Psr\Http\Client\ClientInterface;
use Psr\Http\Message\RequestInterface;
use Psr\Http\Message\ResponseInterface;
use VaultPHP\Authentication\AuthenticationMetaData;
Expand All @@ -27,7 +27,7 @@ class VaultClient
/** @var string */
private $apiHost;

/** @var HttpClient */
/** @var ClientInterface */
private $httpClient;

/** @var AuthenticationProviderInterface */
Expand All @@ -38,12 +38,12 @@ class VaultClient

/**
* VaultClient constructor.
* @param HttpClient $httpClient
* @param ClientInterface $httpClient
* @param AuthenticationProviderInterface $authProvider
* @param string $apiHost
*/
public function __construct(
HttpClient $httpClient,
ClientInterface $httpClient,
AuthenticationProviderInterface $authProvider,
$apiHost
)
Expand Down

0 comments on commit 855683d

Please sign in to comment.