Skip to content

chore: update workflow to support PHP 8.4 #83

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

Open
wants to merge 4 commits into
base: develop
Choose a base branch
from
Open
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
5 changes: 4 additions & 1 deletion .github/workflows/deptrac.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,9 @@ on:
- 'depfile.yaml'
- '.github/workflows/deptrac.yml'

permissions:
contents: read

jobs:
build:
name: Dependency Tracing
Expand All @@ -31,7 +34,7 @@ jobs:
- name: Set up PHP
uses: shivammathur/setup-php@v2
with:
php-version: '8.1'
php-version: '8.2'
extensions: intl, json, mbstring, xml
coverage: none
env:
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/phpcpd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,10 @@ jobs:
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: '8.1'
php-version: '8.2'
tools: phpcpd
extensions: dom, mbstring
coverage: none

- name: Detect duplicate code
run: phpcpd app/ tests/
run: phpcpd src/
19 changes: 16 additions & 3 deletions .github/workflows/phpcsfixer.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,22 @@ on:
- '**.php'
- '.github/workflows/phpcsfixer.yml'

concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
cancel-in-progress: true

permissions:
contents: read

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

steps:
- name: Checkout
Expand All @@ -27,7 +38,7 @@ jobs:
- name: Set up PHP
uses: shivammathur/setup-php@v2
with:
php-version: '8.1'
php-version: ${{ matrix.php-versions }}
extensions: json, tokenizer
coverage: none
env:
Expand All @@ -53,3 +64,5 @@ jobs:

- name: Check code for standards compliance
run: vendor/bin/php-cs-fixer fix --verbose --ansi --dry-run --using-cache=no --diff
env:
PHP_CS_FIXER_IGNORE_ENV: ${{ matrix.php-versions == '8.4' }}
2 changes: 1 addition & 1 deletion .github/workflows/phpstan.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: ['8.1', '8.2', '8.3']
php-versions: ['8.1', '8.4']

steps:
- name: Checkout
Expand Down
22 changes: 19 additions & 3 deletions .github/workflows/phpunit.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,14 +20,30 @@ on:

jobs:
main:
name: PHP ${{ matrix.php-versions }} Unit Tests
name: PHP ${{ matrix.php-versions }}
runs-on: ubuntu-latest
if: "!contains(github.event.head_commit.message, '[ci skip]')"
strategy:
matrix:
php-versions: ['8.1', '8.2', '8.3']
php-versions: ['8.1', '8.2', '8.3', '8.4']

steps:
- name: Free Disk Space (Ubuntu)
uses: jlumbroso/free-disk-space@main
with:
# this might remove tools that are actually needed,
# if set to "true" but frees about 6 GB
tool-cache: false

# all of these default to true, but feel free to set to
# "false" if necessary for your workflow
android: true
dotnet: true
haskell: true
large-packages: false
docker-images: true
swap-storage: true

- name: Checkout
uses: actions/checkout@v4

Expand Down Expand Up @@ -65,7 +81,7 @@ jobs:
TERM: xterm-256color
TACHYCARDIA_MONITOR_GA: enabled

- if: matrix.php-versions == '8.0'
- if: matrix.php-versions == '8.2'
name: Run Coveralls
continue-on-error: true
run: |
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/psalm.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ jobs:
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: '8.1'
php-version: '8.2'
tools: phpstan, phpunit
extensions: intl, json, mbstring, xml
coverage: none
Expand Down
2 changes: 1 addition & 1 deletion .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: ['8.1', '8.2', '8.3']
php-versions: ['8.2', '8.4']

steps:
- name: Checkout
Expand Down
184 changes: 184 additions & 0 deletions phpstan-baseline.neon
Original file line number Diff line number Diff line change
@@ -0,0 +1,184 @@
parameters:
ignoreErrors:
-
message: '#^Call to an undefined method CodeIgniter\\View\\RendererInterface\:\:renderFragments\(\)\.$#'
identifier: method.notFound
count: 1
path: src/Common.php

-
message: '''
#^Call to deprecated method __construct\(\) of class CodeIgniter\\HTTP\\Response\:
4\.5\.0 The param \$config is no longer used\.$#
'''
identifier: method.deprecated
count: 2
path: src/Config/Services.php

-
message: '#^Call to an undefined method CodeIgniter\\View\\RendererInterface\:\:parseFragments\(\)\.$#'
identifier: method.notFound
count: 1
path: src/View/View.php

-
message: '#^Call to method PHPUnit\\Framework\\Assert\:\:assertArrayHasKey\(\) with ''_ci_previous_url'' and non\-empty\-array will always evaluate to true\.$#'
identifier: method.alreadyNarrowedType
count: 2
path: tests/CodeIgniterTest.php

-
message: '#^Call to method PHPUnit\\Framework\\Assert\:\:assertSame\(\) with ''https\://example\.com…'' and ''https\://example\.com…'' will always evaluate to false\.$#'
identifier: method.impossibleType
count: 1
path: tests/CodeIgniterTest.php

-
message: '#^Call to method PHPUnit\\Framework\\Assert\:\:assertSame\(\) with ''https\://example\.com…'' and ''https\://example\.com…'' will always evaluate to true\.$#'
identifier: method.alreadyNarrowedType
count: 1
path: tests/CodeIgniterTest.php

-
message: '''
#^Call to deprecated method __construct\(\) of class CodeIgniter\\HTTP\\Response\:
4\.5\.0 The param \$config is no longer used\.$#
'''
identifier: method.deprecated
count: 1
path: tests/HTTP/RedirectResponseTest.php

-
message: '''
#^Call to deprecated method __construct\(\) of class CodeIgniter\\HTTP\\Response\:
4\.5\.0 The param \$config is no longer used\.$#
'''
identifier: method.deprecated
count: 1
path: tests/HTTP/ResponseTest.php

