Skip to content

Commit

Permalink
Merge pull request #6 from xray-labs/rename-namespace
Browse files Browse the repository at this point in the history
Rename namespace
  • Loading branch information
sjspereira authored Jul 27, 2024
2 parents 410c3ce + c1bd757 commit 4ed4895
Show file tree
Hide file tree
Showing 129 changed files with 411 additions and 411 deletions.
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,16 +11,16 @@ Integrate with Azure's cloud storage services
## Installation

```bash
composer require sjpereira/azure-storage-php-sdk
composer require xray/azure-storage-php-sdk
```

## Usage

Setup Blob Storage

```php
use Sjpereira\AzureStoragePhpSdk\BlobStorage\{BlobStorage, Config};
use Sjpereira\AzureStoragePhpSdk\Http\Request;
use Xray\AzureStoragePhpSdk\BlobStorage\{BlobStorage, Config};
use Xray\AzureStoragePhpSdk\Http\Request;

$request = new Request(new Config([
'account' => 'your_account_name',
Expand Down
6 changes: 3 additions & 3 deletions composer.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"name": "sjpereira/azure-storage-php-sdk",
"name": "xray/azure-storage-php-sdk",
"description": "Integrate with Azure's cloud storage services",
"type": "library",
"license": "MIT",
Expand Down Expand Up @@ -37,8 +37,8 @@
],
"autoload": {
"psr-4": {
"Sjpereira\\AzureStoragePhpSdk\\": "src/",
"Sjpereira\\Tests\\": "tests/"
"Xray\\AzureStoragePhpSdk\\": "src/",
"Xray\\Tests\\": "tests/"
},
"files": [
"src/helpers.php"
Expand Down
6 changes: 3 additions & 3 deletions docs/StorageAccount.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
Getting the storage account information

```php
use Sjpereira\AzureStoragePhpSdk\BlobStorage\{BlobStorage, Config};
use Sjpereira\AzureStoragePhpSdk\Http\Request;
use Xray\AzureStoragePhpSdk\BlobStorage\{BlobStorage, Config};
use Xray\AzureStoragePhpSdk\Http\Request;

