Skip to content

Commit

Permalink
Merge branch 'master' into mp-phpdoctag
Browse files Browse the repository at this point in the history
  • Loading branch information
barryvdh authored Feb 7, 2024
2 parents 1ce298f + f465625 commit bf1447c
Show file tree
Hide file tree
Showing 106 changed files with 3,245 additions and 489 deletions.
6 changes: 6 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,11 @@
/.gitattributes export-ignore
/.github export-ignore
/.gitignore export-ignore
/.editorconfig export-ignore
/phpunit.xml.dist export-ignore
/tests export-ignore
/.php_cs.common.php export-ignore
/.php_cs.dist export-ignore
/.php_cs.tests.php export-ignore
/psalm.xml export-ignore
/psalm-baseline.xml export-ignore
11 changes: 2 additions & 9 deletions .github/FUNDING.yml
Original file line number Diff line number Diff line change
@@ -1,12 +1,5 @@
# These are supported funding model platforms

github: barryvdh
patreon: # Replace with a single Patreon username
open_collective: # Replace with a single Open Collective username
ko_fi: # Replace with a single Ko-fi username
tidelift: # Replace with a single Tidelift platform-name/package-name e.g., npm/babel
community_bridge: # Replace with a single Community Bridge project-name e.g., cloud-foundry
liberapay: # Replace with a single Liberapay username
issuehunt: # Replace with a single IssueHunt username
otechie: # Replace with a single Otechie username
custom: # Replace with up to 4 custom sponsorship URLs e.g., ['link1', 'link2']
custom: ['https://fruitcake.nl']

1 change: 0 additions & 1 deletion .github/ISSUE_TEMPLATE/1_Bug_report.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ labels: bug
### Versions:
- ide-helper Version: #.#.#
- Laravel Version: #.#.# <!-- remove if not applicable -->
- Lumen Version: #.#.# <!-- remove if not applicable -->
- PHP Version: #.#.#

### Description:
Expand Down
1 change: 0 additions & 1 deletion .github/ISSUE_TEMPLATE/3_Support_question.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ labels: question
### Versions:
- ide-helper Version: #.#.#
- Laravel Version: #.#.# <!-- remove if not applicable -->
- Lumen Version: #.#.# <!-- remove if not applicable -->
- PHP Version: #.#.#

### Question:
Expand Down
10 changes: 10 additions & 0 deletions .github/dependabot.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
version: 2
updates:
- package-ecosystem: github-actions
directory: /
schedule:
interval: monthly
groups:
deps:
patterns:
- '*'
6 changes: 4 additions & 2 deletions .github/workflows/composer-normalize.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ name: normalize composer.json
on:
push:
paths:
- .github/workflows/composer-normalize.yml
- composer.json

jobs:
Expand All @@ -11,16 +12,17 @@ jobs:
runs-on: ubuntu-20.04
steps:
- name: Git checkout
uses: actions/checkout@v2
uses: actions/checkout@v4

- name: Validate Composer configuration
run: composer validate --strict

- name: Normalize composer.json
run: |
composer global config --no-plugins allow-plugins.ergebnis/composer-normalize true
composer global require ergebnis/composer-normalize
composer normalize
- uses: stefanzweifel/git-auto-commit-action@v4.0.0
- uses: stefanzweifel/git-auto-commit-action@v5
with:
commit_message: normalize composer.json
6 changes: 3 additions & 3 deletions .github/workflows/fix-code-style.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,12 @@ jobs:

steps:
- name: Checkout code
uses: actions/checkout@v2
uses: actions/checkout@v4

- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: 7.4
php-version: 8.0
coverage: none

- name: Install dependencies
Expand All @@ -27,7 +27,7 @@ jobs:
- run: composer fix-style
continue-on-error: true

- uses: stefanzweifel/git-auto-commit-action@v4
- uses: stefanzweifel/git-auto-commit-action@v5
with:
commit_message: composer fix-style
commit_author: laravel-ide-helper <[email protected]>
87 changes: 22 additions & 65 deletions .github/workflows/run-integration-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,76 +11,25 @@ on:
- cron: '0 0 * * *'