-
message: '#^Variable \$this might not be defined\.$#'
identifier: variable.undefined
count: 2
path: tests/_support/Views/complex/include.php

-
message: '#^Variable \$this might not be defined\.$#'
identifier: variable.undefined
count: 2
path: tests/_support/Views/complex/layout.php

-
message: '#^Variable \$this might not be defined\.$#'
identifier: variable.undefined
count: 5
path: tests/_support/Views/complex/view1.php

-
message: '#^Variable \$this might not be defined\.$#'
identifier: variable.undefined
count: 2
path: tests/_support/Views/complex/view2.php

-
message: '#^Variable \$this might not be defined\.$#'
identifier: variable.undefined
count: 2
path: tests/_support/Views/complex/view3.php

-
message: '#^Variable \$this might not be defined\.$#'
identifier: variable.undefined
count: 1
path: tests/_support/Views/default_include.php

-
message: '#^Variable \$this might not be defined\.$#'
identifier: variable.undefined
count: 2
path: tests/_support/Views/huge/include.php

-
message: '#^Variable \$this might not be defined\.$#'
identifier: variable.undefined
count: 4
path: tests/_support/Views/huge/layout.php

-
message: '#^Variable \$this might not be defined\.$#'
identifier: variable.undefined
count: 6
path: tests/_support/Views/huge/view.php

-
message: '#^Variable \$this might not be defined\.$#'
identifier: variable.undefined
count: 3
path: tests/_support/Views/layout.php

-
message: '#^Variable \$this might not be defined\.$#'
identifier: variable.undefined
count: 5
path: tests/_support/Views/many/layout.php

-
message: '#^Variable \$this might not be defined\.$#'
identifier: variable.undefined
count: 9
path: tests/_support/Views/many/view1.php

-
message: '#^Variable \$this might not be defined\.$#'
identifier: variable.undefined
count: 4
path: tests/_support/Views/view_fragment.php

-
message: '#^Variable \$this might not be defined\.$#'
identifier: variable.undefined
count: 1
path: tests/_support/Views/view_fragment_error.php

-
message: '#^Variable \$this might not be defined\.$#'
identifier: variable.undefined
count: 4
path: tests/_support/Views/view_fragment_in_view_fragment.php

-
message: '#^Variable \$this might not be defined\.$#'
identifier: variable.undefined
count: 2
path: tests/_support/Views/view_included_2.php

-
message: '#^Variable \$this might not be defined\.$#'
identifier: variable.undefined
count: 3
path: tests/_support/Views/view_with_include_1.php

-
message: '#^Variable \$this might not be defined\.$#'
identifier: variable.undefined
count: 3
path: tests/_support/Views/view_with_include_2.php

-
message: '#^Variable \$testString might not be defined\.$#'
identifier: variable.undefined
count: 1
path: tests/_support/Views/with_decorator.php

-
message: '#^Variable \$this might not be defined\.$#'
identifier: variable.undefined
count: 7
path: tests/_support/Views/with_fragment.php

-
message: '#^Variable \$testString might not be defined\.$#'
identifier: variable.undefined
count: 1
path: tests/_support/Views/without_decorator.php
6 changes: 2 additions & 4 deletions phpstan.neon.dist
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
includes:
- phpstan-baseline.neon
parameters:
tmpDir: build/phpstan
level: 5
Expand All @@ -10,10 +12,6 @@ parameters:
- src/Debug/Toolbar.php
- src/Views/*
ignoreErrors:
- '#Variable \$testString might not be defined.#'
- '#Variable \$this might not be defined.#'
- '#Call to an undefined method CodeIgniter\\View\\RendererInterface::renderFragments\(\).#'
- '#Call to an undefined method CodeIgniter\\View\\RendererInterface::parseFragments\(\).#'
universalObjectCratesClasses:
- CodeIgniter\Entity
- CodeIgniter\Entity\Entity
Expand Down
1 change: 1 addition & 0 deletions psalm.xml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
cacheDirectory="build/psalm/"
findUnusedBaselineEntry="true"
findUnusedCode="false"
ensureOverrideAttribute="false"
>
<projectFiles>
<directory name="src/" />
Expand Down
2 changes: 1 addition & 1 deletion src/CodeIgniter.php
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ public function storePreviousURL($uri)
$uri->getAuthority(),
$uri->getPath(),
$uri->getQuery(),
$uri->getFragment()
$uri->getFragment(),
));
}
}
Expand Down
2 changes: 1 addition & 1 deletion src/Config/Services.php
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ public static function incomingrequest(?App $config = null, bool $getShared = tr
$config,
AppServices::uri(),
'php://input',
new UserAgent()
new UserAgent(),
);
}

Expand Down
6 changes: 3 additions & 3 deletions src/Debug/Toolbar.php
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ public function prepare(?RequestInterface $request = null, ?ResponseInterface $r
$stats['startTime'],
$stats['totalTime'],
$request,
$response
$response,
);

helper('filesystem');
Expand Down Expand Up @@ -91,8 +91,8 @@ public function prepare(?RequestInterface $request = null, ?ResponseInterface $r
'/<head>/',
'<head>' . $script,
$response->getBody(),
1
)
1,
),
);

return;
Expand Down
2 changes: 1 addition & 1 deletion src/HTTP/HtmxTrait.php
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ private function validateSwap(string $option, string $field = 'swap'): bool
'Option "%s" is not a valid variable for %s. A valid option has to be one of: %s',
$option,
$field,
implode(', ', $this->swapOptions)
implode(', ', $this->swapOptions),
));
}

Expand Down
Loading