Skip to content

Commit

Permalink
Merge pull request aws#543 from hacfi/phpdoc
Browse files Browse the repository at this point in the history
Fix inconsist @var PhpDoc & use statements
  • Loading branch information
jeremeamia committed Apr 21, 2015
2 parents 705c37e + 548f3b0 commit 390e792
Show file tree
Hide file tree
Showing 21 changed files with 31 additions and 34 deletions.
2 changes: 1 addition & 1 deletion src/Aws/Common/Client/AbstractClient.php
Original file line number Diff line number Diff line change
Expand Up @@ -189,7 +189,7 @@ public function setRegion($region)
// Update the signature if necessary
$signature = $this->getSignature();
if ($signature instanceof EndpointSignatureInterface) {
/** @var $signature EndpointSignatureInterface */
/** @var EndpointSignatureInterface $signature */
$signature->setRegionName($region);
}

Expand Down
2 changes: 1 addition & 1 deletion src/Aws/Common/Client/ClientBuilder.php
Original file line number Diff line number Diff line change
Expand Up @@ -243,7 +243,7 @@ public function build()
$this->addBackoffLogger($backoff, $config);
}

/** @var $client AwsClientInterface */
/** @var AwsClientInterface $client */
$client = new $this->clientClass($credentials, $signature, $config);
$client->setDescription($description);

Expand Down
2 changes: 1 addition & 1 deletion src/Aws/Common/Client/ExpiredCredentialsChecker.php
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ protected function getDelay($retries, RequestInterface $request, Response $respo
return null;
}

