Skip to content

Commit

Permalink
add support laravel-wallet:^11.0
Browse files Browse the repository at this point in the history
  • Loading branch information
rez1dent3 committed Mar 13, 2024
1 parent a354cc3 commit e39c798
Show file tree
Hide file tree
Showing 10 changed files with 153 additions and 193 deletions.
38 changes: 0 additions & 38 deletions .github/workflows/code-style.yaml

This file was deleted.

89 changes: 89 additions & 0 deletions .github/workflows/fixer.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,89 @@
name: fixer

on:
push:
branches: [ master ]
pull_request:
branches: [ master ]

jobs:
autofix:
runs-on: ubuntu-latest

steps:
- name: Checkout
uses: actions/checkout@v4

- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: 8.2
extensions: mbstring, pgsql, mysql, sqlite, redis, memcached, bcmath
coverage: pcov
env:
runner: self-hosted

- name: Validate composer.json and composer.lock
run: composer validate --strict

- name: Cache Composer packages
id: composer-cache
uses: actions/cache@v4
with:
path: vendor
key: ${{ runner.os }}-php-${{ hashFiles('**/composer.lock') }}
restore-keys: |
${{ runner.os }}-php-
- name: Install dependencies
run: composer install --prefer-dist --no-progress

- name: Run rector-fix
run: composer rector-fix

- name: Run ecs-fix
run: composer ecs-fix

- name: Run rector
run: composer rector

- name: Run ecs
run: composer ecs

- name: Run parabench
run: composer parabench

- name: "Check if build has changed"
if: success()
id: has-changes
run: |
echo "stdout<<EOF" >> $GITHUB_OUTPUT
echo "$(git diff --stat)" >> $GITHUB_OUTPUT
echo 'EOF' >> $GITHUB_OUTPUT
- name: Import GPG key
if: ${{ steps.has-changes.outputs.stdout }}
uses: crazy-max/ghaction-import-gpg@v6
with:
gpg_private_key: ${{ secrets.GPG_BOT }}
passphrase: ${{ secrets.GPG_PASSPHRASE }}
fingerprint: ${{ secrets.GPG_FINGERPRINT }}
git_config_global: true
git_user_signingkey: true
git_commit_gpgsign: true
git_committer_name: Github bot
git_committer_email: [email protected]

- name: "Commit files"
if: ${{ steps.has-changes.outputs.stdout }}
env:
GH_TOKEN: ${{ secrets.BOT_TOKEN }}
run: |
gh pr checkout ${{ github.event.pull_request.number }}
git commit -S -m "autofix" -a
- name: "Push changes"
if: ${{ steps.has-changes.outputs.stdout }}
env:
GITHUB_TOKEN: ${{ secrets.BOT_TOKEN }}
run: git push -u origin HEAD
38 changes: 0 additions & 38 deletions .github/workflows/rector.yaml

This file was deleted.

