Skip to content

Update DevKit #33

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

Merged
merged 1 commit into from
Sep 30, 2023
Merged
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
11 changes: 6 additions & 5 deletions .github/workflows/deptrac.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ on:
pull_request:
branches:
- develop
- 'v*'
paths:
- '**.php'
- 'composer.*'
Expand All @@ -12,6 +13,7 @@ on:
push:
branches:
- develop
- 'v*'
paths:
- '**.php'
- 'composer.*'
Expand All @@ -31,21 +33,20 @@ jobs:
- name: Set up PHP
uses: shivammathur/setup-php@v2
with:
php-version: '8.0'
php-version: '8.1'
tools: phive
extensions: intl, json, mbstring, xml
coverage: none
env:
COMPOSER_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: Get composer cache directory
id: composer-cache
run: echo "::set-output name=dir::$(composer config cache-files-dir)"
run: echo "COMPOSER_CACHE_FILES_DIR=$(composer config cache-files-dir)" >> $GITHUB_ENV

- name: Cache composer dependencies
uses: actions/cache@v3
with:
path: ${{ steps.composer-cache.outputs.dir }}
path: ${{ env.COMPOSER_CACHE_FILES_DIR }}
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.json') }}-${{ hashFiles('**/composer.lock') }}
restore-keys: ${{ runner.os }}-composer-

Expand Down
25 changes: 6 additions & 19 deletions .github/workflows/infection.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,15 +10,6 @@ on:
- 'composer.*'
- 'phpunit*'
- '.github/workflows/infection.yml'
push:
branches:
- develop
- 'v*'
paths:
- '**.php'
- 'composer.*'
- 'phpunit*'
- '.github/workflows/infection.yml'

jobs:
main:
Expand All @@ -33,12 +24,12 @@ jobs:
- name: Set up PHP
uses: shivammathur/setup-php@v2
with:
php-version: '8.0'
php-version: '8.1'
tools: infection, phpunit
extensions: intl, json, mbstring, gd, xml, sqlite3
coverage: xdebug
env:
COMPOSER_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: Set up problem matchers for PHPUnit
run: echo "::add-matcher::${{ runner.tool_cache }}/phpunit.json"
Expand All @@ -47,13 +38,12 @@ jobs:
uses: mheap/phpunit-matcher-action@v1

- name: Get composer cache directory
id: composer-cache
run: echo "::set-output name=dir::$(composer config cache-files-dir)"
run: echo "COMPOSER_CACHE_FILES_DIR=$(composer config cache-files-dir)" >> $GITHUB_ENV

- name: Cache composer dependencies
uses: actions/cache@v3
with:
path: ${{ steps.composer-cache.outputs.dir }}
path: ${{ env.COMPOSER_CACHE_FILES_DIR }}
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.json') }}-${{ hashFiles('**/composer.lock') }}
restore-keys: ${{ runner.os }}-composer-

Expand All @@ -65,10 +55,7 @@ jobs:
composer update --no-progress --no-interaction --prefer-dist --optimize-autoloader
fi

- name: Test with PHPUnit
run: vendor/bin/phpunit --teamcity

- name: Mutate with Infection
- name: Run Infection for added files only
run: |
git fetch --depth=1 origin $GITHUB_BASE_REF
infection --threads=2 --skip-initial-tests --coverage=build/phpunit --git-diff-base=origin/$GITHUB_BASE_REF --git-diff-filter=AM --logger-github --ignore-msi-with-no-mutations
infection --threads=max --git-diff-lines --git-diff-base=origin/$GITHUB_BASE_REF --ignore-msi-with-no-mutations --only-covered --logger-github
2 changes: 1 addition & 1 deletion .github/workflows/phpcpd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ jobs:
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: '8.0'
php-version: '8.1'
tools: phpcpd
extensions: dom, mbstring
coverage: none
Expand Down
15 changes: 5 additions & 10 deletions .github/workflows/phpcsfixer.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,13 +18,9 @@ on:

jobs:
build:
name: PHP ${{ matrix.php-versions }} Coding Standards
name: Coding Standards
runs-on: ubuntu-latest
if: "!contains(github.event.head_commit.message, '[ci skip]')"
strategy:
fail-fast: false
matrix:
php-versions: ['7.4', '8.0', '8.1']

