Skip to content
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
17 changes: 17 additions & 0 deletions .github/stale.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# Number of days of inactivity before an issue becomes stale
daysUntilStale: 30
# Number of days of inactivity before a stale issue is closed
daysUntilClose: 7
# Issues with these labels will never be considered stale
exemptLabels:
- pinned
- security
# Label to use when marking an issue as stale
staleLabel: wontfix
# Comment to post when marking an issue as stale. Set to `false` to disable
markComment: >
This issue has been automatically marked as stale because it has not had
recent activity. It will be closed if no further activity occurs. Thank you
for your contributions.
# Comment to post when closing a stale issue. Set to `false` to disable
closeComment: false
4 changes: 2 additions & 2 deletions .github/workflows/php-cs-fixer.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,9 @@ jobs:
- name: Run PHP CS Fixer
uses: docker://oskarstark/php-cs-fixer-ga
with:
args: --config=.php_cs.dist --allow-risky=yes
args: --config=.php-cs-fixer.php --allow-risky=yes

- name: Commit changes
uses: stefanzweifel/git-auto-commit-action@v4
with:
commit_message: Fix styling
commit_message: Fix Styling
33 changes: 0 additions & 33 deletions .github/workflows/psalm.yml

This file was deleted.

18 changes: 12 additions & 6 deletions .github/workflows/run-tests.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
name: Run Tests

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

jobs:
test:
Expand All @@ -9,12 +13,12 @@ jobs:
fail-fast: true
matrix:
os: [ubuntu-latest, windows-latest]
php: [8.0, 7.4]
laravel: [8.*]
php: [8.0, 8.1]
laravel: [9.*]
stability: [prefer-lowest, prefer-stable]
include:
- laravel: 8.*
testbench: 6.*
- laravel: 9.*
testbench: 7.0

name: P${{ matrix.php }} - L${{ matrix.laravel }} - ${{ matrix.stability }} - ${{ matrix.os }}

Expand All @@ -33,9 +37,11 @@ jobs:
run: |
echo "::add-matcher::${{ runner.tool_cache }}/php.json"
echo "::add-matcher::${{ runner.tool_cache }}/phpunit.json"

- name: Install dependencies
run: |
composer require "laravel/framework:${{ matrix.laravel }}" "orchestra/testbench:${{ matrix.testbench }}" --no-interaction --no-update
composer update --${{ matrix.stability }} --prefer-dist --no-interaction

- name: Execute tests
run: vendor/bin/phpunit
run: vendor/bin/phpunit
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
.idea
.php_cs
.php_cs.cache
.php-cs-fixer.cache
.phpunit.result.cache
build
composer.lock
Expand Down
44 changes: 44 additions & 0 deletions .php-cs-fixer.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
<?php

$finder = Symfony\Component\Finder\Finder::create()
->notPath('bootstrap/*')
->notPath('storage/*')
->notPath('resources/view/mail/*')
->in([
__DIR__ . '/config',
__DIR__ . '/src',
__DIR__ . '/tests',
])
->name('*.php')
->notName('*.blade.php')
->ignoreDotFiles(true)
->ignoreVCS(true);

$config = new PhpCsFixer\Config();
return $config->setRules([
'@PSR2' => true,
'array_syntax' => ['syntax' => 'short'],
'ordered_imports' => ['sort_algorithm' => 'alpha'],
'no_unused_imports' => true,
'not_operator_with_successor_space' => true,
'trailing_comma_in_multiline' => true,
'phpdoc_scalar' => true,
'unary_operator_spaces' => true,
'binary_operator_spaces' => true,
'blank_line_before_statement' => [
'statements' => ['break', 'continue', 'declare', 'return', 'throw', 'try'],
],
'phpdoc_single_line_var_spacing' => true,
'phpdoc_var_without_name' => true,
'class_attributes_separation' => [
'elements' => [
'method' => 'one',
],
],
'method_argument_space' => [
'on_multiline' => 'ensure_fully_multiline',
'keep_multiple_spaces_after_comma' => true,
],
'single_trait_insert_per_statement' => false,
])
->setFinder($finder);
43 changes: 0 additions & 43 deletions .php_cs.dist

This file was deleted.

7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,13 @@

All notable changes to `laravel-patches` will be documented in this file.

## 2.0.0 - 2022-02-21

### Added

- Laravel 9 Support
- Ability to specify table name

## 1.0.0 - 2021-03-07

- Initial Release
6 changes: 6 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,12 @@ You can install the package via composer:
composer require rappasoft/laravel-patches
```

You can publish the config file with:

```bash
php artisan vendor:publish --provider="Rappasoft\LaravelPatches\LaravelPatchesServiceProvider" --tag="laravel-patches-config"
```

You can publish and run the migrations with:

```bash
Expand Down
12 changes: 6 additions & 6 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,15 +15,15 @@
}
],
"require": {
"php": "^7.4|^8.0",
"php": "^8.0",
"spatie/laravel-package-tools": "^1.1",
"illuminate/contracts": "^8.0"
"illuminate/contracts": "^9.0"
},
"require-dev": {
"orchestra/testbench": "^6.0",
"friendsofphp/php-cs-fixer": "^3.1",
"orchestra/testbench": "^7.0",
"phpunit/phpunit": "^9.3",
"spatie/laravel-ray": "^1.9",
"vimeo/psalm": "^4.4"
"spatie/laravel-ray": "^1.9"
},
"autoload": {
"psr-4": {
Expand All @@ -36,7 +36,7 @@
}
},
"scripts": {
"psalm": "vendor/bin/psalm",
"format": "vendor/bin/php-cs-fixer fix --allow-risky=yes",
"test": "vendor/bin/phpunit --colors=always",
"test-coverage": "vendor/bin/phpunit --coverage-html coverage"
},
Expand Down
5 changes: 5 additions & 0 deletions config/laravel-patches.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
<?php

return [
'table_name' => 'patches',
];
4 changes: 2 additions & 2 deletions database/migrations/create_patches_table.php.stub
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ class CreatePatchesTable extends Migration
*/
public function up()
{
Schema::create('patches', function (Blueprint $table) {
Schema::create(config('laravel-patches.table_name'), function (Blueprint $table) {
$table->id();
$table->string('patch');
$table->integer('batch');
Expand All @@ -29,6 +29,6 @@ class CreatePatchesTable extends Migration
*/
public function down()
{
Schema::dropIfExists('patches');
Schema::dropIfExists(config('laravel-patches.table_name'));
}
}
1 change: 1 addition & 0 deletions src/LaravelPatchesServiceProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ public function configurePackage(Package $package): void
{
$package
->name('laravel-patches')
->hasConfigFile('laravel-patches')
->hasMigration('create_patches_table')
->hasCommands([PatchMakeCommand::class, PatchCommand::class, RollbackCommand::class]);
}
Expand Down
2 changes: 1 addition & 1 deletion src/Patcher.php
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ public function setOutput(OutputInterface $output): Patcher
*/
public function patchesTableExists(): bool
{
return Schema::hasTable('patches');
return Schema::hasTable(config('laravel-patches.table_name'));
}

/**
Expand Down