/** @var $client AwsClientInterface */
/** @var AwsClientInterface $client */
$client = $request->getClient();
// Only retry if the credentials can be refreshed
if (!($client->getCredentials() instanceof AbstractRefreshableCredentials)) {
Expand Down
2 changes: 1 addition & 1 deletion src/Aws/Common/Client/UploadBodyListener.php
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ public static function getSubscribedEvents()
*/
public function onCommandBeforePrepare(Event $event)
{
/** @var $command Command */
/** @var Command $command */
$command = $event['command'];
if (in_array($command->getName(), $this->commands)) {
// Get the interesting parameters
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ protected function performTransfer(
$unhandledExceptions = new ExceptionCollection();

// Loop through caught exceptions and handle RequestTooLarge scenarios
/** @var $e DynamoDbException */
/** @var DynamoDbException $e */
foreach ($exceptions as $e) {
if ($e instanceof DynamoDbException) {
$request = $e->getRequest();
Expand Down Expand Up @@ -134,7 +134,7 @@ protected function prepareCommandsForBatchedItems(array $batch)
$items = array();
foreach ($chunk as $item) {
if ($item instanceof AbstractWriteRequest) {
/** @var $item AbstractWriteRequest */
/** @var AbstractWriteRequest $item */
$table = $item->getTableName();
if (!isset($items[$table])) {
$items[$table] = array();
Expand Down Expand Up @@ -164,7 +164,7 @@ protected function getUnprocessedRequestsFromCommands(
array $commands,
UnprocessedWriteRequestsException $unprocessedRequests
) {
/** @var $command CommandInterface */
/** @var CommandInterface $command */
foreach ($commands as $command) {
if ($command instanceof CommandInterface && $command->isExecuted()) {
$result = $command->getResult();
Expand Down
4 changes: 2 additions & 2 deletions src/Aws/Ec2/CopySnapshotListener.php
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ public static function getSubscribedEvents()

public function onCommandBeforePrepare(Event $event)
{
/** @var $command \Guzzle\Service\Command\CommandInterface */
/** @var CommandInterface $command */
$command = $event['command'];

if ($command->getName() !== 'CopySnapshot') {
Expand All @@ -46,7 +46,7 @@ public function onCommandBeforePrepare(Event $event)
return;
}

/** @var $client \Aws\Common\Client\AwsClientInterface */
/** @var AwsClientInterface $client */
$client = $command->getClient();
$presignedUrl = $this->createPresignedUrl($client, $command);
$command['DestinationRegion'] = $client->getRegion();
Expand Down
4 changes: 2 additions & 2 deletions src/Aws/Glacier/GlacierUploadListener.php
Original file line number Diff line number Diff line change
Expand Up @@ -44,11 +44,11 @@ public static function getSubscribedEvents()
*/
public function onCommandBeforeSend(Event $event)
{
/** @var $command AbstractCommand */
/** @var AbstractCommand $command */
$command = $event['command'];
$contentHash = $command->get('ContentSHA256');
if ($contentHash === true) {
/** @var $request EntityEnclosingRequest */
/** @var EntityEnclosingRequest $request */
$request = $command->getRequest();
$upload = UploadPartGenerator::createSingleUploadPart($request->getBody());
$request->addHeader('x-amz-content-sha256', $upload->getContentHash());
Expand Down
4 changes: 2 additions & 2 deletions src/Aws/Glacier/Model/MultipartUpload/AbstractTransfer.php
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ protected function getAbortCommand()
$params = $this->state->getUploadId()->toParams();
$params[Ua::OPTION] = Ua::MULTIPART_UPLOAD;

/** @var $command OperationCommand */
/** @var OperationCommand $command */
$command = $this->client->getCommand('AbortMultipartUpload', $params);

return $command;
Expand All @@ -83,7 +83,7 @@ protected function getAbortCommand()
protected function getCommandForPart(UploadPart $part, $useSourceCopy = false)
{
// Setup the command with identifying parameters (accountId, vaultName, and uploadId)
/** @var $command OperationCommand */
/** @var OperationCommand $command */
$command = $this->client->getCommand('UploadMultipartPart', $this->state->getUploadId()->toParams());
$command->set(Ua::OPTION, Ua::MULTIPART_UPLOAD);

Expand Down
6 changes: 3 additions & 3 deletions src/Aws/Glacier/Model/MultipartUpload/ParallelTransfer.php
Original file line number Diff line number Diff line change
Expand Up @@ -45,13 +45,13 @@ protected function init()
*/
protected function transfer()
{
/** @var $parts UploadPartGenerator */
/** @var UploadPartGenerator $parts */
$parts = $this->state->getPartGenerator();
$chunkSize = min($this->options['concurrency'], count($parts));
$partSets = new ChunkedIterator($parts, $chunkSize);

foreach ($partSets as $partSet) {
/** @var $part UploadPart */
/** @var UploadPart $part */
$commands = array();
foreach ($partSet as $index => $part) {
$command = $this->getCommandForPart($part, (bool) $index)->set('part', $part);
Expand All @@ -65,7 +65,7 @@ protected function transfer()
}

// Execute each command, iterate over the results, and add to the transfer state
/** @var $command \Guzzle\Service\Command\OperationCommand */
/** @var \Guzzle\Service\Command\OperationCommand $command */
foreach ($this->client->execute($commands) as $command) {
$this->state->addPart($command->get('part'));
$this->dispatch(self::AFTER_PART_UPLOAD, $this->getEventData($command));
Expand Down
4 changes: 2 additions & 2 deletions src/Aws/Glacier/Model/MultipartUpload/SerialTransfer.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,10 @@ class SerialTransfer extends AbstractTransfer
*/
protected function transfer()
{
/** @var $partGenerator UploadPartGenerator */
/** @var UploadPartGenerator $partGenerator */
$partGenerator = $this->state->getPartGenerator();

/** @var $part UploadPart */
/** @var UploadPart $part */
foreach ($partGenerator as $part) {
$command = $this->getCommandForPart($part);

Expand Down
4 changes: 1 addition & 3 deletions src/Aws/Glacier/Model/MultipartUpload/UploadBuilder.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,10 @@

namespace Aws\Glacier\Model\MultipartUpload;

use Aws\Common\Enum\Size;
use Aws\Common\Enum\UaString as Ua;
use Aws\Common\Exception\InvalidArgumentException;
use Aws\Common\Model\MultipartUpload\AbstractUploadBuilder;
use Aws\Common\Model\MultipartUpload\TransferStateInterface as State;
use Aws\Glacier\Model\MultipartUpload\UploadPartGenerator;

/**
* Easily create a multipart uploader used to quickly and reliably upload a
Expand Down Expand Up @@ -169,7 +167,7 @@ public function build()
if (!$this->partGenerator) {
throw new InvalidArgumentException('You must provide an UploadPartGenerator when resuming an upload.');
}
/** @var $state \Aws\Glacier\Model\MultipartUpload\TransferState */
/** @var TransferState $state */
$this->state = TransferState::fromUploadId($this->client, UploadId::fromParams(array(
'accountId' => $this->accountId,
'vaultName' => $this->vaultName,
Expand Down
2 changes: 1 addition & 1 deletion src/Aws/ImportExport/JobManifestListener.php
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ public static function getSubscribedEvents()
*/
public function onCommandBeforePrepare(Event $event)
{
/** @var $command \Guzzle\Service\Command\AbstractCommand */
/** @var \Guzzle\Service\Command\AbstractCommand $command */
$command = $event['command'];
if ($command->getName() === 'CreateJob') {
$manifest = $command->get('Manifest');
Expand Down
2 changes: 1 addition & 1 deletion src/Aws/MachineLearning/PredictEndpointListener.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ public static function getSubscribedEvents()
*/
public function onCommandBeforeSend(Event $event)
{
/** @var $command AbstractCommand */
/** @var AbstractCommand $command */
$command = $event['command'];
if ($command->getName() === 'Predict') {
$request = $command->getRequest();
Expand Down
2 changes: 1 addition & 1 deletion src/Aws/S3/AcpListener.php
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ public static function getSubscribedEvents()
*/
public function onCommandBeforePrepare(Event $event)
{
/** @var $command \Guzzle\Service\Command\AbstractCommand */
/** @var \Guzzle\Service\Command\AbstractCommand $command */
$command = $event['command'];
$operation = $command->getOperation();
if ($operation->hasParam('ACP') && $command->hasKey('ACP')) {
Expand Down
4 changes: 2 additions & 2 deletions src/Aws/S3/Model/Acp.php
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@ public function setGrants($grants = array())

if ($grants) {
if (is_array($grants) || $grants instanceof \Traversable) {
/** @var $grant Grant */
/** @var Grant $grant */
foreach ($grants as $grant) {
$this->addGrant($grant);
}
Expand Down Expand Up @@ -211,7 +211,7 @@ public function updateCommand(AbstractCommand $command)
{
$parameters = array();
foreach ($this->grants as $grant) {
/** @var $grant Grant */
/** @var Grant $grant */
$parameters = array_merge_recursive($parameters, $grant->getParameterArray());
}

Expand Down
4 changes: 2 additions & 2 deletions src/Aws/S3/Model/MultipartUpload/AbstractTransfer.php
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ protected function calculatePartSize()
*/
protected function complete()
{
/** @var $part UploadPart */
/** @var UploadPart $part */
$parts = array();
foreach ($this->state as $part) {
$parts[] = array(
Expand All @@ -95,7 +95,7 @@ protected function getAbortCommand()
$params = $this->state->getUploadId()->toParams();
$params[Ua::OPTION] = Ua::MULTIPART_UPLOAD;

/** @var $command OperationCommand */
/** @var OperationCommand $command */
$command = $this->client->getCommand('AbortMultipartUpload', $params);

return $command;
Expand Down
2 changes: 1 addition & 1 deletion src/Aws/S3/Model/MultipartUpload/ParallelTransfer.php
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ protected function transfer()
}

// Execute each command, iterate over the results, and add to the transfer state
/** @var $command \Guzzle\Service\Command\OperationCommand */
/** @var \Guzzle\Service\Command\OperationCommand $command */
foreach ($this->client->execute($commands) as $command) {
$this->state->addPart(UploadPart::fromArray(array(
'PartNumber' => count($this->state) + 1,
Expand Down
4 changes: 2 additions & 2 deletions src/Aws/S3/ResumableDownload.php
Original file line number Diff line number Diff line change
Expand Up @@ -34,13 +34,13 @@ class ResumableDownload
/** @var S3Client The S3 client to use to download objects and issue HEAD requests */
protected $client;

/** @var \Guzzle\Service\Resource\Model Model object returned when the initial HeadObject operation was called */
/** @var Model Model object returned when the initial HeadObject operation was called */
protected $meta;

/** @var array Array of parameters to pass to a GetObject operation */
protected $params;

/** @var \Guzzle\Http\EntityBody Where the object will be downloaded */
/** @var EntityBody Where the object will be downloaded */
protected $target;

/**
Expand Down
1 change: 0 additions & 1 deletion src/Aws/S3/Sync/AbstractSyncBuilder.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@

use Aws\Common\Exception\RuntimeException;
use Aws\Common\Exception\UnexpectedValueException;
use Aws\Common\Model\MultipartUpload\TransferInterface;
use Aws\S3\S3Client;
use Aws\S3\Iterator\OpendirIterator;
use Guzzle\Common\Event;
Expand Down
2 changes: 1 addition & 1 deletion src/Aws/S3/Sync/UploadSyncBuilder.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@

namespace Aws\S3\Sync;

use \FilesystemIterator as FI;
use FilesystemIterator as FI;
use Aws\Common\Model\MultipartUpload\AbstractTransfer;
use Aws\S3\Model\Acp;
use Guzzle\Common\HasDispatcherInterface;
Expand Down
2 changes: 1 addition & 1 deletion src/Aws/Sqs/QueueUrlListener.php
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ public static function getSubscribedEvents()
*/
public function onCommandBeforeSend(Event $event)
{
/** @var $command AbstractCommand */
/** @var AbstractCommand $command */
$command = $event['command'];
if ($command->hasKey('QueueUrl')) {
$request = $command->getRequest();
Expand Down

0 comments on commit 390e792

Please sign in to comment.