Skip to content

Commit

Permalink
chore: update PHP dependencies (#550)
Browse files Browse the repository at this point in the history
  • Loading branch information
ItsANameToo authored Dec 11, 2023
1 parent 4f56f61 commit a8bd8d7
Show file tree
Hide file tree
Showing 36 changed files with 326 additions and 311 deletions.
2 changes: 1 addition & 1 deletion app/Console/Commands/DependsOnCoingeckoRateLimit.php
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ private function runsFetchPriceHistory(): bool
return $isAfter1245;
}

private function dispatchDelayed(Closure $callback, int $index, string $job, int $delayThreshold = null): void
private function dispatchDelayed(Closure $callback, int $index, string $job, ?int $delayThreshold = null): void
{
// Note: I cant use delay directly on the job because it throws
// the "too many attempts" error after some time so im delaying
Expand Down
2 changes: 1 addition & 1 deletion app/Console/Commands/InteractsWithCollections.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ trait InteractsWithCollections
* @param Closure(Collection, int):void $callback
* @param Closure(Builder<Collection>):Builder<Collection>|null $queryCallback
*/
public function forEachCollection(Closure $callback, Closure $queryCallback = null, int $limit = null): void
public function forEachCollection(Closure $callback, ?Closure $queryCallback = null, ?int $limit = null): void
{
// Apply `$queryCallback` to modify the query before fetching collections...

Expand Down
2 changes: 1 addition & 1 deletion app/Console/Commands/LiveDumpNfts.php
Original file line number Diff line number Diff line change
Expand Up @@ -216,7 +216,7 @@ private function getCollectionNftsAndPersist(
Chain $chain,
int $itemsTotal,
int $chunk,
string $cursor = null,
?string $cursor = null,
): void {
$perChunkLimit = 100;

Expand Down
2 changes: 1 addition & 1 deletion app/Console/Commands/MarketData/UpdateTokenDetails.php
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ public function handle(): void
}
}

private function updateAllTokenDetails(Wallet $wallet = null): void
private function updateAllTokenDetails(?Wallet $wallet = null): void
{
$top = $this->option('top');

Expand Down
4 changes: 2 additions & 2 deletions app/Contracts/MarketDataProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ public function getJobMiddleware(): array;
* @param int|null $sampleCount The max number of samples to return. If null, all samples will be returned.
* @return DataCollection<int, PriceHistoryData>
*/
public function getPriceHistory(Token $token, CurrencyCode $currency, Period $period, int $sampleCount = null): DataCollection;
public function getPriceHistory(Token $token, CurrencyCode $currency, Period $period, ?int $sampleCount = null): DataCollection;

/**
* IMPORTANT: When implementing this method, make sure to set the timestamp
Expand All @@ -61,5 +61,5 @@ public function getPriceHistory(Token $token, CurrencyCode $currency, Period $pe
* @param int|null $sampleCount The max number of samples to return. If null, all samples will be returned.
* @return Collection<string, DataCollection<int, PriceHistoryData>>
*/
public function getBatchPriceHistory(Collection $tokens, CurrencyCode $currency, Period $period, int $sampleCount = null): Collection;
public function getBatchPriceHistory(Collection $tokens, CurrencyCode $currency, Period $period, ?int $sampleCount = null): Collection;
}
2 changes: 1 addition & 1 deletion app/Data/Collections/CollectionDetailData.php
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ public function __construct(
) {
}

public static function fromModel(Collection $collection, CurrencyCode $currencyCode = null, User $user = null): self
public static function fromModel(Collection $collection, ?CurrencyCode $currencyCode = null, ?User $user = null): self
{
$symbol = $collection->floorPriceToken?->symbol;

Expand Down
2 changes: 1 addition & 1 deletion app/Data/Gallery/GalleryCollectionData.php
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ public function __construct(
) {
}

public static function fromModel(Collection $collection, CurrencyCode $currencyCode = null, User $user = null): self
public static function fromModel(Collection $collection, ?CurrencyCode $currencyCode = null, ?User $user = null): self
{
$symbol = $collection->floorPriceToken?->symbol;

Expand Down
2 changes: 1 addition & 1 deletion app/Data/Nfts/NftCollectionData.php
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ public function __construct(
) {
}

public static function fromModel(Collection $collection, CurrencyCode $currencyCode = null): self
public static function fromModel(Collection $collection, ?CurrencyCode $currencyCode = null): self
{
return new self(
name: $collection->name,
Expand Down
2 changes: 1 addition & 1 deletion app/Data/TokenListItemData.php
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ public function __construct(
* @param Collection<int, int> $chainIds
* @return PaginatedDataCollection<int, TokenListItemData>
*/
public static function paginated(User $user, int $perPage, int $currentPage = null, string $sortBy, string $sortDirection, Collection $chainIds): PaginatedDataCollection
public static function paginated(User $user, int $perPage, ?int $currentPage, string $sortBy, string $sortDirection, Collection $chainIds): PaginatedDataCollection
{
$sortBy = in_array($sortBy, self::$sortByOptions) ? $sortBy : 'fiat_balance';

Expand Down
10 changes: 5 additions & 5 deletions app/Http/Client/Alchemy/AlchemyPendingRequest.php
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ class AlchemyPendingRequest extends PendingRequest
*
* @return void
*/
public function __construct(Factory $factory = null)
public function __construct(?Factory $factory = null)
{
parent::__construct($factory);

Expand Down Expand Up @@ -185,7 +185,7 @@ public function getWalletTokens(Wallet $wallet, Network $network): Collection
/**
* @see https://docs.alchemy.com/reference/getnfts
*/
public function getWalletNfts(Wallet $wallet, Network $network, string $cursor = null, int $limit = null): Web3NftsChunk
public function getWalletNfts(Wallet $wallet, Network $network, ?string $cursor = null, ?int $limit = null): Web3NftsChunk
{
$this->apiUrl = $this->getNftV3ApiUrl();

Expand Down Expand Up @@ -259,8 +259,8 @@ public function nftMetadataBatch(Collection $nfts, Network $network): Web3NftsCh
*/
public function collectionNfts(
CollectionModel $collection,
string $startToken = null,
int $limit = null
?string $startToken = null,
?int $limit = null
): Web3NftsChunk {
$this->apiUrl = $this->getNftV3ApiUrl();

Expand Down Expand Up @@ -300,7 +300,7 @@ public function collectionNfts(
/**
* @return array<stdClass>|null
*/
public function collectionNftsRaw(CollectionModel $collection, string $startToken = null): ?array
public function collectionNftsRaw(CollectionModel $collection, ?string $startToken = null): ?array
{
$this->apiUrl = $this->getNftV3ApiUrl();

Expand Down
2 changes: 1 addition & 1 deletion app/Http/Client/MarketData/CoingeckoPendingRequest.php
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ class CoingeckoPendingRequest extends PendingRequest
*
* @return void
*/
public function __construct(Factory $factory = null)
public function __construct(?Factory $factory = null)
{
parent::__construct($factory);

Expand Down
4 changes: 2 additions & 2 deletions app/Http/Client/Mnemonic/MnemonicPendingRequest.php
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ class MnemonicPendingRequest extends PendingRequest
*
* @return void
*/
public function __construct(Factory $factory = null)
public function __construct(?Factory $factory = null)
{
parent::__construct($factory);

Expand Down Expand Up @@ -348,7 +348,7 @@ private function fetchCollectionTraits(Chain $chain, string $contractAddress, st
*
* @return Collection<int, CollectionActivity>
*/
public function getCollectionActivity(Chain $chain, string $contractAddress, int $limit, Carbon $from = null): Collection
public function getCollectionActivity(Chain $chain, string $contractAddress, int $limit, ?Carbon $from = null): Collection
{
$this->chain = MnemonicChain::fromChain($chain);

Expand Down
2 changes: 1 addition & 1 deletion app/Http/Client/Moralis/MoralisPendingRequest.php
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ class MoralisPendingRequest extends PendingRequest
*
* @return void
*/
public function __construct(Factory $factory = null)
public function __construct(?Factory $factory = null)
{
parent::__construct($factory);

Expand Down
2 changes: 1 addition & 1 deletion app/Http/Client/Opensea/OpenseaPendingRequest.php
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ class OpenseaPendingRequest extends PendingRequest
*
* @return void
*/
public function __construct(Factory $factory = null)
public function __construct(?Factory $factory = null)
{
parent::__construct($factory);

Expand Down
2 changes: 1 addition & 1 deletion app/Models/Gallery.php
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,7 @@ public function scopeMostValuable(Builder $query, CurrencyCode $currency): Build
/**
* @param null|array<int> $galleriesIds
*/
public static function updateValues(array $galleriesIds = null): void
public static function updateValues(?array $galleriesIds = null): void
{
$calculateValueQuery = get_query('gallery.calculate_value');

Expand Down
2 changes: 1 addition & 1 deletion app/Models/User.php
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ public function hiddenCollections(): BelongsToMany
return $this->belongsToMany(Collection::class, 'hidden_collections');
}

public function collectionsValue(CurrencyCode $currency, bool $readFromDatabase = true, bool $onlyHidden = null): ?float
public function collectionsValue(CurrencyCode $currency, bool $readFromDatabase = true, ?bool $onlyHidden = null): ?float
{
if (! $readFromDatabase) {
$query = get_query($onlyHidden ? 'users.calculate_collections_value_hidden' : 'users.calculate_collections_value_shown', [
Expand Down
4 changes: 2 additions & 2 deletions app/Services/MarketData/Providers/CoingeckoProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ public function getCurrencies(): array
*
* @return DataCollection<int, PriceHistoryData>
*/
public function getPriceHistory(Token $token, CurrencyCode $currency, Period $period, int $sampleCount = null): DataCollection
public function getPriceHistory(Token $token, CurrencyCode $currency, Period $period, ?int $sampleCount = null): DataCollection
{
$coingeckoId = $this->lookupCoingeckoTokenId($token);

Expand All @@ -136,7 +136,7 @@ public function getPriceHistory(Token $token, CurrencyCode $currency, Period $pe
* @param Collection<int, Token> $tokens
* @return Collection<string, DataCollection<int, PriceHistoryData>>
*/
public function getBatchPriceHistory(Collection $tokens, CurrencyCode $currency, Period $period, int $sampleCount = null): Collection
public function getBatchPriceHistory(Collection $tokens, CurrencyCode $currency, Period $period, ?int $sampleCount = null): Collection
{
$tokensWithCoingeckoIds = $this->getTokensWithCoingeckoId($tokens);

Expand Down
2 changes: 1 addition & 1 deletion app/Services/Traits/LoadsFromCache.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ trait LoadsFromCache
/**
* @param string|array<string> $uniqueKeyParts
*/
protected function fromCache(Closure $callback, array|string $uniqueKeyParts, int $ttl = null, bool $ignoreCache = false): mixed
protected function fromCache(Closure $callback, array|string $uniqueKeyParts, ?int $ttl = null, bool $ignoreCache = false): mixed
{
$methodName = $this->getMethodName();

Expand Down
6 changes: 3 additions & 3 deletions app/Services/Web3/Alchemy/AlchemyWeb3DataProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -31,15 +31,15 @@ public function getWalletTokens(Wallet $wallet, Network $network): Collection
return Alchemy::getWalletTokens($wallet, $network);
}

public function getWalletNfts(Wallet $wallet, Network $network, string $cursor = null, int $limit = null): Web3NftsChunk
public function getWalletNfts(Wallet $wallet, Network $network, ?string $cursor = null, ?int $limit = null): Web3NftsChunk
{
return Alchemy::getWalletNfts($wallet, $network, $cursor, $limit);
}

public function getCollectionsNfts(
CollectionModel $collection,
string $startToken = null,
int $limit = null
?string $startToken = null,
?int $limit = null
): Web3NftsChunk {
return Alchemy::collectionNfts($collection, $startToken, $limit);
}
Expand Down
2 changes: 1 addition & 1 deletion app/Services/Web3/Fake/FakeWeb3DataProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ public function getWalletTokens(Wallet $wallet, Network $network): Collection
});
}

public function getWalletNfts(Wallet $wallet, Network $network, string $cursor = null): Web3NftsChunk
public function getWalletNfts(Wallet $wallet, Network $network, ?string $cursor = null): Web3NftsChunk
{
$nfts = Nft::with('collection')
->whereHas('collection', static fn ($query) => $query->where('network_id', $network->id))
Expand Down
4 changes: 2 additions & 2 deletions app/Services/Web3/Mnemonic/MnemonicWeb3DataProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ public function getWalletTokens(Wallet $wallet, Network $network): Collection
throw new NotImplementedException();
}

public function getWalletNfts(Wallet $wallet, Network $network, string $cursor = null): Web3NftsChunk
public function getWalletNfts(Wallet $wallet, Network $network, ?string $cursor = null): Web3NftsChunk
{
throw new NotImplementedException();
}
Expand Down Expand Up @@ -60,7 +60,7 @@ public function getNftCollectionFloorPrice(Chain $chain, string $contractAddress
/**
* @return Collection<int, CollectionActivity>
*/
public function getCollectionActivity(Chain $chain, string $contractAddress, int $limit, Carbon $from = null): Collection
public function getCollectionActivity(Chain $chain, string $contractAddress, int $limit, ?Carbon $from = null): Collection
{
return Mnemonic::getCollectionActivity($chain, $contractAddress, $limit, $from);
}
Expand Down
2 changes: 1 addition & 1 deletion app/Services/Web3/Moralis/MoralisWeb3DataProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ public function getWalletTokens(Wallet $wallet, Network $network): Collection
return Moralis::getWalletTokens($wallet, $network);
}

public function getWalletNfts(Wallet $wallet, Network $network, string $cursor = null): Web3NftsChunk
public function getWalletNfts(Wallet $wallet, Network $network, ?string $cursor = null): Web3NftsChunk
{
return Moralis::getWalletNfts($wallet, $network, $cursor);
}
Expand Down
2 changes: 1 addition & 1 deletion app/Services/Web3/Opensea/OpenseaWeb3DataProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ public function getWalletTokens(Wallet $wallet, Network $network): Collection
throw new NotImplementedException();
}

public function getWalletNfts(Wallet $wallet, Network $network, string $cursor = null): Web3NftsChunk
public function getWalletNfts(Wallet $wallet, Network $network, ?string $cursor = null): Web3NftsChunk
{
throw new NotImplementedException();
}
Expand Down
2 changes: 1 addition & 1 deletion app/Support/Cache/GalleryCache.php
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ public function collections(CurrencyCode $currencyCode): DataCollection
);
}

public static function clearCollections(int $galleryId = null): void
public static function clearCollections(?int $galleryId = null): void
{
$tags = $galleryId ? [self::TAG_COLLECTIONS.'_'.$galleryId] : [self::TAG_COLLECTIONS];

Expand Down
10 changes: 5 additions & 5 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
"inertiajs/inertia-laravel": "^0.6",
"jeffgreco13/filament-breezy": "^2.2",
"kornrunner/keccak": "^1.1",
"laravel/framework": "^10.34",
"laravel/framework": "^10.35",
"laravel/horizon": "^5.21",
"laravel/pennant": "^1.5",
"laravel/sanctum": "^3.3",
Expand All @@ -33,7 +33,7 @@
"spatie/laravel-data": "^3.10",
"spatie/laravel-markdown": "^2.4",
"spatie/laravel-medialibrary": "^10.15",
"spatie/laravel-permission": "^5.1",
"spatie/laravel-permission": "^5.2",
"spatie/laravel-schemaless-attributes": "^2.4",
"spatie/laravel-sluggable": "^3.5",
"spatie/laravel-typescript-transformer": "^2.3",
Expand All @@ -44,13 +44,13 @@
"require-dev": {
"barryvdh/laravel-debugbar": "^3.9",
"fakerphp/faker": "^1.23",
"graham-campbell/analyzer": "^4.0",
"graham-campbell/analyzer": "^4.1",
"laravel/breeze": "^1.26",
"laravel/pint": "^1.13",
"laravel/sail": "^1.26",
"mockery/mockery": "^1.6",
"nunomaduro/larastan": "^2.6",
"pestphp/pest": "^2.26",
"nunomaduro/larastan": "^2.7",
"pestphp/pest": "^2.28",
"rector/rector": "^0.18",
"spatie/laravel-ignition": "^2.3"
},
Expand Down
Loading

0 comments on commit a8bd8d7

Please sign in to comment.