Skip to content

Commit

Permalink
Working on phpstan level 2
Browse files Browse the repository at this point in the history
  • Loading branch information
danepowell committed Jun 7, 2023
1 parent 1764456 commit 22290af
Show file tree
Hide file tree
Showing 8 changed files with 78 additions and 19 deletions.
1 change: 1 addition & 0 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@
"dealerdirect/phpcodesniffer-composer-installer": "^1.0.0",
"dominikb/composer-license-checker": "^2.4",
"infection/infection": "^0.26.15",
"jangregor/phpstan-prophecy": "^1.0",
"mikey179/vfsstream": "^1.6",
"overtrue/phplint": "^9.0",
"phpro/grumphp": "^1.13.0",
Expand Down
67 changes: 66 additions & 1 deletion composer.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

9 changes: 0 additions & 9 deletions src/ClientServiceInterface.php

This file was deleted.

3 changes: 1 addition & 2 deletions src/CloudApi/ClientService.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@

use Acquia\Cli\ApiCredentialsInterface;
use Acquia\Cli\Application;
use Acquia\Cli\ClientServiceInterface;
use Acquia\Cli\ConnectorFactoryInterface;
use AcquiaCloudApi\Connector\Client;
use AcquiaCloudApi\Connector\ConnectorInterface;
Expand All @@ -18,7 +17,7 @@
* client queries. Consumers could otherwise just call
* Client::factory($connector) directly.
*/
class ClientService implements ClientServiceInterface {
class ClientService {

protected ConnectorInterface $connector;
protected ConnectorFactoryInterface|ConnectorFactory $connectorFactory;
Expand Down
3 changes: 1 addition & 2 deletions src/Command/Api/ApiCommandHelper.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@

namespace Acquia\Cli\Command\Api;

use Acquia\Cli\Command\CommandBase;
use Acquia\Cli\CommandFactoryInterface;
use Acquia\Cli\Exception\AcquiaCliException;
use Symfony\Component\Cache\Adapter\NullAdapter;
Expand Down Expand Up @@ -64,7 +63,7 @@ private function addOptionExampleToUsageForGetEndpoint(array $paramDefinition, s
* @param array $schema
* @param array $acquiaCloudSpec
*/
private function addApiCommandParameters(array $schema, array $acquiaCloudSpec, CommandBase $command): void {
private function addApiCommandParameters(array $schema, array $acquiaCloudSpec, ApiBaseCommand $command): void {
$inputDefinition = [];
$usage = '';

Expand Down
8 changes: 4 additions & 4 deletions src/Command/CommandBase.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
namespace Acquia\Cli\Command;

use Acquia\Cli\ApiCredentialsInterface;
use Acquia\Cli\ClientServiceInterface;
use Acquia\Cli\CloudApi\ClientService;
use Acquia\Cli\Command\Ssh\SshKeyCommandBase;
use Acquia\Cli\DataStore\AcquiaCliDatastore;
use Acquia\Cli\DataStore\CloudDataStore;
Expand Down Expand Up @@ -97,7 +97,7 @@ public function __construct(
protected ApiCredentialsInterface $cloudCredentials,
protected TelemetryHelper $telemetryHelper,
protected string $projectDir,
protected ClientServiceInterface $cloudApiClientService,
protected ClientService $cloudApiClientService,
protected LogstreamManager $logstreamManager,
public SshHelper $sshHelper,
protected string $sshDir,
Expand Down Expand Up @@ -1030,9 +1030,9 @@ private function convertUserAliasToUuid(InputInterface $input, string $userUuidA
}

/**
* @param String $userAlias
* @param string $userUuidArgument
* User alias like uuid or email.
* @param String $orgUuidArgument
* @param string $orgUuidArgument
* Organization uuid.
* @return string
* User uuid from alias
Expand Down
5 changes: 5 additions & 0 deletions src/ConnectorFactoryInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,11 @@

namespace Acquia\Cli;

use Acquia\Cli\CloudApi\AccessTokenConnector;
use AcquiaCloudApi\Connector\Connector;

interface ConnectorFactoryInterface {

public function createConnector(): Connector|AccessTokenConnector;

}
1 change: 0 additions & 1 deletion tests/phpunit/src/Commands/WizardTestBase.php
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,6 @@ protected function runTestCreate(): void {
$sshHelper = $this->mockPollCloudViaSsh($environmentsResponse);
$this->command->sshHelper = $sshHelper->reveal();

/** @var Filesystem|ObjectProphecy $fileSystem */
$fileSystem = $this->prophet->prophesize(Filesystem::class);
$this->mockGenerateSshKey($localMachineHelper, $request['public_key']);
$localMachineHelper->getLocalFilepath($this->passphraseFilepath)->willReturn($this->passphraseFilepath);
Expand Down

0 comments on commit 22290af

Please sign in to comment.