1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,4 @@ composer.lock
build/
.phpunit.result.cache
.php_cs_cache
.phpunit.cache/
6 changes: 0 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,17 +1,11 @@
[![Mutation testing badge](https://badge.stryker-mutator.io/github.com/bavix/laravel-wallet-warmup/master)](https://packagist.org/packages/bavix/laravel-wallet-warmup)
[![Package Rank](https://phppackages.org/p/bavix/laravel-wallet-warmup/badge/rank.svg)](https://packagist.org/packages/bavix/laravel-wallet-warmup)
[![Latest Stable Version](https://poser.pugx.org/bavix/laravel-wallet-warmup/v/stable)](https://packagist.org/packages/bavix/laravel-wallet-warmup)
[![Latest Unstable Version](https://poser.pugx.org/bavix/laravel-wallet-warmup/v/unstable)](https://packagist.org/packages/bavix/laravel-wallet-warmup)
[![License](https://poser.pugx.org/bavix/laravel-wallet-warmup/license)](https://packagist.org/packages/bavix/laravel-wallet-warmup)
[![composer.lock](https://poser.pugx.org/bavix/laravel-wallet-warmup/composerlock)](https://packagist.org/packages/bavix/laravel-wallet-warmup)

laravel-wallet-warmup - Addition to the package laravel-wallet.

* **Vendor**: bavix
* **Package**: laravel-wallet-warmup
* **Version**: [![Latest Stable Version](https://poser.pugx.org/bavix/laravel-wallet-warmup/v/stable)](https://packagist.org/packages/bavix/laravel-wallet-warmup)
* **PHP Version**: 7.4+
* **Laravel Version**: `6.x`, `7.x`, `8.x`
* **[Composer](https://getcomposer.org/):** `composer require bavix/laravel-wallet-warmup`

---
Expand Down
20 changes: 11 additions & 9 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,18 +22,20 @@
}
],
"require": {
"php": "^8.1",
"bavix/laravel-wallet": "^10.0"
"php": "^8.2",
"bavix/laravel-wallet": "^11.0"
},
"require-dev": {
"driftingly/rector-laravel": "^0.26",
"ergebnis/phpstan-rules": "^1.0",
"infection/infection": "^0.27",
"orchestra/testbench": "^8.5",
"driftingly/rector-laravel": "^1.0",
"ergebnis/phpstan-rules": "^2.1",
"infection/infection": "~0.27",
"larastan/larastan": "^2.8",
"nunomaduro/collision": "^8.0",
"orchestra/testbench": "^9.0",
"phpstan/phpstan": "^1.10",
"phpunit/phpunit": "^10.2",
"rector/rector": "^0.19",
"symplify/easy-coding-standard": "^11.5"
"phpunit/phpunit": "^10.5",
"rector/rector": "^1.0",
"symplify/easy-coding-standard": "^12.1"
},
"autoload": {
"psr-4": {
Expand Down
37 changes: 15 additions & 22 deletions ecs.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,37 +2,30 @@

declare(strict_types=1);

use PhpCsFixer\Fixer\ArrayNotation\ArraySyntaxFixer;
use PhpCsFixer\Fixer\Phpdoc\PhpdocToCommentFixer;
use PhpCsFixer\Fixer\PhpUnit\PhpUnitTestClassRequiresCoversFixer;
use PhpCsFixer\Fixer\Strict\DeclareStrictTypesFixer;
use PhpCsFixer\Fixer\Phpdoc\GeneralPhpdocAnnotationRemoveFixer;
use Symplify\EasyCodingStandard\Config\ECSConfig;
use Symplify\EasyCodingStandard\ValueObject\Set\SetList;

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

$services->set(DeclareStrictTypesFixer::class);

$config->paths([
__DIR__ . '/src',
__DIR__ . '/tests',
]);

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

$config->import(SetList::CLEAN_CODE);
$config->import(SetList::PSR_12);
$config->import(SetList::CONTROL_STRUCTURES);
$config->import(SetList::NAMESPACES);
$config->import(SetList::STRICT);
$config->import(SetList::PHPUNIT);
};
$config->sets([
SetList::CLEAN_CODE,
SetList::SYMPLIFY,
SetList::ARRAY,
SetList::COMMON,
SetList::PSR_12,
SetList::CONTROL_STRUCTURES,
SetList::NAMESPACES,
SetList::STRICT,
SetList::PHPUNIT,
SetList::LARAVEL,
]);
};
8 changes: 8 additions & 0 deletions phpstan.common.neon
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
includes:
- vendor/larastan/larastan/extension.neon
- vendor/ergebnis/phpstan-rules/rules.neon

parameters:
level: 9
fileExtensions:
- php
95 changes: 18 additions & 77 deletions phpstan.neon
Original file line number Diff line number Diff line change
@@ -1,82 +1,23 @@
includes:
- phpstan.common.neon

parameters:
checkMissingIterableValueType: false
level: 9
fileExtensions:
- php
ergebnis:
allowAbstractClasses: true
classesAllowedToBeExtended:
# laravel
- Illuminate\Support\ServiceProvider
- Illuminate\Database\Eloquent\Model
- Illuminate\Console\Command

# php exceptions
- Exception
- LogicException
- RuntimeException
- UnderflowException
- UnexpectedValueException
- InvalidArgumentException

classesNotRequiredToBeAbstractOrFinal:
- Bavix\Wallet\Models\Wallet
- Bavix\Wallet\Models\Transfer
- Bavix\Wallet\Models\Transaction
interfacesImplementedByContainers:
- Psr\Container\ContainerInterface
noParameterWithNullableTypeDeclaration:
enabled: false
noNullableReturnTypeDeclaration:
enabled: false
noParameterWithNullDefaultValue:
enabled: false
final:
allowAbstractClasses: true
noExtends:
classesAllowedToBeExtended:
# laravel
- Illuminate\Console\Command
- Illuminate\Support\ServiceProvider
paths:
- src/
- tests/

parametersSchema:
ergebnis: structure([
allowAbstractClasses: bool()
classesAllowedToBeExtended: listOf(string())
classesNotRequiredToBeAbstractOrFinal: listOf(string())
interfacesImplementedByContainers: listOf(string())
])

rules:
- Ergebnis\PHPStan\Rules\Closures\NoNullableReturnTypeDeclarationRule
- Ergebnis\PHPStan\Rules\Closures\NoParameterWithNullableTypeDeclarationRule
- Ergebnis\PHPStan\Rules\Expressions\NoCompactRule
- Ergebnis\PHPStan\Rules\Expressions\NoEmptyRule
- Ergebnis\PHPStan\Rules\Expressions\NoErrorSuppressionRule
- Ergebnis\PHPStan\Rules\Expressions\NoEvalRule
- Ergebnis\PHPStan\Rules\Expressions\NoIssetRule
- Ergebnis\PHPStan\Rules\Files\DeclareStrictTypesRule
- Ergebnis\PHPStan\Rules\Functions\NoNullableReturnTypeDeclarationRule
- Ergebnis\PHPStan\Rules\Functions\NoParameterWithNullableTypeDeclarationRule
- Ergebnis\PHPStan\Rules\Functions\NoParameterWithNullDefaultValueRule
- Ergebnis\PHPStan\Rules\Methods\FinalInAbstractClassRule
- Ergebnis\PHPStan\Rules\Methods\NoConstructorParameterWithDefaultValueRule
- Ergebnis\PHPStan\Rules\Methods\PrivateInFinalClassRule
- Ergebnis\PHPStan\Rules\Statements\NoSwitchRule

services:
-
class: Ergebnis\PHPStan\Rules\Classes\FinalRule
arguments:
allowAbstractClasses: %ergebnis.allowAbstractClasses%
classesNotRequiredToBeAbstractOrFinal: %ergebnis.classesNotRequiredToBeAbstractOrFinal%
tags:
- phpstan.rules.rule

-
class: Ergebnis\PHPStan\Rules\Classes\NoExtendsRule
arguments:
classesAllowedToBeExtended: %ergebnis.classesAllowedToBeExtended%
tags:
- phpstan.rules.rule

-
class: Ergebnis\PHPStan\Rules\Classes\PHPUnit\Framework\TestCaseWithSuffixRule
tags:
- phpstan.rules.rule

-
class: Ergebnis\PHPStan\Rules\Methods\NoParameterWithContainerTypeDeclarationRule
arguments:
interfacesImplementedByContainers: %ergebnis.interfacesImplementedByContainers%
tags:
- phpstan.rules.rule
- src/
Loading

0 comments on commit e39c798

Please sign in to comment.