Skip to content

Commit

Permalink
add support laravel-wallet:^10.0 (#30)
Browse files Browse the repository at this point in the history
* add support laravel-wallet:^10.0

* ecs-fix

* fix units
  • Loading branch information
rez1dent3 authored Jul 9, 2023
1 parent 73874f0 commit 0babbd5
Show file tree
Hide file tree
Showing 11 changed files with 41 additions and 90 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/code-style.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ jobs:
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: 8.0
php-version: 8.1
env:
runner: self-hosted

Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/phpstan.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ jobs:
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: 8.0
php-version: 8.1
env:
runner: self-hosted

Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/phpunits.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ jobs:

strategy:
matrix:
php-versions: [8.0, 8.1]
php-versions: [8.1, 8.2]
databases: [testing, pgsql, mysql, mariadb]
caches: [array, redis, memcached]

Expand Down Expand Up @@ -119,7 +119,7 @@ jobs:

- name: Check codeclimate
id: codeclimate-check
run: echo "execute=${{ matrix.php-versions == '8.0' && matrix.caches == 'array' && matrix.databases == 'testing' }}" >> $GITHUB_OUTPUT
run: echo "execute=${{ matrix.php-versions == '8.2' && matrix.caches == 'array' && matrix.databases == 'testing' }}" >> $GITHUB_OUTPUT

- name: Prepare codeclimate
id: codeclimate-prepare
Expand Down
40 changes: 0 additions & 40 deletions .github/workflows/psalm.yaml

This file was deleted.

2 changes: 1 addition & 1 deletion .github/workflows/rector.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ jobs:
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: 8.0
php-version: 8.1
env:
runner: self-hosted

Expand Down
24 changes: 11 additions & 13 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,20 +22,20 @@
}
],
"require": {
"php": "^8.0",
"bavix/laravel-wallet": "^9.0"
"php": "^8.1",
"bavix/laravel-wallet": "^10.0"
},
"require-dev": {
"brianium/paratest": "^6.4",
"brianium/paratest": "^7.2",
"driftingly/rector-laravel": "^0.21.0",
"ergebnis/phpstan-rules": "^1.0",
"infection/infection": "~0.26",
"nunomaduro/collision": "^6.2",
"orchestra/testbench": "^7.4",
"phpstan/phpstan": "^1.5",
"phpunit/phpunit": "^9.5",
"rector/rector": "^0.14",
"symplify/easy-coding-standard": "^11.1",
"vimeo/psalm": "^4.13"
"infection/infection": "~0.27",
"nunomaduro/collision": "^7.7",
"orchestra/testbench": "^8.5",
"phpstan/phpstan": "^1.10",
"phpunit/phpunit": "^10.2",
"rector/rector": "^0.17",
"symplify/easy-coding-standard": "^11.5"
},
"autoload": {
"psr-4": {
Expand Down Expand Up @@ -65,8 +65,6 @@
"ecs": "@php vendor/bin/ecs check",
"ecs-fix": "@php vendor/bin/ecs check --fix",
"ecs-cc": "@php vendor/bin/ecs --clear-cache",
"psalm": "@php vendor/bin/psalm",
"psalm-cc": "@php vendor/bin/psalm --clear-cache",
"rector": "@php vendor/bin/rector process --dry-run",
"rector-fix": "@php vendor/bin/rector process"
},
Expand Down
10 changes: 6 additions & 4 deletions phpunit.xml
Original file line number Diff line number Diff line change
@@ -1,9 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" bootstrap="vendor/autoload.php" backupGlobals="false" backupStaticAttributes="false" colors="true" verbose="true" convertErrorsToExceptions="true" convertNoticesToExceptions="true" convertWarningsToExceptions="true" processIsolation="false" stopOnFailure="false" xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/9.3/phpunit.xsd">
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" bootstrap="vendor/autoload.php" backupGlobals="false" colors="true" processIsolation="false" stopOnFailure="false" xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/10.2/phpunit.xsd" cacheDirectory=".phpunit.cache" backupStaticProperties="false">
<coverage>
<include>
<directory suffix=".php">src/</directory>
</include>
<report>
<clover outputFile="./build/logs/clover.xml"/>
<html outputDirectory="./build/html/"/>
Expand All @@ -22,4 +19,9 @@
<env name="DB_PASSWORD" value="wallet"/>
<env name="CACHE_DRIVER" value="array"/>
</php>
<source>
<include>
<directory suffix=".php">src/</directory>
</include>
</source>
</phpunit>
12 changes: 0 additions & 12 deletions psalm.xml

This file was deleted.

16 changes: 3 additions & 13 deletions rector.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,8 @@

declare(strict_types=1);

use Rector\CodeQuality\Rector\PropertyFetch\ExplicitMethodCallOverMagicGetSetRector;
use Rector\Config\RectorConfig;
use Rector\Laravel\Set\LaravelSetList;
use Rector\Php74\Rector\Property\TypedPropertyRector;
use RectorLaravel\Set\LaravelSetList;
use Rector\PHPUnit\Set\PHPUnitSetList;
use Rector\Set\ValueObject\SetList;

Expand All @@ -16,18 +14,10 @@
__DIR__ . '/tests',
]);

$config->skip([ExplicitMethodCallOverMagicGetSetRector::class]);

// Define what rule sets will be applied
$config->import(PHPUnitSetList::PHPUNIT_91);
$config->import(LaravelSetList::LARAVEL_80);
$config->import(LaravelSetList::LARAVEL_90);
$config->import(SetList::CODE_QUALITY);
$config->import(SetList::DEAD_CODE);
$config->import(SetList::PHP_80);

// get services (needed for register a single rule)
$services = $config->services();

// register a single rule
$services->set(TypedPropertyRector::class);
$config->import(SetList::PHP_81);
};
6 changes: 4 additions & 2 deletions tests/Infra/Factories/BuyerFactory.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,10 @@ final class BuyerFactory extends Factory
public function definition(): array
{
return [
'name' => $this->faker->name,
'email' => $this->faker->unique()
'name' => fake()
->name(),
'email' => fake()
->unique()
->safeEmail,
];
}
Expand Down
13 changes: 12 additions & 1 deletion tests/Infra/Models/Buyer.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,25 @@

namespace Bavix\WalletUuid\Test\Infra\Models;

use Bavix\Wallet\Interfaces\Customer;
use Bavix\Wallet\Traits\CanPay;
use Bavix\Wallet\Traits\HasWallets;
use Bavix\WalletUuid\Test\Infra\Uuids;
use Illuminate\Database\Eloquent\Model;

/**
* @internal
*/
final class Buyer extends \Bavix\Wallet\Test\Infra\Models\Buyer
final class Buyer extends Model implements Customer
{
use Uuids;
use CanPay;
use HasWallets;

public $incrementing = false;

public function getTable(): string
{
return 'users';
}
}

0 comments on commit 0babbd5

Please sign in to comment.