-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #3 from plank/checkpoint-query-improvements
Checkpoint Query Improvements
- Loading branch information
Showing
25 changed files
with
967 additions
and
376 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -13,3 +13,6 @@ trim_trailing_whitespace = true | |
|
||
[*.md] | ||
trim_trailing_whitespace = false | ||
|
||
[*.{yml,yaml}] | ||
indent_size = 2 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
name: Tests | ||
|
||
on: [push, pull_request] | ||
|
||
jobs: | ||
test: | ||
runs-on: ${{ matrix.os }} | ||
strategy: | ||
fail-fast: true | ||
matrix: | ||
os: [ubuntu-latest] | ||
php: [7.4] | ||
laravel: [6.*, 7.*] | ||
stability: [prefer-stable] | ||
include: | ||
- laravel: 7.* | ||
testbench: 5.* | ||
- laravel: 6.* | ||
testbench: 4.* | ||
|
||
name: P${{ matrix.php }} - L${{ matrix.laravel }} - ${{ matrix.stability }} - ${{ matrix.os }} | ||
|
||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@v2 | ||
|
||
- name: Setup PHP | ||
uses: shivammathur/setup-php@v2 | ||
with: | ||
php-version: ${{ matrix.php }} | ||
extensions: dom, curl, libxml, mbstring, zip, pcntl, pdo, sqlite, pdo_sqlite, bcmath, soap, intl, gd, exif, iconv, imagick | ||
coverage: none | ||
|
||
- name: Setup problem matchers | ||
run: | | ||
echo "::add-matcher::${{ runner.tool_cache }}/php.json" | ||
echo "::add-matcher::${{ runner.tool_cache }}/phpunit.json" | ||
- name: Cache dependencies | ||
uses: actions/cache@v2 | ||
with: | ||
path: ~/.composer/cache/files | ||
key: dependencies-php-${{ matrix.php }}-laravel-${{ matrix.laravel }}-stability-${{ matrix.stability }}-composer-${{ hashFiles('composer.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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,12 @@ | ||
build | ||
composer.lock | ||
.idea | ||
.DS_Store | ||
docs | ||
vendor | ||
build | ||
coverage | ||
.idea | ||
vendor | ||
composer.lock | ||
.php_cs | ||
.php_cs.cache | ||
.DS_Store | ||
/.phpunit* | ||
.phpunit.result.cache | ||
phpunit.xml | ||
psalm.xml |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,34 +1,44 @@ | ||
<?php | ||
|
||
/* | ||
* You can place your custom package configuration in here. | ||
*/ | ||
return [ | ||
|
||
/* | ||
| | ||
| The full namespace to your User model class. | ||
| | ||
| If your application doesn't have a user class, the value should be "NULL". | ||
| | ||
*/ | ||
'user_model' => '\App\User', | ||
* When true, checkpoint will automatically hook its observer to the | ||
* revisionable model events in order to create revisions when needed | ||
*/ | ||
'enabled' => env('CHECKPOINT_ENABLED', true), | ||
|
||
/* | ||
| | ||
| Concrete implementation for the "version model". | ||
| To extend or replace this functionality, change the value below with your full "version model" FQCN. | ||
| | ||
*/ | ||
'checkpoint_model' => \Plank\Checkpoint\Models\Checkpoint::class, | ||
* When true, checkpoint will automatically apply the global revision scope | ||
* onto revisionables for filtering out relevant content based on time | ||
* | ||
* ***warning*** | ||
* disabling after using the package will result in query results containing | ||
* duplicate items as they won't automatically be filtered by time | ||
*/ | ||
'apply_global_scope' => env('REVISIONS_GLOBAL_SCOPE', env('CHECKPOINT_ENABLED', true)), | ||
|
||
/* | ||
| | ||
| Concrete implementation for the "version model". | ||
| To extend or replace this functionality, change the value below with your full "version model" FQCN. | ||
| | ||
*/ | ||
'revision_model' => \Plank\Checkpoint\Models\Revision::class, | ||
* Should checkpoint run its default migrations | ||
*/ | ||
'run_migrations' => env('RUN_CHECKPOINT_MIGRATIONS', true), | ||
|
||
'models' => [ | ||
|
||
/* | ||
* When using the "HasRevisions" trait from this package, we need to know which model | ||
* should be used to retrieve your revisions. To extend or replace this functionality, | ||
* change the value below with your full "revision model" class name. | ||
*/ | ||
'revision' => Plank\Checkpoint\Models\Revision::class, | ||
|
||
/* | ||
* When using the "HasRevisions" trait from this package, we need to know which model | ||
* should be used to retrieve your checkpoints. To extend or replace this functionality, | ||
* change the value below with your full "checkpoint model" class name. | ||
*/ | ||
'checkpoint' => Plank\Checkpoint\Models\Checkpoint::class, | ||
|
||
], | ||
|
||
]; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
<?xml version="1.0"?> | ||
<psalm | ||
errorLevel="4" | ||
findUnusedVariablesAndParams="true" | ||
resolveFromConfigFile="true" | ||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | ||
xmlns="https://getpsalm.org/schema/config" | ||
xsi:schemaLocation="https://getpsalm.org/schema/config vendor/vimeo/psalm/config.xsd" | ||
> | ||
<projectFiles> | ||
<directory name="src"/> | ||
<ignoreFiles> | ||
<directory name="vendor"/> | ||
</ignoreFiles> | ||
</projectFiles> | ||
</psalm> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.