Skip to content

Update symplify/easy-coding-standard requirement from ^11.5 to ^12.0 #732

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jul 27, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@
"phpstan/phpstan": "^1.10",
"phpunit/phpunit": "^10.2",
"rector/rector": "^0.17",
"symplify/easy-coding-standard": "^11.5"
"symplify/easy-coding-standard": "^12.0"
},
"suggest": {
"bavix/laravel-wallet-swap": "Addition to the laravel-wallet library for quick setting of exchange rates",
Expand Down
46 changes: 13 additions & 33 deletions ecs.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,51 +2,31 @@

declare(strict_types=1);

use PhpCsFixer\Fixer\ArrayNotation\ArraySyntaxFixer;
use PhpCsFixer\Fixer\Phpdoc\GeneralPhpdocAnnotationRemoveFixer;
use PhpCsFixer\Fixer\Phpdoc\PhpdocAlignFixer;
use PhpCsFixer\Fixer\PhpUnit\PhpUnitTestClassRequiresCoversFixer;
use PhpCsFixer\Fixer\Strict\DeclareStrictTypesFixer;
use Symplify\CodingStandard\Fixer\LineLength\DocBlockLineLengthFixer;
use Symplify\CodingStandard\Fixer\LineLength\LineLengthFixer;
use Symplify\EasyCodingStandard\Config\ECSConfig;
use Symplify\EasyCodingStandard\ValueObject\Set\SetList;

return static function (ECSConfig $containerConfigurator): void {
$containerConfigurator->parallel();
$services = $containerConfigurator->services();
$services->set(ArraySyntaxFixer::class)
->call('configure', [[
'syntax' => 'short',
]]);

$services->set(DeclareStrictTypesFixer::class);
$services->set(LineLengthFixer::class);
$services->set(PhpdocAlignFixer::class)
->call('configure', [[
'align' => 'left',
]]);

$containerConfigurator->paths([
return static function (ECSConfig $config): void {
$config->paths([
__DIR__ . '/config',
__DIR__ . '/database',
__DIR__ . '/resources/lang',
__DIR__ . '/src',
__DIR__ . '/tests',
]);

$containerConfigurator->skip([
DocBlockLineLengthFixer::class,
$config->skip([
GeneralPhpdocAnnotationRemoveFixer::class,
PhpUnitTestClassRequiresCoversFixer::class,
]);

$containerConfigurator->import(SetList::CLEAN_CODE);
$containerConfigurator->import(SetList::SYMPLIFY);
$containerConfigurator->import(SetList::COMMON);
$containerConfigurator->import(SetList::PSR_12);
$containerConfigurator->import(SetList::CONTROL_STRUCTURES);
$containerConfigurator->import(SetList::NAMESPACES);
$containerConfigurator->import(SetList::STRICT);
$containerConfigurator->import(SetList::PHPUNIT);
$config->sets([
SetList::CLEAN_CODE,
SetList::SYMPLIFY,
SetList::COMMON,
SetList::PSR_12,
SetList::CONTROL_STRUCTURES,
SetList::NAMESPACES,
SetList::STRICT,
SetList::PHPUNIT,
]);
};
2 changes: 1 addition & 1 deletion src/Models/Transaction.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,10 @@
use Bavix\Wallet\Internal\Service\MathServiceInterface;
use Bavix\Wallet\Models\Wallet as WalletModel;
use Bavix\Wallet\Services\CastServiceInterface;
use function config;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\Relations\BelongsTo;
use Illuminate\Database\Eloquent\Relations\MorphTo;
use function config;

/**
* Class Transaction.
Expand Down
2 changes: 1 addition & 1 deletion src/Models/Transfer.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@

namespace Bavix\Wallet\Models;

use function config;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\Relations\BelongsTo;
use function config;

/**
* Class Transfer.
Expand Down
6 changes: 3 additions & 3 deletions src/Models/Wallet.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,6 @@

namespace Bavix\Wallet\Models;

use function app;
use function array_key_exists;
use Bavix\Wallet\Interfaces\Confirmable;
use Bavix\Wallet\Interfaces\Customer;
use Bavix\Wallet\Interfaces\Exchangeable;
Expand All @@ -20,12 +18,14 @@
use Bavix\Wallet\Traits\CanExchange;
use Bavix\Wallet\Traits\CanPayFloat;
use Bavix\Wallet\Traits\HasGift;
use function config;
use DateTimeInterface;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\Relations\MorphTo;
use Illuminate\Database\RecordsNotFoundException;
use Illuminate\Support\Str;
use function app;
use function array_key_exists;
use function config;

/**
* Class Wallet.
Expand Down
2 changes: 1 addition & 1 deletion src/Objects/Cart.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@
use Bavix\Wallet\Internal\Exceptions\ExceptionInterface;
use Bavix\Wallet\Internal\Service\MathServiceInterface;
use Bavix\Wallet\Services\CastServiceInterface;
use function count;
use Countable;
use function count;

final class Cart implements Countable, CartInterface
{
Expand Down
2 changes: 1 addition & 1 deletion src/Traits/CanPay.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@
use Bavix\Wallet\Internal\Exceptions\TransactionFailedException;
use Bavix\Wallet\Models\Transfer;
use Bavix\Wallet\Objects\Cart;
use function current;
use Illuminate\Database\RecordsNotFoundException;
use function current;

/**
* @psalm-require-extends \Illuminate\Database\Eloquent\Model
Expand Down
2 changes: 1 addition & 1 deletion src/Traits/CartPay.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,8 @@
use Bavix\Wallet\Services\PrepareServiceInterface;
use Bavix\Wallet\Services\PurchaseServiceInterface;
use Bavix\Wallet\Services\TransferServiceInterface;
use function count;
use Illuminate\Database\RecordsNotFoundException;
use function count;

/**
* @psalm-require-extends \Illuminate\Database\Eloquent\Model
Expand Down
2 changes: 1 addition & 1 deletion src/Traits/HasGift.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@

namespace Bavix\Wallet\Traits;

use function app;
use Bavix\Wallet\Exceptions\BalanceIsEmpty;
use Bavix\Wallet\Exceptions\InsufficientFunds;
use Bavix\Wallet\Interfaces\ProductInterface;
Expand All @@ -23,6 +22,7 @@
use Bavix\Wallet\Services\TaxServiceInterface;
use Bavix\Wallet\Services\TransactionServiceInterface;
use Illuminate\Database\RecordsNotFoundException;
use function app;

/**
* Trait HasGift.
Expand Down
4 changes: 2 additions & 2 deletions src/Traits/HasWallet.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@

namespace Bavix\Wallet\Traits;

use function app;
use Bavix\Wallet\Exceptions\AmountInvalid;
use Bavix\Wallet\Exceptions\BalanceIsEmpty;
use Bavix\Wallet\Exceptions\InsufficientFunds;
Expand All @@ -23,10 +22,11 @@
use Bavix\Wallet\Services\RegulatorServiceInterface;
use Bavix\Wallet\Services\TransactionServiceInterface;
use Bavix\Wallet\Services\TransferServiceInterface;
use function config;
use Illuminate\Database\Eloquent\Relations\HasMany;
use Illuminate\Database\Eloquent\Relations\MorphMany;
use Illuminate\Database\RecordsNotFoundException;
use function app;
use function config;

/**
* Trait HasWallet.
Expand Down
4 changes: 2 additions & 2 deletions src/Traits/HasWallets.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,13 @@

namespace Bavix\Wallet\Traits;

use function array_key_exists;
use Bavix\Wallet\Internal\Exceptions\ModelNotFoundException;
use Bavix\Wallet\Models\Wallet as WalletModel;
use Bavix\Wallet\Services\WalletServiceInterface;
use function config;
use Illuminate\Database\Eloquent\Relations\MorphMany;
use Illuminate\Support\Collection;
use function array_key_exists;
use function config;

/**
* Trait HasWallets To use a trait, you must add HasWallet trait.
Expand Down
6 changes: 3 additions & 3 deletions src/WalletServiceProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -106,9 +106,6 @@
use Bavix\Wallet\Services\TransferServiceInterface;
use Bavix\Wallet\Services\WalletService;
use Bavix\Wallet\Services\WalletServiceInterface;
use function config;
use function dirname;
use function function_exists;
use Illuminate\Contracts\Cache\Factory as CacheFactory;
use Illuminate\Contracts\Support\DeferrableProvider;
use Illuminate\Database\Events\TransactionBeginning;
Expand All @@ -117,6 +114,9 @@
use Illuminate\Database\Events\TransactionRolledBack;
use Illuminate\Support\Facades\Event;
use Illuminate\Support\ServiceProvider;
use function config;
use function dirname;
use function function_exists;

final class WalletServiceProvider extends ServiceProvider implements DeferrableProvider
{
Expand Down
2 changes: 1 addition & 1 deletion tests/Units/Api/TransactionHandlerTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,13 @@

namespace Bavix\Wallet\Test\Units\Api;

use function app;
use Bavix\Wallet\External\Api\TransactionQuery;
use Bavix\Wallet\External\Api\TransactionQueryHandlerInterface;
use Bavix\Wallet\Test\Infra\Factories\BuyerFactory;
use Bavix\Wallet\Test\Infra\Models\Buyer;
use Bavix\Wallet\Test\Infra\PackageModels\Transaction;
use Bavix\Wallet\Test\Infra\TestCase;
use function app;

/**
* @internal
Expand Down
2 changes: 1 addition & 1 deletion tests/Units/Api/TransferHandlerTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,12 @@

namespace Bavix\Wallet\Test\Units\Api;

use function app;
use Bavix\Wallet\External\Api\TransferQuery;
use Bavix\Wallet\External\Api\TransferQueryHandlerInterface;
use Bavix\Wallet\Test\Infra\Factories\BuyerFactory;
use Bavix\Wallet\Test\Infra\Models\Buyer;
use Bavix\Wallet\Test\Infra\TestCase;
use function app;

/**
* @internal
Expand Down
2 changes: 1 addition & 1 deletion tests/Units/Domain/BalanceTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@

namespace Bavix\Wallet\Test\Units\Domain;

use function app;
use Bavix\Wallet\Models\Wallet;
use Bavix\Wallet\Services\BookkeeperServiceInterface;
use Bavix\Wallet\Services\RegulatorServiceInterface;
Expand All @@ -13,6 +12,7 @@
use Bavix\Wallet\Test\Infra\TestCase;
use PDOException;
use PHPUnit\Framework\MockObject\MockObject;
use function app;

/**
* @internal
Expand Down
2 changes: 1 addition & 1 deletion tests/Units/Domain/CartReceivingTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@
use Bavix\Wallet\Test\Infra\Models\ItemMeta;
use Bavix\Wallet\Test\Infra\PackageModels\Transaction;
use Bavix\Wallet\Test\Infra\TestCase;
use function count;
use Illuminate\Database\Eloquent\Collection;
use function count;

/**
* @internal
Expand Down
2 changes: 1 addition & 1 deletion tests/Units/Domain/CartTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@
use Bavix\Wallet\Test\Infra\Models\ItemMeta;
use Bavix\Wallet\Test\Infra\PackageModels\Transaction;
use Bavix\Wallet\Test\Infra\TestCase;
use function count;
use Illuminate\Database\Eloquent\Collection;
use function count;

/**
* @internal
Expand Down
2 changes: 1 addition & 1 deletion tests/Units/Domain/MultiWalletTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,8 @@
use Bavix\Wallet\Test\Infra\PackageModels\Wallet;
use Bavix\Wallet\Test\Infra\TestCase;
use Illuminate\Database\QueryException;
use function range;
use Throwable;
use function range;

/**
* @internal
Expand Down
2 changes: 1 addition & 1 deletion tests/Units/Domain/StateTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,14 @@

namespace Bavix\Wallet\Test\Units\Domain;

use function app;
use Bavix\Wallet\Internal\Service\DatabaseServiceInterface;
use Bavix\Wallet\Models\Wallet;
use Bavix\Wallet\Services\BookkeeperServiceInterface;
use Bavix\Wallet\Services\RegulatorServiceInterface;
use Bavix\Wallet\Test\Infra\Factories\BuyerFactory;
use Bavix\Wallet\Test\Infra\Models\Buyer;
use Bavix\Wallet\Test\Infra\TestCase;
use function app;

/**
* @internal
Expand Down