Skip to content

Commit 832dcdd

Browse files
authored
Merge pull request #5 from laraneat/v2
v2
2 parents 8584150 + 93b8947 commit 832dcdd

File tree

746 files changed

+14863
-23822
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

746 files changed

+14863
-23822
lines changed

.github/workflows/tests.yml

Lines changed: 87 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,87 @@
1+
name: Tests
2+
3+
on:
4+
push:
5+
branches: [master]
6+
pull_request:
7+
branches: [master]
8+
9+
jobs:
10+
test:
11+
runs-on: ubuntu-latest
12+
13+
strategy:
14+
fail-fast: false
15+
matrix:
16+
php: [8.1, 8.2, 8.3, 8.4]
17+
laravel: [10.*, 11.*, 12.*]
18+
exclude:
19+
- php: 8.1
20+
laravel: 11.*
21+
- php: 8.1
22+
laravel: 12.*
23+
24+
name: PHP ${{ matrix.php }} - Laravel ${{ matrix.laravel }}
25+
26+
steps:
27+
- name: Checkout code
28+
uses: actions/checkout@v4
29+
30+
- name: Setup PHP
31+
uses: shivammathur/setup-php@v2
32+
with:
33+
php-version: ${{ matrix.php }}
34+
extensions: dom, curl, libxml, mbstring, zip, json
35+
coverage: none
36+
37+
- name: Install dependencies
38+
run: |
39+
composer require "laravel/framework:${{ matrix.laravel }}" --no-interaction --no-update
40+
composer update --prefer-dist --no-interaction
41+
42+
- name: Run tests
43+
run: composer test
44+
45+
static-analysis:
46+
runs-on: ubuntu-latest
47+
48+
name: Static Analysis
49+
50+
steps:
51+
- name: Checkout code
52+
uses: actions/checkout@v4
53+
54+
- name: Setup PHP
55+
uses: shivammathur/setup-php@v2
56+
with:
57+
php-version: 8.3
58+
extensions: dom, curl, libxml, mbstring, zip, json
59+
coverage: none
60+
61+
- name: Install dependencies
62+
run: composer update --prefer-dist --no-interaction
63+
64+
- name: Run PHPStan
65+
run: composer analyse
66+
67+
code-style:
68+
runs-on: ubuntu-latest
69+
70+
name: Code Style
71+
72+
steps:
73+
- name: Checkout code
74+
uses: actions/checkout@v4
75+
76+
- name: Setup PHP
77+
uses: shivammathur/setup-php@v2
78+
with:
79+
php-version: 8.3
80+
extensions: dom, curl, libxml, mbstring, zip, json
81+
coverage: none
82+
83+
- name: Install dependencies
84+
run: composer update --prefer-dist --no-interaction
85+
86+
- name: Check code style
87+
run: ./vendor/bin/php-cs-fixer fix --dry-run --diff --allow-risky=yes

.gitignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ build
66
coverage
77
.env
88
.env.backup
9-
.php_cs.cache
9+
.php-cs-fixer.cache
1010
.phpunit.result.cache
1111
.phpunit.cache
1212
.phpstorm.meta.php

.php-cs-fixer.dist.php

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
<?php
2+
3+
$finder = Symfony\Component\Finder\Finder::create()
4+
->in([
5+
__DIR__ . '/src',
6+
__DIR__ . '/tests',
7+
])
8+
->name('*.php')
9+
->notName('*.blade.php')
10+
->exclude([
11+
'__snapshots__',
12+
'.pest',
13+
])
14+
->ignoreDotFiles(true)
15+
->ignoreVCS(true);
16+
17+
return (new PhpCsFixer\Config())
18+
->setRules([
19+
'@PSR12' => true,
20+
'array_syntax' => ['syntax' => 'short'],
21+
'ordered_imports' => ['sort_algorithm' => 'alpha'],
22+
'no_unused_imports' => true,
23+
'not_operator_with_successor_space' => true,
24+
'trailing_comma_in_multiline' => true,
25+
'phpdoc_scalar' => true,
26+
'unary_operator_spaces' => true,
27+
'binary_operator_spaces' => true,
28+
'blank_line_before_statement' => [
29+
'statements' => ['break', 'continue', 'declare', 'return', 'throw', 'try'],
30+
],
31+
'phpdoc_single_line_var_spacing' => true,
32+
'phpdoc_var_without_name' => true,
33+
'method_argument_space' => [
34+
'on_multiline' => 'ensure_fully_multiline',
35+
'keep_multiple_spaces_after_comma' => true,
36+
],
37+
'single_trait_insert_per_statement' => true,
38+
])
39+
->setFinder($finder);

README.md

Lines changed: 866 additions & 8 deletions
Large diffs are not rendered by default.

