Skip to content

Commit

Permalink
Laravel pint.
Browse files Browse the repository at this point in the history
  • Loading branch information
v16Studios authored and leonardocustodio committed Jun 20, 2024
1 parent 1d3cad1 commit 253eea1
Show file tree
Hide file tree
Showing 55 changed files with 94 additions and 149 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;

return new class () extends Migration {
return new class() extends Migration
{
/**
* Run the migrations.
*/
Expand Down
3 changes: 2 additions & 1 deletion database/migrations/2022_10_12_115527_create_beams_table.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;

return new class () extends Migration {
return new class() extends Migration
{
/**
* Run the migrations.
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;

return new class () extends Migration {
return new class() extends Migration
{
/**
* Run the migrations.
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;

return new class () extends Migration {
return new class() extends Migration
{
/**
* Run the migrations.
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;

return new class () extends Migration {
return new class() extends Migration
{
/**
* Run the migrations.
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;

return new class () extends Migration {
return new class() extends Migration
{
/**
* Run the migrations.
*/
Expand Down
6 changes: 3 additions & 3 deletions src/BeamServiceProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -70,12 +70,12 @@ public function boot()
{
parent::boot();

$this->loadMigrationsFrom(__DIR__ . '/../database/migrations');
$this->loadRoutesFrom(__DIR__ . '/../routes/enjin-platform-beam.php');
$this->loadMigrationsFrom(__DIR__.'/../database/migrations');
$this->loadRoutesFrom(__DIR__.'/../routes/enjin-platform-beam.php');
}

public function packageRegistered()
{
$this->loadTranslationsFrom(__DIR__ . '/../lang', 'enjin-platform-beam');
$this->loadTranslationsFrom(__DIR__.'/../lang', 'enjin-platform-beam');
}
}
2 changes: 1 addition & 1 deletion src/Channels/PlatformBeamChannel.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,6 @@ class PlatformBeamChannel extends PlatformAppChannel
public function __construct()
{
parent::__construct();
$this->name = 'beam;' . $this->name;
$this->name = 'beam;'.$this->name;
}
}
6 changes: 3 additions & 3 deletions src/Commands/BatchProcess.php
Original file line number Diff line number Diff line change
Expand Up @@ -123,10 +123,10 @@ protected function process(): void
$this->info("Total batch completed: {$total}");

$transferedCount = $this->processBatch(BeamType::TRANSFER_TOKEN);
$this->info('Total transfers completed: ' . $transferedCount);
$this->info('Total transfers completed: '.$transferedCount);

$mintedCount = $this->processBatch(BeamType::MINT_ON_DEMAND);
$this->info('Total mints completed: ' . $mintedCount);
$this->info('Total mints completed: '.$mintedCount);
}

/**
Expand Down Expand Up @@ -164,7 +164,7 @@ protected function processBatch(BeamType $type): int
])->toEncodable(),
];
} else {
$key = $claim->token_chain_id . '|' . $claim->collection_id;
$key = $claim->token_chain_id.'|'.$claim->collection_id;
if (isset($createdTokens[$key])) {
// Succeeding claims should be minted. Reassigning claims to the next batch
$claim->update(['beam_batch_id' => $batchId = $this->batch->getNextBatchId($type, $collectionId)]);
Expand Down
2 changes: 1 addition & 1 deletion src/Enums/PlatformBeamCache.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ enum PlatformBeamCache: string implements PlatformCacheable
*/
public function key(?string $suffix = null): string
{
return 'enjin-platform:beam:' . $this->value . ($suffix ? ":{$suffix}" : '');
return 'enjin-platform:beam:'.$this->value.($suffix ? ":{$suffix}" : '');
}

/**
Expand Down
4 changes: 1 addition & 3 deletions src/Events/BeamClaimInProgress.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,4 @@

namespace Enjin\Platform\Beam\Events;

class BeamClaimInProgress extends BeamClaimPending
{
}
class BeamClaimInProgress extends BeamClaimPending {}
2 changes: 1 addition & 1 deletion src/Events/BeamClaimPending.php
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ public function __construct(array $claim)
);

$this->broadcastChannels = [
new Channel('collection;' . $claim['beam']['collection_chain_id']),
new Channel('collection;'.$claim['beam']['collection_chain_id']),
new PlatformAppChannel(),
new PlatformBeamChannel(),
];
Expand Down
4 changes: 1 addition & 3 deletions src/Events/BeamClaimsComplete.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,4 @@

namespace Enjin\Platform\Beam\Events;

class BeamClaimsComplete extends BeamClaimPending
{
}
class BeamClaimsComplete extends BeamClaimPending {}
4 changes: 1 addition & 3 deletions src/Events/BeamClaimsFailed.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,4 @@

namespace Enjin\Platform\Beam\Events;

class BeamClaimsFailed extends BeamClaimPending
{
}
class BeamClaimsFailed extends BeamClaimPending {}
4 changes: 1 addition & 3 deletions src/Events/BeamDeleted.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,4 @@

namespace Enjin\Platform\Beam\Events;

class BeamDeleted extends BeamCreated
{
}
class BeamDeleted extends BeamCreated {}
4 changes: 1 addition & 3 deletions src/Events/BeamUpdated.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,4 @@

namespace Enjin\Platform\Beam\Events;

class BeamUpdated extends BeamCreated
{
}
class BeamUpdated extends BeamCreated {}
4 changes: 1 addition & 3 deletions src/Events/TokensRemoved.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,4 @@

namespace Enjin\Platform\Beam\Events;

class TokensRemoved extends TokensAdded
{
}
class TokensRemoved extends TokensAdded {}
10 changes: 5 additions & 5 deletions src/GraphQL/Traits/HasBeamCommonFields.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,23 +14,23 @@ public function getCommonFields(array $exclude = [], bool $updating = false): ar
$required = $updating ? '' : '!';
$fields = [
'name' => [
'type' => GraphQL::type('String' . $required),
'type' => GraphQL::type('String'.$required),
'description' => __('enjin-platform-beam::mutation.common.args.name'),
],
'description' => [
'type' => GraphQL::type('String' . $required),
'type' => GraphQL::type('String'.$required),
'description' => __('enjin-platform-beam::mutation.common.args.description'),
],
'image' => [
'type' => GraphQL::type('String' . $required),
'type' => GraphQL::type('String'.$required),
'description' => __('enjin-platform-beam::mutation.common.args.image'),
],
'start' => [
'type' => GraphQL::type('DateTime' . $required),
'type' => GraphQL::type('DateTime'.$required),
'description' => __('enjin-platform-beam::mutation.common.args.start'),
],
'end' => [
'type' => GraphQL::type('DateTime' . $required),
'type' => GraphQL::type('DateTime'.$required),
'description' => __('enjin-platform-beam::mutation.common.args.end'),
],
];
Expand Down
6 changes: 2 additions & 4 deletions src/Jobs/ClaimBeam.php
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,7 @@ class ClaimBeam implements ShouldQueue
/**
* Create a new job instance.
*/
public function __construct(protected ?array $data)
{
}
public function __construct(protected ?array $data) {}

/**
* Execute the job.
Expand Down Expand Up @@ -68,7 +66,7 @@ public function handle(BatchService $batch, WalletService $wallet): void
} catch (Throwable $e) {
DB::rollBack();

Log::error('ClaimBeamJob: Claim error, message:' . $e->getMessage(), $data);
Log::error('ClaimBeamJob: Claim error, message:'.$e->getMessage(), $data);

throw $e;
} finally {
Expand Down
4 changes: 1 addition & 3 deletions src/Jobs/CreateBeamClaims.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,7 @@ class CreateBeamClaims implements ShouldQueue
/**
* Create a new job instance.
*/
public function __construct(protected ?Collection $chunk)
{
}
public function __construct(protected ?Collection $chunk) {}

/**
* Execute the job.
Expand Down
4 changes: 1 addition & 3 deletions src/Jobs/CreateClaim.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,7 @@ class CreateClaim implements ShouldQueue
/**
* Create a new job instance.
*/
public function __construct(protected ?array $claim)
{
}
public function __construct(protected ?array $claim) {}

/**
* Execute the job.
Expand Down
3 changes: 1 addition & 2 deletions src/Jobs/DispatchCreateBeamClaimsJobs.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,7 @@ class DispatchCreateBeamClaimsJobs implements ShouldQueue
public function __construct(
protected Model $beam,
protected ?array $tokens
) {
}
) {}

/**
* Execute the job.
Expand Down
4 changes: 1 addition & 3 deletions src/Listeners/UpdateClaimCollectionIds.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,7 @@

class UpdateClaimCollectionIds implements ShouldQueue
{
public function __construct(private readonly BeamClaimService $beamClaimService)
{
}
public function __construct(private readonly BeamClaimService $beamClaimService) {}

/**
* Handle the event.
Expand Down
4 changes: 1 addition & 3 deletions src/Listeners/UpdateClaimStatus.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,7 @@ class UpdateClaimStatus implements ShouldQueue
/**
* Create new event listener instance.
*/
public function __construct()
{
}
public function __construct() {}

/**
* Handle the event.
Expand Down
4 changes: 1 addition & 3 deletions src/Models/Beam.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,4 @@

use Enjin\Platform\Models\ModelResolver;

class Beam extends ModelResolver
{
}
class Beam extends ModelResolver {}
4 changes: 1 addition & 3 deletions src/Models/BeamBatch.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,4 @@

use Enjin\Platform\Models\ModelResolver;

class BeamBatch extends ModelResolver
{
}
class BeamBatch extends ModelResolver {}
4 changes: 1 addition & 3 deletions src/Models/BeamClaim.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,4 @@

use Enjin\Platform\Models\ModelResolver;

class BeamClaim extends ModelResolver
{
}
class BeamClaim extends ModelResolver {}
4 changes: 1 addition & 3 deletions src/Models/BeamScan.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,4 @@

use Enjin\Platform\Models\ModelResolver;

class BeamScan extends ModelResolver
{
}
class BeamScan extends ModelResolver {}
2 changes: 1 addition & 1 deletion src/Models/Laravel/BeamClaim.php
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,7 @@ public function prunable()
$query = static::whereHas(
'beam',
fn ($query) => $query->where('end', '<', now()->addDays($days))
->whereRaw('flags_mask & (1 << ' . BeamFlag::PRUNABLE->value . ') != 0')
->whereRaw('flags_mask & (1 << '.BeamFlag::PRUNABLE->value.') != 0')
)->claimable();

// We'll decrement the cache for each beam that has expired claims.
Expand Down
2 changes: 2 additions & 0 deletions src/Models/Laravel/BeamScan.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@ class BeamScan extends BaseModel
use HasFactory;
use SoftDeletes;
use Traits\EagerLoadSelectFields;
use Traits\HasClaimable;
use Traits\HasCodeScope;

/**
* The attributes that aren't mass assignable.
Expand Down
4 changes: 2 additions & 2 deletions src/Models/Laravel/Traits/EagerLoadSelectFields.php
Original file line number Diff line number Diff line change
Expand Up @@ -187,7 +187,7 @@ public static function getRelationQuery(
case 'claims':
$relations = static::loadClaims(
$selections,
$attribute . '.fields.edges.fields.node.fields',
$attribute.'.fields.edges.fields.node.fields',
$args,
$key
);
Expand All @@ -197,7 +197,7 @@ public static function getRelationQuery(
case 'beam':
$relations = static::loadBeams(
$selections,
$attribute . '.fields',
$attribute.'.fields',
$args,
$key
);
Expand Down
6 changes: 2 additions & 4 deletions src/Rules/BeamExists.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,7 @@

class BeamExists implements ValidationRule
{
public function __construct(protected string $column = 'code')
{
}
public function __construct(protected string $column = 'code') {}

/**
* Run the validation rule.
Expand All @@ -24,7 +22,7 @@ public function validate(string $attribute, mixed $value, Closure $fail): void
$value = $beamData->beamCode;
}

if (!Beam::where($this->column, $value)->exists()) {
if (! Beam::where($this->column, $value)->exists()) {
$fail('validation.exists')->translate();
}
}
Expand Down
4 changes: 1 addition & 3 deletions src/Rules/CanClaim.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,7 @@ class CanClaim implements DataAwareRule, ValidationRule
/**
* Create new rule instance.
*/
public function __construct(protected bool $singleUse = false)
{
}
public function __construct(protected bool $singleUse = false) {}

/**
* Determine if the validation rule passes.
Expand Down
4 changes: 1 addition & 3 deletions src/Rules/HasBeamFlag.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,7 @@ class HasBeamFlag implements ValidationRule
/**
* Create new rule instance.
*/
public function __construct(protected BeamFlag $flag)
{
}
public function __construct(protected BeamFlag $flag) {}

/**
* Determine if the validation rule passes.
Expand Down
4 changes: 1 addition & 3 deletions src/Rules/MaxTokenCount.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,7 @@ class MaxTokenCount implements DataAwareRule, ValidationRule
*/
protected $limit;

public function __construct(protected ?string $collectionId)
{
}
public function __construct(protected ?string $collectionId) {}

/**
* Determine if the validation rule passes.
Expand Down
Loading

0 comments on commit 253eea1

Please sign in to comment.