steps:
- name: Checkout
Expand All @@ -33,20 +29,19 @@ jobs:
- name: Set up PHP
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php-versions }}
php-version: '8.1'
extensions: json, tokenizer
coverage: none
env:
COMPOSER_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: Get composer cache directory
id: composer-cache
run: echo "::set-output name=dir::$(composer config cache-files-dir)"
run: echo "COMPOSER_CACHE_FILES_DIR=$(composer config cache-files-dir)" >> $GITHUB_ENV

- name: Cache composer dependencies
uses: actions/cache@v3
with:
path: ${{ steps.composer-cache.outputs.dir }}
path: ${{ env.COMPOSER_CACHE_FILES_DIR }}
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.json') }}-${{ hashFiles('**/composer.lock') }}
restore-keys: ${{ runner.os }}-composer-

Expand Down
11 changes: 6 additions & 5 deletions .github/workflows/phpstan.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ on:
pull_request:
branches:
- develop
- 'v*'
paths:
- '**.php'
- 'composer.*'
Expand All @@ -12,6 +13,7 @@ on:
push:
branches:
- develop
- 'v*'
paths:
- '**.php'
- 'composer.*'
Expand All @@ -26,7 +28,7 @@ jobs:
strategy:
fail-fast: false
matrix:
php-versions: ['7.4', '8.0', '8.1']
php-versions: ['7.4', '8.0', '8.1', '8.2']

steps:
- name: Checkout
Expand All @@ -40,16 +42,15 @@ jobs:
extensions: intl, json, mbstring, xml
coverage: none
env:
COMPOSER_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: Get composer cache directory
id: composer-cache
run: echo "::set-output name=dir::$(composer config cache-files-dir)"
run: echo "COMPOSER_CACHE_FILES_DIR=$(composer config cache-files-dir)" >> $GITHUB_ENV

- name: Cache composer dependencies
uses: actions/cache@v3
with:
path: ${{ steps.composer-cache.outputs.dir }}
path: ${{ env.COMPOSER_CACHE_FILES_DIR }}
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.json') }}-${{ hashFiles('**/composer.lock') }}
restore-keys: ${{ runner.os }}-composer-

Expand Down
13 changes: 7 additions & 6 deletions .github/workflows/phpunit.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ on:
pull_request:
branches:
- develop
- 'v*'
paths:
- '**.php'
- 'composer.*'
Expand All @@ -12,6 +13,7 @@ on:
push:
branches:
- develop
- 'v*'
paths:
- '**.php'
- 'composer.*'
Expand All @@ -25,7 +27,7 @@ jobs:
if: "!contains(github.event.head_commit.message, '[ci skip]')"
strategy:
matrix:
php-versions: ['7.4', '8.0', '8.1']
php-versions: ['7.4', '8.0', '8.1', '8.2']

steps:
- name: Checkout
Expand All @@ -39,16 +41,15 @@ jobs:
extensions: intl, json, mbstring, gd, xdebug, xml, sqlite3
coverage: xdebug
env:
COMPOSER_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: Get composer cache directory
id: composer-cache
run: echo "::set-output name=dir::$(composer config cache-files-dir)"
run: echo "COMPOSER_CACHE_FILES_DIR=$(composer config cache-files-dir)" >> $GITHUB_ENV

- name: Cache composer dependencies
uses: actions/cache@v3
with:
path: ${{ steps.composer-cache.outputs.dir }}
path: ${{ env.COMPOSER_CACHE_FILES_DIR }}
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.json') }}-${{ hashFiles('**/composer.lock') }}
restore-keys: ${{ runner.os }}-composer-

Expand All @@ -66,7 +67,7 @@ jobs:
TERM: xterm-256color
TACHYCARDIA_MONITOR_GA: enabled

- if: matrix.php-versions == '8.0'
- if: matrix.php-versions == '8.1'
name: Run Coveralls
continue-on-error: true
run: |
Expand Down
9 changes: 4 additions & 5 deletions .github/workflows/psalm.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,21 +33,20 @@ jobs:
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: '8.0'
php-version: '8.1'
tools: phpstan, phpunit
extensions: intl, json, mbstring, xml
coverage: none
env:
COMPOSER_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: Get composer cache directory
id: composer-cache
run: echo "::set-output name=dir::$(composer config cache-files-dir)"
run: echo "COMPOSER_CACHE_FILES_DIR=$(composer config cache-files-dir)" >> $GITHUB_ENV

