Skip to content

Commit 93b2dfb

Browse files
authored
Refactor configuration and dependencies (#4)
1 parent a61e837 commit 93b2dfb

File tree

9 files changed

+105
-131
lines changed

9 files changed

+105
-131
lines changed

.editorconfig

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,8 @@ indent_style = space
88
insert_final_newline = true
99
trim_trailing_whitespace = true
1010

11+
[*.{js,jsx,mjs,cjs,ts,tsx,mts,cts,vue,css,scss,sass,less,styl}]
12+
indent_size = 2
13+
1114
[*.md]
1215
trim_trailing_whitespace = false
13-
14-
[*.{yml,yaml}]
15-
indent_size = 2

.gitattributes

Lines changed: 10 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,11 @@
1-
# Path-based git attributes
2-
# https://www.kernel.org/pub/software/scm/git/docs/gitattributes.html
1+
* text=auto eol=lf
32

4-
# Ignore all test and documentation with "export-ignore".
5-
/.github export-ignore
6-
/.gitattributes export-ignore
7-
/.gitignore export-ignore
8-
/phpunit.xml.dist export-ignore
9-
/art export-ignore
10-
/docs export-ignore
11-
/tests export-ignore
12-
/workbench export-ignore
13-
/.editorconfig export-ignore
14-
/.php_cs.dist.php export-ignore
15-
/psalm.xml export-ignore
16-
/psalm.xml.dist export-ignore
17-
/testbench.yaml export-ignore
18-
/UPGRADING.md export-ignore
19-
/phpstan.neon.dist export-ignore
20-
/phpstan-baseline.neon export-ignore
3+
*.blade.php diff=html
4+
*.css diff=css
5+
*.html diff=html
6+
*.md diff=markdown
7+
*.php diff=php
8+
9+
/.github export-ignore
10+
CHANGELOG.md export-ignore
11+
.styleci.yml export-ignore

.github/workflows/run-tests.yml

Lines changed: 47 additions & 49 deletions
Original file line numberDiff line numberDiff line change
@@ -1,54 +1,52 @@
11
name: run-tests
22

33
on:
4-
push:
5-
paths:
6-
- "**.php"
7-
- ".github/workflows/run-tests.yml"
8-
- "phpunit.xml.dist"
9-
- "composer.json"
10-
- "composer.lock"
4+
push:
5+
paths:
6+
- "**.php"
7+
- ".github/workflows/run-tests.yml"
8+
- "phpunit.xml.dist"
9+
- "composer.json"
10+
- "composer.lock"
1111

1212
jobs:
13-
test:
14-
runs-on: ${{ matrix.os }}
15-
timeout-minutes: 5
16-
strategy:
17-
fail-fast: true
18-
matrix:
19-
os: [ubuntu-latest]
20-
php: [8.3, 8.2]
21-
stability: [prefer-lowest, prefer-stable]
22-
include:
23-
- laravel: 11.*
24-
testbench: 9.*
25-
carbon: ^3.1.1
26-
27-
name: P${{ matrix.php }} - L${{ matrix.laravel }} - ${{ matrix.stability }} - ${{ matrix.os }}
28-
29-
steps:
30-
- name: Checkout code
31-
uses: actions/checkout@v4
32-
33-
- name: Setup PHP
34-
uses: shivammathur/setup-php@v2
35-
with:
36-
php-version: ${{ matrix.php }}
37-
extensions: dom, curl, libxml, mbstring, zip, pcntl, pdo, sqlite, pdo_sqlite, bcmath, soap, intl, gd, exif, iconv, imagick, fileinfo
38-
coverage: none
39-
40-
- name: Setup problem matchers
41-
run: |
42-
echo "::add-matcher::${{ runner.tool_cache }}/php.json"
43-
echo "::add-matcher::${{ runner.tool_cache }}/phpunit.json"
44-
45-
- name: Install dependencies
46-
run: |
47-
composer require "laravel/framework:${{ matrix.laravel }}" "orchestra/testbench:${{ matrix.testbench }}" "nesbot/carbon:${{ matrix.os == 'windows-latest' && '^^^' || '' }}${{ matrix.carbon }}" --no-interaction --no-update
48-
composer update --${{ matrix.stability }} --prefer-dist --no-interaction
49-
50-
- name: List Installed Dependencies
51-
run: composer show -D
52-
53-
- name: Execute tests
54-
run: vendor/bin/pest --ci
13+
test:
14+
runs-on: ${{ matrix.os }}
15+
timeout-minutes: 5
16+
strategy:
17+
fail-fast: true
18+
matrix:
19+
os: [ubuntu-latest]
20+
php: [8.4, 8.3]
21+
include:
22+
- laravel: 12.*
23+
carbon: ^3.9.1
24+
25+
name: P${{ matrix.php }} - L${{ matrix.laravel }} - ${{ matrix.os }}
26+
27+
steps:
28+
- name: Checkout code
29+
uses: actions/checkout@v4
30+
31+
- name: Setup PHP
32+
uses: shivammathur/setup-php@v2
33+
with:
34+
php-version: ${{ matrix.php }}
35+
extensions: dom, curl, libxml, mbstring, zip, pcntl, pdo, sqlite, pdo_sqlite, bcmath, soap, intl, gd, exif, iconv, imagick, fileinfo
36+
coverage: none
37+
38+
- name: Setup problem matchers
39+
run: |
40+
echo "::add-matcher::${{ runner.tool_cache }}/php.json"
41+
echo "::add-matcher::${{ runner.tool_cache }}/phpunit.json"
42+
43+
- name: Install dependencies
44+
run: |
45+
composer require "laravel/framework:${{ matrix.laravel }}" "nesbot/carbon:${{ matrix.carbon }}" --no-interaction --no-update
46+
composer update --prefer-dist --no-interaction
47+
48+
- name: List Installed Dependencies
49+
run: composer show -D
50+
51+
- name: Execute tests
52+
run: vendor/bin/pest --ci

.gitignore

Lines changed: 29 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -1,32 +1,31 @@
1-
# Composer Related
2-
composer.lock
3-
/vendor
4-
5-
# Frontend Assets
6-
/node_modules
7-
8-
# Logs
9-
npm-debug.log
10-
yarn-error.log
11-
12-
# Caches
13-
.phpunit.cache
14-
.phpunit.result.cache
15-
/build
16-
17-
# IDE Helper
18-
_ide_helper.php
191
_ide_helper_models.php
2+
_ide_helper.php
3+
!.env.example
4+
.cache
5+
.data
6+
.DS_Store
7+
.env
8+
.env.*
9+
.fleet
10+
.idea
11+
.output
12+
.phpactor.json
2013
.phpstorm.meta.php
21-
22-
# Editors
23-
/.idea
24-
/.fleet
25-
/.vscode
26-
27-
# Misc
28-
phpunit.xml
29-
phpstan.neon
30-
testbench.yaml
31-
/docs
32-
/coverage
14+
.phpunit.cache
15+
.phpunit.result.cache
16+
.pnpm-store
17+
.vscode
18+
.zed
19+
*.log
20+
composer.lock
21+
/auth.json
22+
/bootstrap/ssr
23+
/dist
24+
/node_modules
25+
/public/build
26+
/public/hot
27+
/public/storage
28+
/public/vendor
29+
/storage/*.key
30+
/storage/pail
31+
/vendor

README.md

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -15,12 +15,6 @@ You can install the package via composer:
1515
composer require foxws/laravel-algos
1616
```
1717

18-
You can publish the config file with:
19-
20-
```bash
21-
php artisan vendor:publish --tag="algos-config"
22-
```
23-
2418
## Usage
2519

2620
Generate an `Algo` class (you may also use `php artisan make:algo MyAlgo`):

composer.json

Lines changed: 16 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22
"name": "foxws/laravel-algos",
33
"description": "Create algos for your Laravel application",
44
"keywords": [
5-
"foxws",
65
"laravel",
76
"laravel-algos",
87
"algo",
@@ -20,24 +19,24 @@
2019
],
2120
"require": {
2221
"php": "^8.2",
23-
"illuminate/console": "^10.0|^11.0",
24-
"illuminate/container": "^10.0|^11.0",
25-
"illuminate/contracts": "^10.0||^11.0",
26-
"illuminate/support": "^10.0|^11.0",
27-
"spatie/laravel-package-tools": "^1.16"
22+
"illuminate/cache": "^11.0|^12.0",
23+
"illuminate/console": "^11.0|^12.0",
24+
"illuminate/container": "^11.0|^12.0",
25+
"illuminate/contracts": "^11.0|^12.0",
26+
"illuminate/support": "^11.0|^12.0",
27+
"spatie/laravel-package-tools": "^1.9"
2828
},
2929
"require-dev": {
30-
"laravel/pint": "^1.14",
31-
"larastan/larastan": "^2.9",
32-
"nunomaduro/collision": "^8.1.1||^7.10.0",
33-
"orchestra/testbench": "^9.0.0||^8.22.0",
34-
"pestphp/pest": "^2.34",
35-
"pestphp/pest-plugin-arch": "^2.7",
36-
"pestphp/pest-plugin-laravel": "^2.3",
37-
"phpstan/extension-installer": "^1.3",
38-
"phpstan/phpstan-deprecation-rules": "^1.1",
39-
"phpstan/phpstan-phpunit": "^1.3",
40-
"spatie/laravel-ray": "^1.35"
30+
"larastan/larastan": "^3.4",
31+
"laravel/pint": "^1.22",
32+
"nunomaduro/collision": "^8.8",
33+
"orchestra/testbench": "^10.0",
34+
"pestphp/pest": "^3.7",
35+
"pestphp/pest-plugin-arch": "^3.1",
36+
"pestphp/pest-plugin-laravel": "^3.4",
37+
"phpstan/extension-installer": "^1.4.3",
38+
"phpstan/phpstan-deprecation-rules": "^2.0",
39+
"phpstan/phpstan-phpunit": "^2.0"
4140
},
4241
"autoload": {
4342
"psr-4": {

config/algos.php

Lines changed: 0 additions & 5 deletions
This file was deleted.

phpstan.neon.dist

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@ parameters:
55
level: 5
66
paths:
77
- src
8-
- config
98
- tests/database
109
tmpDir: build/phpstan
1110
checkOctaneCompatibility: true

src/AlgoServiceProvider.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@ public function configurePackage(Package $package): void
1212
{
1313
$package
1414
->name('laravel-algos')
15-
->hasConfigFile('algos')
1615
->hasCommands([
1716
MakeAlgo::class,
1817
]);

0 commit comments

Comments
 (0)