composer.json

Lines changed: 29 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
{
22
"name": "laraneat/modules",
33
"description": "Laraneat modules.",
4-
"homepage": "https://github.com/laraneat/core/",
4+
"homepage": "https://github.com/laraneat/modules/",
55
"support": {
6-
"issues": "https://github.com/laraneat/core/issues",
7-
"source": "https://github.com/laraneat/core"
6+
"issues": "https://github.com/laraneat/modules/issues",
7+
"source": "https://github.com/laraneat/modules"
88
},
99
"authors": [
1010
{
@@ -24,59 +24,63 @@
2424
],
2525
"license": "MIT",
2626
"require": {
27-
"php": "^8.0",
27+
"php": "^8.1",
2828
"ext-json": "*",
29-
"laravel/framework": "^10.0"
29+
"composer/composer": "^2.1",
30+
"laravel/framework": "^10.0 || ^11.0 || ^12.0"
3031
},
3132
"require-dev": {
3233
"friendsofphp/php-cs-fixer": "^3.48",
33-
"mockery/mockery": "~1.0",
34-
"orchestra/testbench": "^8.2",
35-
"phpstan/phpstan": "^1.10",
36-
"phpunit/phpunit": "^10.5",
34+
"larastan/larastan": "^2.0 || ^3.0",
35+
"mockery/mockery": "^1.0",
36+
"orchestra/testbench": "^8.0 || ^9.0 || ^10.0",
37+
"pestphp/pest": "^2.31 || ^3.0",
38+
"pestphp/pest-plugin-laravel": "^2.0 || ^3.0",
39+
"phpstan/phpstan": "^1.10.58 || ^2.0",
3740
"roave/security-advisories": "dev-latest",
38-
"spatie/phpunit-snapshot-assertions": "^5.1"
41+
"spatie/pest-plugin-snapshots": "^2.1"
3942
},
4043
"autoload": {
4144
"psr-4": {
4245
"Laraneat\\Modules\\": "src"
43-
},
44-
"files": [
45-
"src/helpers.php"
46-
]
46+
}
4747
},
4848
"autoload-dev": {
4949
"psr-4": {
5050
"Laraneat\\Modules\\Tests\\": "tests",
51-
"App\\": "tests/laravel/app",
52-
"App\\Modules\\Article\\": "tests/fixtures/stubs/valid/Article"
51+
"App\\": "tests/fixtures/laravel/app",
52+
"Modules\\": "tests/fixtures/laravel/modules"
5353
}
5454
},
5555
"suggest": {
56-
"wikimedia/composer-merge-plugin": "Allows the ability to create and merge composer.json files for your individual modules for module-specific dependency management."
56+
"lorisleiva/laravel-actions": "Laravel components that take care of one specific task",
57+
"jackardios/laravel-query-wizard": "Easily build Eloquent queries from API requests",
58+
"spatie/laravel-data": "Powerful data objects for Laravel"
5759
},
5860
"extra": {
5961
"laravel": {
6062
"providers": [
61-
"Laraneat\\Modules\\ModulesServiceProvider"
63+
"Laraneat\\Modules\\Providers\\ComposerServiceProvider",
64+
"Laraneat\\Modules\\Providers\\ConsoleServiceProvider",
65+
"Laraneat\\Modules\\Providers\\ModulesRepositoryServiceProvider",
66+
"Laraneat\\Modules\\Providers\\ModulesServiceProvider"
6267
],
6368
"aliases": {
6469
"Modules": "Laraneat\\Modules\\Facades\\Modules"
6570
}
6671
}
6772
},
6873
"scripts": {
69-
"update-snapshots": "./vendor/bin/phpunit --no-coverage -d --update-snapshots",
70-
"test": "vendor/bin/phpunit",
71-
"test-coverage": "vendor/bin/phpunit --debug --coverage-html coverage",
72-
"pcf": "vendor/bin/php-cs-fixer fix --verbose",
74+
"analyse" : "./vendor/bin/phpstan analyse --memory-limit=256M",
75+
"test" : "./vendor/bin/pest --no-coverage",
76+
"test-coverage" : "./vendor/bin/pest --coverage-html coverage",
77+
"update-snapshots": "./vendor/bin/pest --no-coverage --update-snapshots",
78+
"format": "./vendor/bin/php-cs-fixer fix --allow-risky=yes",
7379
"post-autoload-dump": [
7480
"@php ./vendor/bin/testbench package:discover --ansi"
7581
]
7682
},
77-
"config": {
78-
"optimize-autoloader": true,
79-
"preferred-install": "dist",
83+
"config" : {
8084
"sort-packages": true,
8185
"allow-plugins": {
8286
"pestphp/pest-plugin": true

0 commit comments

Comments
 (0)