jobs:
php-lumen-integration-tests:
runs-on: ubuntu-20.04
timeout-minutes: 15
env:
COMPOSER_NO_INTERACTION: 1
strategy:
matrix:
php: [8.0, 7.4, 7.3]
lumen: [8.*]
name: P${{ matrix.php }} - Lumen${{ matrix.lumen }}
steps:
- name: Checkout code
uses: actions/checkout@v2
with:
path: src

- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php }}
coverage: none

- name: Install dependencies
run: |
composer create-project --prefer-dist laravel/lumen:${{ matrix.lumen }} --no-progress sample
cd sample
composer require "league/flysystem:^1" --no-update --no-progress
composer update --prefer-stable --prefer-dist --no-progress
- name: Add package from source
run: |
cd sample
sed -e 's|"type": "project",|&\n"repositories": [ { "type": "path", "url": "../src" } ],|' -i composer.json
composer require --dev "barryvdh/laravel-ide-helper:*"
- name: Insert service provider
run: sed -e 's|// \$app->register(App\\\Providers\\\EventServiceProvider::class);|&\n$app->register(\\Barryvdh\\LaravelIdeHelper\\IdeHelperServiceProvider::class);|' -i sample/bootstrap/app.php

- name: Execute generate run
run: |
cd sample
php artisan ide-helper:generate
- name: Execute meta run
run: |
cd sample
php artisan ide-helper:meta
- name: Check file existence
run: |
ls sample/_ide_helper.php
ls sample/.phpstorm.meta.php
- name: Check file count in logs
run: |
if [ `ls -1q "sample/storage/logs/" | wc -l` -gt 0 ];then exit 1;fi
php-laravel-integration-tests:
runs-on: ubuntu-20.04
timeout-minutes: 15
env:
COMPOSER_NO_INTERACTION: 1
strategy:
fail-fast: false
matrix:
php: [8.0, 7.4, 7.3]
laravel: [8.*]
php: [8.3, 8.2, 8.1, 8.0]
laravel: [10.*, 9.*]
exclude:
- php: 8.0
laravel: 10.*
- php: 8.3
laravel: 9.*
name: P${{ matrix.php }} - Laravel${{ matrix.laravel }}
steps:
- name: Checkout code
uses: actions/checkout@v2
uses: actions/checkout@v4
with:
path: src

Expand All @@ -92,15 +41,16 @@ jobs:

