Skip to content

Commit

Permalink
Add support to CodeIgniter v4.4
Browse files Browse the repository at this point in the history
  • Loading branch information
MGatner committed Sep 28, 2023
1 parent 534c80d commit 5e4699a
Show file tree
Hide file tree
Showing 15 changed files with 279 additions and 279 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/infection.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ jobs:
- name: Set up PHP
uses: shivammathur/setup-php@v2
with:
php-version: '8.0'
php-version: '8.2'
tools: infection, phpunit
extensions: intl, json, mbstring, gd, xml, sqlite3
coverage: xdebug
Expand Down
14 changes: 5 additions & 9 deletions .github/workflows/rector.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,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,29 +40,25 @@ 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-

- name: Install dependencies
run: |
composer -q config -g github-oauth.github.com "${{ secrets.GITHUB_TOKEN }}"
if [ -f composer.lock ]; then
composer install --no-progress --no-interaction --prefer-dist --optimize-autoloader
else
composer update --no-progress --no-interaction --prefer-dist --optimize-autoloader
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
6 changes: 5 additions & 1 deletion .php-cs-fixer.dist.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,11 @@
->exclude('build')
->append([__FILE__]);

$overrides = [];
$overrides = [
'php_unit_data_provider_return_type' => false,
'php_unit_data_provider_name' => false,
'php_unit_data_provider_static' => false,
];

$options = [
'finder' => $finder,
Expand Down
155 changes: 0 additions & 155 deletions depfile.yaml

This file was deleted.

156 changes: 156 additions & 0 deletions deptrac.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,156 @@
parameters:
paths:
- ./src/
- ./vendor/codeigniter4/framework/system/
exclude_files:
- '#.*test.*#i'
layers:
- name: Model
collectors:
- type: bool
must:
- type: className
regex: .*[A-Za-z]+Model$
must_not:
- type: directory
regex: vendor/.*
- name: Vendor Model
collectors:
- type: bool
must:
- type: className
regex: .*[A-Za-z]+Model$
- type: directory
regex: vendor/.*
- name: Controller
collectors:
- type: bool
must:
- type: className
regex: .*\/Controllers\/.*
must_not:
- type: directory
regex: vendor/.*
- name: Vendor Controller
collectors:
- type: bool
must:
- type: className
regex: .*\/Controllers\/.*
- type: directory
regex: vendor/.*
- name: Config
collectors:
- type: bool
must:
- type: directory
regex: src/Config/.*
must_not:
- type: className
regex: .*Services
- type: directory
regex: vendor/.*
- name: Vendor Config
collectors:
- type: bool
must:
- type: directory
regex: vendor/.*/Config/.*
must_not:
- type: className
regex: .*Services
- name: Entity
collectors:
- type: bool
must:
- type: directory
regex: src/Entities/.*
must_not:
- type: directory
regex: vendor/.*
- name: Vendor Entity
collectors:
- type: bool
must:
- type: directory
regex: vendor/.*/Entities/.*
- name: View
collectors:
- type: bool
must:
- type: directory
regex: src/Views/.*
must_not:
- type: directory
regex: vendor/.*
- name: Vendor View
collectors:
- type: bool
must:
- type: directory
regex: vendor/.*/Views/.*
- name: Service
collectors:
- type: className
regex: .*Services.*
ruleset:
Entity:
- Config
- Model
- Service
- Vendor Config
- Vendor Entity
- Vendor Model
Config:
- Service
- Vendor Config
Model:
- Config
- Entity
- Service
- Vendor Config
- Vendor Entity
- Vendor Model
Service:
- Config
- Vendor Config

# Ignore anything in the Vendor layers
Vendor Model:
- Config
- Service
- Vendor Config
- Vendor Controller
- Vendor Entity
- Vendor Model
- Vendor View
Vendor Controller:
- Service
- Vendor Config
- Vendor Controller
- Vendor Entity
- Vendor Model
- Vendor View
Vendor Config:
- Config
- Service
- Vendor Config
- Vendor Controller
- Vendor Entity
- Vendor Model
- Vendor View
Vendor Entity:
- Service
- Vendor Config
- Vendor Controller
- Vendor Entity
- Vendor Model
- Vendor View
Vendor View:
- Service
- Vendor Config
- Vendor Controller
- Vendor Entity
- Vendor Model
- Vendor View
skip_violations:
Loading

0 comments on commit 5e4699a

Please sign in to comment.