- name: Cache composer dependencies
uses: actions/cache@v3
with:
path: ${{ steps.composer-cache.outputs.dir }}
path: ${{ env.COMPOSER_CACHE_FILES_DIR }}
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.json') }}-${{ hashFiles('**/composer.lock') }}
restore-keys: ${{ runner.os }}-composer-

Expand Down
13 changes: 5 additions & 8 deletions .github/workflows/rector.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ jobs:
strategy:
fail-fast: false
matrix:
php-versions: ['7.4', '8.0', '8.1']
php-versions: ['7.4', '8.0', '8.1', '8.2']

steps:
- name: Checkout
Expand All @@ -42,16 +42,15 @@ jobs:
extensions: intl, json, mbstring, xml
coverage: none
env:
COMPOSER_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: Get composer cache directory
id: composer-cache
run: echo "::set-output name=dir::$(composer config cache-files-dir)"
run: echo "COMPOSER_CACHE_FILES_DIR=$(composer config cache-files-dir)" >> $GITHUB_ENV

- name: Cache composer dependencies
uses: actions/cache@v3
with:
path: ${{ steps.composer-cache.outputs.dir }}
path: ${{ env.COMPOSER_CACHE_FILES_DIR }}
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.json') }}-${{ hashFiles('**/composer.lock') }}
restore-keys: ${{ runner.os }}-composer-

Expand All @@ -64,6 +63,4 @@ jobs:
fi

- name: Analyze for refactoring
run: |
composer global require --dev rector/rector:^0.12.16
rector process --dry-run --no-progress-bar
run: vendor/bin/rector process --dry-run --no-progress-bar
18 changes: 15 additions & 3 deletions .php-cs-fixer.dist.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,22 @@
__DIR__ . '/src/',
__DIR__ . '/tests/',
])
->exclude('build')
->append([__FILE__]);
->exclude([
'build',
'Views',
])
->append([
__FILE__,
__DIR__ . '/rector.php',
]);

$overrides = [];
$overrides = [
'php_unit_data_provider_name' => false,
'php_unit_data_provider_return_type' => false,
'php_unit_data_provider_static' => false,
// 'declare_strict_types' => true,
// 'void_return' => true,
];

$options = [
'finder' => $finder,
Expand Down
14 changes: 6 additions & 8 deletions composer-unused.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,9 @@
use ComposerUnused\ComposerUnused\Configuration\PatternFilter;
use Webmozart\Glob\Glob;

return static function (Configuration $config): Configuration {
return $config
// ->addNamedFilter(NamedFilter::fromString('symfony/config'))
// ->addPatternFilter(PatternFilter::fromString('/symfony-.*/'))
->setAdditionalFilesFor('codeigniter4/framework', [
...Glob::glob(__DIR__ . '/vendor/codeigniter4/framework/system/Helpers/*.php'),
]);
};
return static fn (Configuration $config): Configuration => $config
// ->addNamedFilter(NamedFilter::fromString('symfony/config'))
// ->addPatternFilter(PatternFilter::fromString('/symfony-.*/'))
->setAdditionalFilesFor('codeigniter4/framework', [
...Glob::glob(__DIR__ . '/vendor/codeigniter4/framework/system/Helpers/*.php'),
]);
5 changes: 3 additions & 2 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -72,15 +72,16 @@
"scripts": {
"analyze": [
"phpstan analyze",
"psalm"
"psalm",
"rector process --dry-run"
],
"ci": [
"Composer\\Config::disableProcessTimeout",
"@deduplicate",
"@analyze",
"@composer normalize --dry-run",
"@test",
"@inspect",
"rector process",
"@style"
],
"deduplicate": "phpcpd app/ src/",
Expand Down
2 changes: 1 addition & 1 deletion deptrac.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ parameters:
Service:
- Config
- Vendor Config

# Ignore anything in the Vendor layers
Vendor Model:
- Config
Expand Down
2 changes: 2 additions & 0 deletions psalm.xml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@
xsi:schemaLocation="https://getpsalm.org/schema/config vendor/vimeo/psalm/config.xsd"
autoloader="psalm_autoload.php"
cacheDirectory="build/psalm/"
findUnusedBaselineEntry="true"
findUnusedCode="false"
>
<projectFiles>
<directory name="src/" />
Expand Down
Loading