- name: Install dependencies
run: |
composer create-project --prefer-dist laravel/laravel:${{ matrix.laravel }} --no-progress sample
composer create-project --prefer-dist laravel/laravel:${{ matrix.laravel }} --stability=dev --no-progress sample
cd sample
composer config minimum-stability dev
composer update --prefer-stable --prefer-dist --no-progress
- name: Add package from source
run: |
cd sample
sed -e 's|"type": "project",|&\n"repositories": [ { "type": "path", "url": "../src" } ],|' -i composer.json
composer require --dev "barryvdh/laravel-ide-helper:*"
composer require --dev "barryvdh/laravel-ide-helper:*" --with-all-dependencies
- name: Execute generate run
run: |
Expand All @@ -110,13 +60,20 @@ jobs:
- name: Execute meta run
run: |
cd sample
php artisan ide-helper:meta
php artisan ide-helper:meta -v
- name: Check file existence
run: |
ls sample/_ide_helper.php
ls sample/.phpstorm.meta.php
- name: Check file count in logs
- name: Check logs
run: |
if [ `ls -1q "sample/storage/logs/" | wc -l` -gt 0 ];then exit 1;fi
if [ `ls -1q "sample/storage/logs/" | wc -l` -gt 0 ]; then
for logfile in sample/storage/logs/*; do
echo "-- $logfile --"
cat $logfile
done
exit 1
fi
4 changes: 2 additions & 2 deletions .github/workflows/run-static-analysis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,12 @@ jobs:
runs-on: ubuntu-20.04

steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4

- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: 7.4
php-version: 8.0
coverage: none
extensions: pdo_sqlite

Expand Down
24 changes: 15 additions & 9 deletions .github/workflows/run-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,39 +12,45 @@ on:

jobs:
php-tests:
runs-on: ubuntu-20.04
runs-on: ${{ matrix.os }}
timeout-minutes: 15
env:
COMPOSER_NO_INTERACTION: 1

strategy:
matrix:
php: [8.0, 7.4, 7.3]
laravel: [8.*]
os: [ubuntu-20.04, windows-2019]
php: [8.3, 8.2, 8.1, 8.0]
laravel: [9.*, 10.*]
dependency-version: [prefer-lowest, prefer-stable]
exclude:
- php: 8.0
laravel: 10.*
- php: 8.0
dependency-version: prefer-lowest

name: P${{ matrix.php }} - L${{ matrix.laravel }} - ${{ matrix.dependency-version }}

steps:
- name: Set git to use LF
if: ${{ matrix.os == 'windows-2019' }}
run: |
git config --global core.autocrlf false
git config --global core.eol lf
- name: Checkout code
uses: actions/checkout@v2
uses: actions/checkout@v4

- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php }}
coverage: none
extensions: pdo_sqlite
extensions: pdo_sqlite, fileinfo

- name: Install dependencies
run: |
composer remove vimeo/psalm --no-update --dev
composer remove friendsofphp/php-cs-fixer --no-update --dev
composer require "laravel/framework:${{ matrix.laravel }}" --no-update --no-progress
composer update --${{ matrix.dependency-version }} --prefer-dist --no-progress
composer update --prefer-dist --no-progress
- name: Execute Unit Tests
run: composer test-ci
6 changes: 3 additions & 3 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
.phpunit.result.cache

/.idea
/.php_cs
/.php_cs.cache
/.php_cs.tests.cache
/.php-cs-fixer.cache
/.php-cs-fixer.php
/.php-cs-fixer.tests.cache
/composer.lock
/vendor
9 changes: 3 additions & 6 deletions .php_cs.common.php → .php-cs-fixer.common.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,10 @@

// Share common rules between non-test and test files
return [
// PSR12 from https://github.com/FriendsOfPHP/PHP-CS-Fixer/pull/4943
'@PSR2' => true,
'@PSR12' => true,
'blank_line_after_opening_tag' => true,
'braces' => [
// Not-yet-implemented
// 'allow_single_line_anonymous_class_with_empty_body' => true,
'allow_single_line_anonymous_class_with_empty_body' => true,
],
'compact_nullable_typehint' => true,
'declare_equal_normalize' => true,
Expand All @@ -32,7 +30,6 @@
],
'return_type_declaration' => true,
'short_scalar_cast' => true,
'single_blank_line_before_namespace' => true,
'single_trait_insert_per_statement' => true,
'ternary_operator_spaces' => true,
'visibility_required' => [
Expand All @@ -58,7 +55,7 @@
'no_unused_imports' => true,
'single_quote' => true,
'space_after_semicolon' => true,
'trailing_comma_in_multiline_array' => true,
'trailing_comma_in_multiline' => true,
'trim_array_spaces' => true,
'unary_operator_spaces' => true,
'whitespace_after_comma_in_array' => true,
Expand Down
6 changes: 3 additions & 3 deletions .php_cs.dist → .php-cs-fixer.dist.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,10 @@
->in(__DIR__)
->exclude('tests');

$config = require __DIR__ . '/.php_cs.common.php';
$config = require __DIR__ . '/.php-cs-fixer.common.php';

return PhpCsFixer\Config::create()
return (new PhpCsFixer\Config())
->setFinder($finder)
->setRules($config)
->setRiskyAllowed(true)
->setCacheFile(__DIR__ . '/.php_cs.cache');
->setCacheFile(__DIR__ . '/.php-cs-fixer.cache');
6 changes: 3 additions & 3 deletions .php_cs.tests.php → .php-cs-fixer.tests.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
->in(__DIR__ . '/tests')
->exclude('__snapshots__');

$config = require __DIR__ . '/.php_cs.common.php';
$config = require __DIR__ . '/.php-cs-fixer.common.php';

// Additional rules for tests
$config = array_merge(
Expand All @@ -15,8 +15,8 @@
]
);

return PhpCsFixer\Config::create()
return (new PhpCsFixer\Config())
->setFinder($finder)
->setRules($config)
->setRiskyAllowed(true)
->setCacheFile(__DIR__ . '/.php_cs.tests.cache');
->setCacheFile(__DIR__ . '/.php-cs-fixer.tests.cache');
Loading

0 comments on commit bf1447c

Please sign in to comment.