Skip to content

Commit

Permalink
[PLA-1678] Laravel 11 update. (#77)
Browse files Browse the repository at this point in the history
  • Loading branch information
v16Studios authored and enjinabner committed Jun 26, 2024
1 parent ca60c9f commit eebddd1
Show file tree
Hide file tree
Showing 40 changed files with 44 additions and 114 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/run_tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ jobs:
extensions: dom, curl, libxml, mbstring, zip, pcntl, pdo, sqlite, pdo_sqlite, gd, gmp, intl, json, mysql, readline, sodium, bcmath, pcov
tools: composer:v2
env:
COMPOSER_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: Setup GO
uses: actions/setup-go@v5
Expand All @@ -62,7 +62,7 @@ jobs:
chmod 600 ~/.ssh/id_rsa
composer install --no-interaction --prefer-dist --optimize-autoloader
composer build-sr25519
composer dumpautoload
composer dump-autoload
- name: Execute tests
run: |
Expand Down
12 changes: 6 additions & 6 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,13 +19,13 @@
}
],
"require": {
"php": "^8.1|^8.2",
"php": "^8.2",
"ext-bcmath": "*",
"ext-json": "*",
"ext-openssl": "*",
"enjin/platform-core": "*",
"phrity/websocket": "^1.0",
"rebing/graphql-laravel": "^9.0.0-rc1",
"rebing/graphql-laravel": "^9.2",
"spatie/laravel-package-tools": "^1.0",
"spatie/laravel-ray": "^1.0"
},
Expand Down Expand Up @@ -72,10 +72,10 @@
"prefer-stable": true,
"require-dev": {
"dms/phpunit-arraysubset-asserts": "dev-master",
"friendsofphp/php-cs-fixer": "^3.0",
"nunomaduro/collision": "^7.0",
"nunomaduro/larastan": "^2.0",
"orchestra/testbench": "^8.0",
"laravel/pint": "^1.16",
"nunomaduro/collision": "^8.1",
"larastan/larastan": "^2.0",
"orchestra/testbench": "^9.0",
"phpstan/extension-installer": "^1.0",
"phpstan/phpstan-deprecation-rules": "^1.0",
"phpstan/phpstan-phpunit": "^1.0",
Expand Down
2 changes: 1 addition & 1 deletion phpunit.xml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
<php>
<env name="APP_KEY" value="base64:2fl+Ktvkfl+Fuz4Qp/A75G2RTiWVA/ZoKZvp6fiiM10="/>
<env name="DB_CONNECTION" value="mysql"/>
<env name="CACHE_DRIVER" value="redis"/>
<env name="CACHE_STORE" value="redis"/>
<env name="CHAIN" value="substrate"/>
<env name="NETWORK" value="local"/>
<env name="DAEMON_ACCOUNT" value="0x6a03b1a3d40d7e344dfb27157931b14b59fe2ff11d7352353321fe400e956802"/>
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 {}
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 {}
4 changes: 1 addition & 3 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
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 {}
4 changes: 0 additions & 4 deletions src/Models/Laravel/Beam.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,15 +16,11 @@
use Illuminate\Database\Eloquent\Relations\HasMany;
use Illuminate\Database\Eloquent\SoftDeletes;
use Illuminate\Support\Facades\Cache;
use Staudenmeir\EloquentEagerLimit\HasEagerLimit;

class Beam extends BaseModel
{
use Traits\HasBeamQr;
use Traits\EagerLoadSelectFields;
use HasFactory;
use SoftDeletes;
use HasEagerLimit;

/**
* The attributes that aren't mass assignable.
Expand Down
2 changes: 0 additions & 2 deletions src/Models/Laravel/BeamClaim.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,9 @@
use Illuminate\Database\Eloquent\SoftDeletes;
use Illuminate\Support\Facades\Cache;
use Illuminate\Support\Str;
use Staudenmeir\EloquentEagerLimit\HasEagerLimit;

class BeamClaim extends BaseModel
{
use HasEagerLimit;
use HasFactory;
use HasSingleUseCodeScope;
use MassPrunable;
Expand Down
1 change: 0 additions & 1 deletion src/Models/Laravel/BeamScan.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Relations\BelongsTo;
use Illuminate\Database\Eloquent\SoftDeletes;
use Staudenmeir\EloquentEagerLimit\HasEagerLimit;

class BeamScan extends BaseModel

Check failure on line 11 in src/Models/Laravel/BeamScan.php

View workflow job for this annotation

GitHub Actions / PHP 8.2

Trait "Enjin\Platform\Beam\Models\Laravel\HasEagerLimit" not found
{
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
4 changes: 1 addition & 3 deletions src/Rules/MaxTokenSupply.php
Original file line number Diff line number Diff line change
Expand Up @@ -36,9 +36,7 @@ class MaxTokenSupply implements DataAwareRule, ValidationRule
/**
* Create instance of rule.
*/
public function __construct(protected ?string $collectionId)
{
}
public function __construct(protected ?string $collectionId) {}

/**
* Determine if the validation rule passes.
Expand Down
4 changes: 1 addition & 3 deletions src/Rules/NotExpired.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,7 @@

class NotExpired implements ValidationRule
{
public function __construct(protected ?string $code = null)
{
}
public function __construct(protected ?string $code = null) {}

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

public function __construct(protected bool $isSingleUse = false)
{
}
public function __construct(protected bool $isSingleUse = false) {}

/**
* Determine if the validation rule passes.
Expand Down
4 changes: 1 addition & 3 deletions src/Rules/NotPaused.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,7 @@

class NotPaused implements ValidationRule
{
public function __construct(protected ?string $code = null)
{
}
public function __construct(protected ?string $code = null) {}

/**
* Determine if the validation rule passes.
Expand Down
3 changes: 1 addition & 2 deletions src/Rules/PassesClaimCondition.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,7 @@ class PassesClaimCondition implements DataAwareRule, ValidationRule
public function __construct(
protected Closure $function,
protected bool $singleUse
) {
}
) {}

/**
* Determine if the validation rule passes.
Expand Down
3 changes: 1 addition & 2 deletions src/Rules/PassesClaimConditions.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,7 @@ class PassesClaimConditions implements DataAwareRule, ValidationRule
*/
public function __construct(
protected bool $singleUse
) {
}
) {}

public static function addConditionalFunctions(Closure|array|Collection $functions): void
{
Expand Down
4 changes: 1 addition & 3 deletions src/Rules/SingleUseCodeExist.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,7 @@

class SingleUseCodeExist implements ValidationRule
{
public function __construct(protected bool $isClaiming = false)
{
}
public function __construct(protected bool $isClaiming = false) {}

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

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

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

public function __construct(protected ?Model $beam = null)
{
}
public function __construct(protected ?Model $beam = null) {}

/**
* Determine if the validation rule passes.
Expand Down
4 changes: 1 addition & 3 deletions src/Rules/TokenUploadNotExistInCollection.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,7 @@ class TokenUploadNotExistInCollection implements ValidationRule
{
use IntegerRange;

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 eebddd1

Please sign in to comment.