Skip to content
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

feat: laravel 8/9/10 support #13

Closed
wants to merge 4 commits into from
Closed
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
15 changes: 15 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
root = true

[*]
charset = utf-8
end_of_line = lf
insert_final_newline = true
indent_style = space
indent_size = 2
trim_trailing_whitespace = true

[*.php]
indent_size = 4

[*.md]
trim_trailing_whitespace = false
19 changes: 19 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
name: Release

on:
push:
branches:
- master

permissions:
contents: write
pull-requests: write

jobs:
release-please:
runs-on: ubuntu-latest
steps:
- uses: google-github-actions/release-please-action@v3
with:
release-type: php
package-name: config-secrets
41 changes: 0 additions & 41 deletions .github/workflows/tests.yml

This file was deleted.

46 changes: 46 additions & 0 deletions .github/workflows/validate.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
name: Build Status

on:
pull_request:
branches: [master]

jobs:
commitlint:
runs-on: ubuntu-latest
steps:
- name: Validate Pull Request Title
uses: amannn/action-semantic-pull-request@v5
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- uses: actions/checkout@v3
with:
fetch-depth: 0

- name: Validate commit messages
uses: wagoid/commitlint-github-action@v5

php:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3

- name: Setup PHP with PECL extension
uses: shivammathur/setup-php@v2
with:
php-version: "8.1"
# Taken from https://github.com/kirschbaum-development/laravel-test-runner-container/blob/master/8.1/Dockerfile
extensions: mbstring, mysql, xml, xsl, zip, curl, bcmath, intl, bz2

- name: Install composer dependencies
run: composer install -q --no-ansi --no-interaction --no-scripts --no-progress --prefer-dist

- name: Validate PHP code
run: composer verify

- name: Upload coverage results to Coveralls
env:
COVERALLS_REPO_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
composer global require php-coveralls/php-coveralls
php-coveralls --coverage_clover=build/logs/clover.xml -v
6 changes: 3 additions & 3 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
/vendor
composer.lock
*.cache
/vendor/
*.cache
build/logs/clover.xml
35 changes: 35 additions & 0 deletions .php-cs-fixer.dist.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
<?php

$finder = PhpCsFixer\Finder::create()
->notPath('vendor')
->in(__DIR__)
->name('*.php')
->ignoreDotFiles(true)
->ignoreVCS(true)
;

$config = new PhpCsFixer\Config();

$config
->setLineEnding("\n")
->setCacheFile(__DIR__.'/.php-cs-fixer.cache')
->setIndent(' ')
->setRules([
'@Symfony' => true,
'binary_operator_spaces' => ['operators' => ['=>' => 'align']],
'array_syntax' => ['syntax' => 'short'],
'array_indentation' => true,
'linebreak_after_opening_tag' => true,
'not_operator_with_successor_space' => true,
'ordered_imports' => true,
'phpdoc_order' => true,
'increment_style' => ['style' => 'post'],
'global_namespace_import' => [
'import_classes' => true,
'import_constants' => null,
'import_functions' => null,
],
])
->setFinder($finder);

return $config;
2 changes: 2 additions & 0 deletions .styleci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
version: 8.1
preset: laravel
90 changes: 51 additions & 39 deletions composer.json
Original file line number Diff line number Diff line change
@@ -1,42 +1,54 @@
{
"name": "ajcastro/eager-load-pivot-relations",
"description": "Eager load pivot relations for Laravel Eloquent's BelongsToMany relation.",
"type": "library",
"license": "MIT",
"authors": [
{
"name": "Arjon Jason Castro",
"email": "[email protected]"
}
],
"require": {
"php": ">=5.6.0"
},
"require-dev": {
"laravel/framework": ">= 5.0.0",
"laravel/legacy-factories": ">= 1.0.0",
"orchestra/testbench": ">= 3.0.0",
"phpunit/phpunit": ">= 6.0.0"
},
"autoload": {
"psr-4": {
"AjCastro\\EagerLoadPivotRelations\\": "src"
}
},
"autoload-dev": {
"psr-4": {
"AjCastro\\EagerLoadPivotRelations\\Tests\\": "tests"
},
"classmap": [
"tests/Database/Migrations"
]
},
"extra": {
"laravel": {
"providers": [
],
"aliases": {
}
}
"name": "ajcastro/eager-load-pivot-relations",
"description": "Eager load pivot relations for Laravel Eloquent's BelongsToMany relation.",
"type": "library",
"license": "MIT",
"authors": [
{
"name": "Arjon Jason Castro",
"email": "[email protected]"
}
],
"require": {
"php": ">=7.3.0"
},
"require-dev": {
"friendsofphp/php-cs-fixer": "^3.0",
"laravel/framework": ">= 8.0.0",
"laravel/legacy-factories": ">= 1.0.0",
"orchestra/testbench": ">= 6.0.0",
"php-coveralls/php-coveralls": "^2.2",
"phpmd/phpmd": "^2.10",
"phpunit/phpunit": ">= 6.0.0",
"roave/security-advisories": "dev-latest"
},
"autoload": {
"psr-4": {
"AjCastro\\EagerLoadPivotRelations\\": "src"
}
},
"autoload-dev": {
"psr-4": {
"AjCastro\\EagerLoadPivotRelations\\Tests\\": "tests"
},
"classmap": [
"tests/Database/Migrations"
]
},
"scripts": {
"test": [
"php ./vendor/bin/phpunit"
],
"test-with-coverage": [
"XDEBUG_MODE=coverage php ./vendor/bin/phpunit --coverage-clover build/logs/clover.xml"
],
"fix": [
"php ./vendor/bin/php-cs-fixer fix --config .php-cs-fixer.dist.php"
],
"verify": [
"php ./vendor/bin/php-cs-fixer fix --config .php-cs-fixer.dist.php --dry-run",
"php ./vendor/bin/phpmd src ansi phpmd-ruleset.xml",
"XDEBUG_MODE=coverage php ./vendor/bin/phpunit --coverage-clover build/logs/clover.xml"
]
}
}
Loading