Skip to content

Commit

Permalink
Resolve phpcsfixer warnings (#29)
Browse files Browse the repository at this point in the history
* Resolve phpcsfixer warnings from previous code changes

* Commit linting fixes automatically from GH workflow

* Commit linting fixes automatically from GH workflow

* Fix Rector issue

* Revert lint workflow changes
  • Loading branch information
Jeroenwv authored Sep 6, 2024
1 parent 4560651 commit eb6cd03
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/Apple/Components/Field.php
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ class Field extends Component
* Value of the field.
*/
#[Required]
public int|float|string|null $value;
public null|float|int|string $value;

/**
* Optional.
Expand Down
2 changes: 2 additions & 0 deletions src/Apple/PassFactory.php
Original file line number Diff line number Diff line change
Expand Up @@ -417,6 +417,7 @@ protected function sign(string $dir): void
protected function openssl_pkcs12_read_wrapper(string $pkcs12, string $passphrase): array
{
$certs = [];

// If the openssl_pkcs12_read function works ok, go with that
if (openssl_pkcs12_read($pkcs12, $certs, $passphrase)) {
return $certs;
Expand Down Expand Up @@ -448,6 +449,7 @@ protected function openssl_pkcs12_read_wrapper(string $pkcs12, string $passphras
if ($value) {
$certMatches = [];
$keyMatches = [];

// Search separately so that they can appear in either order
if (
preg_match('/-----BEGIN CERTIFICATE-----.*-----END CERTIFICATE-----/s', $value, $certMatches)
Expand Down
5 changes: 3 additions & 2 deletions src/Google/Http/GoogleAuthMiddleware.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
use Google\Auth\HttpHandler\HttpHandlerFactory;
use Google\Auth\Middleware\AuthTokenMiddleware;
use GuzzleHttp\Client;
use GuzzleHttp\ClientInterface;
use Psr\Cache\CacheItemPoolInterface;

class GoogleAuthMiddleware
Expand All @@ -28,7 +29,7 @@ class GoogleAuthMiddleware
*/
public static function getCache(): CacheItemPoolInterface
{
if (self::$cache === null) {
if (! self::$cache instanceof CacheItemPoolInterface) {
self::$cache = new MemoryCacheItemPool;
}

Expand Down Expand Up @@ -56,7 +57,7 @@ public static function createAuthTokenMiddleware(ServiceCredentials $credentials
self::getCache(),
);

if (($client = HttpClientCache::getHttpClient()) === null) {
if (! ($client = HttpClientCache::getHttpClient()) instanceof ClientInterface) {
$client = new Client([
'base_uri' => self::BASE_URI,
]);
Expand Down

0 comments on commit eb6cd03

Please sign in to comment.