$request = new Request(new Config([
'account' => 'your_account_name',
Expand All @@ -14,5 +14,5 @@ $request = new Request(new Config([
$blobStorage = new BlobStorage($request);

$blobStorage->account()->information();
// returns Sjpereira\AzureStoragePhpSdk\BlobStorage\Entities\Account\AccountInformation;
// returns Xray\AzureStoragePhpSdk\BlobStorage\Entities\Account\AccountInformation;
```
12 changes: 6 additions & 6 deletions src/Authentication/MicrosoftEntraId.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,15 @@

declare(strict_types=1);

namespace Sjpereira\AzureStoragePhpSdk\Authentication;
namespace Xray\AzureStoragePhpSdk\Authentication;

use DateTime;
use GuzzleHttp\Client;
use Psr\Http\Client\RequestExceptionInterface;
use Sjpereira\AzureStoragePhpSdk\BlobStorage\Enums\HttpVerb;
use Sjpereira\AzureStoragePhpSdk\Contracts\Authentication\Auth;
use Sjpereira\AzureStoragePhpSdk\Exceptions\RequestException;
use Sjpereira\AzureStoragePhpSdk\Http\{Headers};
use Xray\AzureStoragePhpSdk\BlobStorage\Enums\HttpVerb;
use Xray\AzureStoragePhpSdk\Contracts\Authentication\Auth;
use Xray\AzureStoragePhpSdk\Exceptions\RequestException;
use Xray\AzureStoragePhpSdk\Http\Headers;

final class MicrosoftEntraId implements Auth
{
Expand Down Expand Up @@ -66,7 +66,7 @@ protected function authenticate(): void
throw RequestException::createFromRequestException($e);
}

/** @var array{token_type: string, expires_in: int, access_token: string} */
/** @var array{token_type: string, expires_in: int, access_token: string} $body */
$body = json_decode((string) $response->getBody(), true);

$this->token = "{$body['token_type']} {$body['access_token']}";
Expand Down
8 changes: 4 additions & 4 deletions src/Authentication/SharedKeyAuth.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@

declare(strict_types=1);

namespace Sjpereira\AzureStoragePhpSdk\Authentication;
namespace Xray\AzureStoragePhpSdk\Authentication;

use Sjpereira\AzureStoragePhpSdk\BlobStorage\Enums\HttpVerb;
use Sjpereira\AzureStoragePhpSdk\Contracts\Authentication\Auth;
use Sjpereira\AzureStoragePhpSdk\Http\Headers;
use Xray\AzureStoragePhpSdk\BlobStorage\Enums\HttpVerb;
use Xray\AzureStoragePhpSdk\Contracts\Authentication\Auth;
use Xray\AzureStoragePhpSdk\Http\Headers;

final class SharedKeyAuth implements Auth
{
Expand Down
8 changes: 4 additions & 4 deletions src/BlobStorage/BlobStorage.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@

declare(strict_types=1);

namespace Sjpereira\AzureStoragePhpSdk\BlobStorage;
namespace Xray\AzureStoragePhpSdk\BlobStorage;

use Sjpereira\AzureStoragePhpSdk\BlobStorage\Managers\Blob\BlobManager;
use Sjpereira\AzureStoragePhpSdk\BlobStorage\Managers\{AccountManager, ContainerManager};
use Sjpereira\AzureStoragePhpSdk\Contracts\Http\Request as RequestContract;
use Xray\AzureStoragePhpSdk\BlobStorage\Managers\Blob\BlobManager;
use Xray\AzureStoragePhpSdk\BlobStorage\Managers\{AccountManager, ContainerManager};
use Xray\AzureStoragePhpSdk\Contracts\Http\Request as RequestContract;

final class BlobStorage
{
Expand Down
4 changes: 2 additions & 2 deletions src/BlobStorage/Concerns/ValidateContainerName.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@

declare(strict_types=1);

namespace Sjpereira\AzureStoragePhpSdk\BlobStorage\Concerns;
namespace Xray\AzureStoragePhpSdk\BlobStorage\Concerns;

use Sjpereira\AzureStoragePhpSdk\Exceptions\InvalidArgumentException;
use Xray\AzureStoragePhpSdk\Exceptions\InvalidArgumentException;

trait ValidateContainerName
{
Expand Down
4 changes: 2 additions & 2 deletions src/BlobStorage/Concerns/ValidateMetadataKey.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@

declare(strict_types=1);

namespace Sjpereira\AzureStoragePhpSdk\BlobStorage\Concerns;
namespace Xray\AzureStoragePhpSdk\BlobStorage\Concerns;

use Sjpereira\AzureStoragePhpSdk\Exceptions\InvalidArgumentException;
use Xray\AzureStoragePhpSdk\Exceptions\InvalidArgumentException;

trait ValidateMetadataKey
{
Expand Down
12 changes: 6 additions & 6 deletions src/BlobStorage/Config.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,13 @@

declare(strict_types=1);

namespace Sjpereira\AzureStoragePhpSdk\BlobStorage;
namespace Xray\AzureStoragePhpSdk\BlobStorage;

use Sjpereira\AzureStoragePhpSdk\Contracts\Authentication\Auth;
use Sjpereira\AzureStoragePhpSdk\Contracts\{Converter, Parser};
use Sjpereira\AzureStoragePhpSdk\Converter\XmlConverter;
use Sjpereira\AzureStoragePhpSdk\Exceptions\InvalidArgumentException;
use Sjpereira\AzureStoragePhpSdk\Parsers\XmlParser;
use Xray\AzureStoragePhpSdk\Contracts\Authentication\Auth;
use Xray\AzureStoragePhpSdk\Contracts\{Converter, Parser};
use Xray\AzureStoragePhpSdk\Converter\XmlConverter;
use Xray\AzureStoragePhpSdk\Exceptions\InvalidArgumentException;
use Xray\AzureStoragePhpSdk\Parsers\XmlParser;

/**
* @phpstan-type ConfigType array{version?: string, parser?: Parser, converter?: Converter}
Expand Down
2 changes: 1 addition & 1 deletion src/BlobStorage/Entities/Account/AccountInformation.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

declare(strict_types=1);

namespace Sjpereira\AzureStoragePhpSdk\BlobStorage\Entities\Account;
namespace Xray\AzureStoragePhpSdk\BlobStorage\Entities\Account;

use DateTimeImmutable;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@

declare(strict_types=1);

namespace Sjpereira\AzureStoragePhpSdk\BlobStorage\Entities\Account\BlobStorageProperty;
namespace Xray\AzureStoragePhpSdk\BlobStorage\Entities\Account\BlobStorageProperty;

use Sjpereira\AzureStoragePhpSdk\BlobStorage\Entities\Account\BlobStorageProperty\Cors\Cors;
use Sjpereira\AzureStoragePhpSdk\Contracts\{Arrayable, Xmlable};
use Sjpereira\AzureStoragePhpSdk\Converter\XmlConverter;
use Xray\AzureStoragePhpSdk\BlobStorage\Entities\Account\BlobStorageProperty\Cors\Cors;
use Xray\AzureStoragePhpSdk\Contracts\{Arrayable, Xmlable};
use Xray\AzureStoragePhpSdk\Converter\XmlConverter;

/**
* @phpstan-import-type LoggingType from Logging
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@

declare(strict_types=1);

namespace Sjpereira\AzureStoragePhpSdk\BlobStorage\Entities\Account\BlobStorageProperty\Cors;
namespace Xray\AzureStoragePhpSdk\BlobStorage\Entities\Account\BlobStorageProperty\Cors;

use Sjpereira\AzureStoragePhpSdk\Contracts\Arrayable;
use Sjpereira\AzureStoragePhpSdk\Support\Collection;
use Xray\AzureStoragePhpSdk\Contracts\Arrayable;
use Xray\AzureStoragePhpSdk\Support\Collection;

/**
* @phpstan-import-type CorsRuleType from CorsRule
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@

declare(strict_types=1);

namespace Sjpereira\AzureStoragePhpSdk\BlobStorage\Entities\Account\BlobStorageProperty\Cors;
namespace Xray\AzureStoragePhpSdk\BlobStorage\Entities\Account\BlobStorageProperty\Cors;

use Sjpereira\AzureStoragePhpSdk\Contracts\Arrayable;
use Xray\AzureStoragePhpSdk\Contracts\Arrayable;

/**
* @phpstan-type CorsRuleType array{AllowedOrigins?: string, AllowedMethods?: string, MaxAgeInSeconds?: int, ExposedHeaders?: string, AllowedHeaders?: string}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@

declare(strict_types=1);

namespace Sjpereira\AzureStoragePhpSdk\BlobStorage\Entities\Account\BlobStorageProperty;
namespace Xray\AzureStoragePhpSdk\BlobStorage\Entities\Account\BlobStorageProperty;

use Sjpereira\AzureStoragePhpSdk\Contracts\Arrayable;
use Xray\AzureStoragePhpSdk\Contracts\Arrayable;

/**
* @phpstan-type DeleteRetentionPolicyType array{Enabled?: bool, AllowPermanentDelete?: bool, Days?: int}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@

declare(strict_types=1);

namespace Sjpereira\AzureStoragePhpSdk\BlobStorage\Entities\Account\BlobStorageProperty;
namespace Xray\AzureStoragePhpSdk\BlobStorage\Entities\Account\BlobStorageProperty;

use Sjpereira\AzureStoragePhpSdk\Contracts\Arrayable;
use Xray\AzureStoragePhpSdk\Contracts\Arrayable;

/**
* @phpstan-type RetentionPolicyType array{Days?: int, Enabled: bool}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@

declare(strict_types=1);

namespace Sjpereira\AzureStoragePhpSdk\BlobStorage\Entities\Account\BlobStorageProperty;
namespace Xray\AzureStoragePhpSdk\BlobStorage\Entities\Account\BlobStorageProperty;

use Sjpereira\AzureStoragePhpSdk\Contracts\Arrayable;
use Xray\AzureStoragePhpSdk\Contracts\Arrayable;

/**
* @phpstan-type RetentionPolicyType array{Days?: int, Enabled: bool}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@

declare(strict_types=1);

namespace Sjpereira\AzureStoragePhpSdk\BlobStorage\Entities\Account\BlobStorageProperty;
namespace Xray\AzureStoragePhpSdk\BlobStorage\Entities\Account\BlobStorageProperty;

use Sjpereira\AzureStoragePhpSdk\Contracts\Arrayable;
use Xray\AzureStoragePhpSdk\Contracts\Arrayable;

/**
* @phpstan-type RetentionPolicyType array{Days?: int, Enabled: bool}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@

declare(strict_types=1);

namespace Sjpereira\AzureStoragePhpSdk\BlobStorage\Entities\Account\BlobStorageProperty;
namespace Xray\AzureStoragePhpSdk\BlobStorage\Entities\Account\BlobStorageProperty;

use Sjpereira\AzureStoragePhpSdk\Contracts\Arrayable;
use Xray\AzureStoragePhpSdk\Contracts\Arrayable;

/**
* @phpstan-type StaticWebsiteType array{Enabled?: bool, IndexDocument?: string, DefaultIndexDocumentPath?: string, ErrorDocument404Path?: string}
Expand Down
2 changes: 1 addition & 1 deletion src/BlobStorage/Entities/Account/GeoReplication.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

declare(strict_types=1);

namespace Sjpereira\AzureStoragePhpSdk\BlobStorage\Entities\Account;
namespace Xray\AzureStoragePhpSdk\BlobStorage\Entities\Account;

use DateTimeImmutable;

Expand Down
8 changes: 4 additions & 4 deletions src/BlobStorage/Entities/Account/KeyInfo.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@

declare(strict_types=1);

namespace Sjpereira\AzureStoragePhpSdk\BlobStorage\Entities\Account;
namespace Xray\AzureStoragePhpSdk\BlobStorage\Entities\Account;

use DateTimeImmutable;
use Sjpereira\AzureStoragePhpSdk\Contracts\{Arrayable, Xmlable};
use Sjpereira\AzureStoragePhpSdk\Converter\XmlConverter;
use Sjpereira\AzureStoragePhpSdk\Exceptions\RequiredFieldException;
use Xray\AzureStoragePhpSdk\Contracts\{Arrayable, Xmlable};
use Xray\AzureStoragePhpSdk\Converter\XmlConverter;
use Xray\AzureStoragePhpSdk\Exceptions\RequiredFieldException;

/** @implements Arrayable<array{KeyInfo: array{Start: string, Expiry: string}}> */
final readonly class KeyInfo implements Arrayable, Xmlable
Expand Down
2 changes: 1 addition & 1 deletion src/BlobStorage/Entities/Account/UserDelegationKey.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

declare(strict_types=1);

namespace Sjpereira\AzureStoragePhpSdk\BlobStorage\Entities\Account;
namespace Xray\AzureStoragePhpSdk\BlobStorage\Entities\Account;

use DateTimeImmutable;

Expand Down
10 changes: 5 additions & 5 deletions src/BlobStorage/Entities/Blob/Blob.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,14 @@

declare(strict_types=1);

namespace Sjpereira\AzureStoragePhpSdk\BlobStorage\Entities\Blob;
namespace Xray\AzureStoragePhpSdk\BlobStorage\Entities\Blob;

use DateTime;
use DateTimeImmutable;
use Sjpereira\AzureStoragePhpSdk\BlobStorage\Enums\ExpirationOption;
use Sjpereira\AzureStoragePhpSdk\BlobStorage\Managers\Blob\{BlobLeaseManager, BlobManager, BlobTagManager};
use Sjpereira\AzureStoragePhpSdk\Concerns\HasManager;
use Sjpereira\AzureStoragePhpSdk\Exceptions\RequiredFieldException;
use Xray\AzureStoragePhpSdk\BlobStorage\Enums\ExpirationOption;
use Xray\AzureStoragePhpSdk\BlobStorage\Managers\Blob\{BlobLeaseManager, BlobManager, BlobTagManager};
use Xray\AzureStoragePhpSdk\Concerns\HasManager;
use Xray\AzureStoragePhpSdk\Exceptions\RequiredFieldException;

/**
* @phpstan-import-type PropertiesType from Properties
Expand Down
10 changes: 5 additions & 5 deletions src/BlobStorage/Entities/Blob/BlobLease.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,13 @@

declare(strict_types=1);

namespace Sjpereira\AzureStoragePhpSdk\BlobStorage\Entities\Blob;
namespace Xray\AzureStoragePhpSdk\BlobStorage\Entities\Blob;

use DateTimeImmutable;
use Sjpereira\AzureStoragePhpSdk\BlobStorage\Managers\Blob\BlobLeaseManager;
use Sjpereira\AzureStoragePhpSdk\BlobStorage\Resource;
use Sjpereira\AzureStoragePhpSdk\Concerns\HasManager;
use Sjpereira\AzureStoragePhpSdk\Exceptions\RequiredFieldException;
use Xray\AzureStoragePhpSdk\BlobStorage\Managers\Blob\BlobLeaseManager;
use Xray\AzureStoragePhpSdk\BlobStorage\Resource;
use Xray\AzureStoragePhpSdk\Concerns\HasManager;
use Xray\AzureStoragePhpSdk\Exceptions\RequiredFieldException;

/**
* @phpstan-type BlobLeaseType array{'Last-Modified'?: string, ETag?: string, Server?: string, Date?: string, 'x-ms-request-id'?: string, 'x-ms-version'?: string, 'x-ms-lease-id'?: string}
Expand Down
6 changes: 3 additions & 3 deletions src/BlobStorage/Entities/Blob/BlobMetadata.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@

declare(strict_types=1);

namespace Sjpereira\AzureStoragePhpSdk\BlobStorage\Entities\Blob;
namespace Xray\AzureStoragePhpSdk\BlobStorage\Entities\Blob;

use DateTimeImmutable;
use Sjpereira\AzureStoragePhpSdk\BlobStorage\Concerns\ValidateMetadataKey;
use Sjpereira\AzureStoragePhpSdk\BlobStorage\Resource;
use Xray\AzureStoragePhpSdk\BlobStorage\Concerns\ValidateMetadataKey;
use Xray\AzureStoragePhpSdk\BlobStorage\Resource;

/**
* @phpstan-type BlobMetadataHeaders array{Content-Length?: string, Last-Modified?: string, ETag?: string, Vary?: string, Server?: string, x-ms-request-id?: string, x-ms-version?: string, Date?: string}
Expand Down
4 changes: 2 additions & 2 deletions src/BlobStorage/Entities/Blob/BlobProperty.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@

declare(strict_types=1);

namespace Sjpereira\AzureStoragePhpSdk\BlobStorage\Entities\Blob;
namespace Xray\AzureStoragePhpSdk\BlobStorage\Entities\Blob;

use DateTimeImmutable;
use Sjpereira\AzureStoragePhpSdk\BlobStorage\Resource;
use Xray\AzureStoragePhpSdk\BlobStorage\Resource;

/**
* @phpstan-type BlobPropertyHeaders array{Last-Modified?: string, x-ms-creation-time?: string, x-ms-tag-count?: int, x-ms-blob-type?: string, x-ms-copy-completion-time?: string|null, x-ms-copy-status-description?: string|null, x-ms-copy-id?: string|null, x-ms-copy-progress?: string|null, x-ms-copy-source?: string|null, x-ms-copy-status?: string|null, x-ms-incremental-copy?: string|null, x-ms-copy-destination-snapshot?: string|null, x-ms-lease-duration?: string|null, x-ms-lease-state?: string|null, x-ms-lease-status?: string|null, Content-Length?: int, Content-Type?: string|null, ETag?: string, Content-MD5?: string|null, Content-Encoding?: string|null, Content-Language?: string|null, Content-Disposition?: string|null, Cache-Control?: string|null, x-ms-blob-sequence-number?: int, x-ms-request-id?: string|null, x-ms-version?: string|null, Date?: string, Accept-Ranges?: string|null, x-ms-blob-committed-block-count?: string|null, x-ms-server-encrypted?: bool, x-ms-encryption-key-sha256?: string|null, x-ms-encryption-context?: string|null, x-ms-encryption-scope?: string|null, x-ms-access-tier?: string|null, x-ms-access-tier-inferred?: string|null, x-ms-archive-status?: string|null, x-ms-access-tier-change-time?: string|null, x-ms-client-request-id?: string|null, x-ms-rehydrate-priority?: string|null, x-ms-or-policy-id?: string|null, x-ms-last-access-time?: string|null, x-ms-blob-sealed?: string|null, x-ms-immutability-policy-until-date?: string|null, x-ms-immutability-policy-mode?: string|null, x-ms-legal-hold?: string|null, x-ms-owner?: string|null, x-ms-group?: string|null, x-ms-permissions?: string|null, x-ms-acl?: string|null, x-ms-resource-type?: string|null, x-ms-expiry-time?: string|null, leaseId?: string|null, sequenceNumberAction?: string|null, Origin?: string|null}
Expand Down
8 changes: 4 additions & 4 deletions src/BlobStorage/Entities/Blob/BlobTag.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@

declare(strict_types=1);

namespace Sjpereira\AzureStoragePhpSdk\BlobStorage\Entities\Blob;
namespace Xray\AzureStoragePhpSdk\BlobStorage\Entities\Blob;

use DateTimeImmutable;
use Sjpereira\AzureStoragePhpSdk\Contracts\Xmlable;
use Sjpereira\AzureStoragePhpSdk\Converter\XmlConverter;
use Sjpereira\AzureStoragePhpSdk\Exceptions\InvalidArgumentException;
use Xray\AzureStoragePhpSdk\Contracts\Xmlable;
use Xray\AzureStoragePhpSdk\Converter\XmlConverter;
use Xray\AzureStoragePhpSdk\Exceptions\InvalidArgumentException;

/**
* @phpstan-type BlobTagHeaders array{Content-Length?: string, Content-Type?: string, Vary?: string, Server?: string, x-ms-request-id?: string, x-ms-version?: string, Date?: string}
Expand Down
Loading

0 comments on commit 4ed4895

Please sign in to comment.