Skip to content

Commit

Permalink
Merge pull request #87 from jawira/update-to-php84
Browse files Browse the repository at this point in the history
chore: Update tests to PHP 8.4
  • Loading branch information
jawira authored Dec 21, 2024
2 parents 2be05b9 + 394ef8a commit a3c957a
Show file tree
Hide file tree
Showing 6 changed files with 23 additions and 21 deletions.
29 changes: 13 additions & 16 deletions .github/workflows/qa.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ jobs:
tests:
strategy:
matrix:
php: [ '7.4','8.0','8.1' ]
runs-on: ubuntu-22.04
php: [ '7.4','8.0','8.1','8.2','8.3','8.4' ]
runs-on: ubuntu-24.04
steps:

- name: Setup PHP
Expand All @@ -20,40 +20,37 @@ jobs:
php-version: ${{ matrix.php }}
extensions: mbstring, intl
coverage: xdebug
tools: composer:v2
tools: phing:v3

- uses: actions/checkout@v2

- name: Download phing
run: mkdir bin && curl -L -C - -s -S -o bin/phing https://github.com/phingofficial/phing/releases/download/3.0.0-RC3/phing-3.0.0-RC3.phar && chmod +x bin/phing

- name: Phing setup
run: bin/phing setup
run: phing setup

- name: lint php
run: bin/phing php:lint
run: phing php:lint

- name: validate composer
run: bin/phing composer:validate
run: phing composer:validate

- name: behat
run: bin/phing behat:run
run: phing behat:run

- name: psalm
run: bin/phing psalm:run
# - name: psalm
# run: phing psalm:run

- name: phpstan
run: bin/phing phpstan:analyse
run: phing phpstan:analyse

- name: CC before build
run: bin/phing cc:before-build
run: phing cc:before-build
env:
CC_TEST_REPORTER_ID: ${{ secrets.CC_TEST_REPORTER_ID }}

- name: PHPUnit
run: bin/phing phpunit:run
run: phing phpunit:run

- name: CC after build
run: bin/phing cc:after-build
run: phing cc:after-build
env:
CC_TEST_REPORTER_ID: ${{ secrets.CC_TEST_REPORTER_ID }}
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ Contributing

- If you liked this project, ⭐ star it on GitHub.
[![GitHub Repo stars](https://img.shields.io/github/stars/jawira/case-converter?style=social)](https://github.com/jawira/case-converter)
- Or follow me on Twitter.
- Or follow me on X.
[![Twitter Follow](https://img.shields.io/twitter/follow/jawira?style=social)](https://twitter.com/jawira)

License
Expand Down
5 changes: 2 additions & 3 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,8 @@
},
"require-dev": {
"behat/behat": "^3.0",
"phpstan/phpstan": "^1.0",
"phpunit/phpunit": "^9.0",
"vimeo/psalm": "^4.0"
"phpstan/phpstan": "^v2",
"phpunit/phpunit": "^9.0"
},
"suggest": {
"pds/skeleton": "PHP Package Development Standards",
Expand Down
2 changes: 2 additions & 0 deletions psalm.xml
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
<?xml version="1.0"?>
<psalm errorLevel="1"
resolveFromConfigFile="true"
findUnusedCode="false"
findUnusedBaselineEntry="true"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns="https://getpsalm.org/schema/config"
xsi:schemaLocation="https://getpsalm.org/schema/config vendor/vimeo/psalm/config.xsd">
Expand Down
2 changes: 1 addition & 1 deletion src/Glue/Gluer.php
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ protected function glueUsingRules(string $glue, int $wordsMode, ?int $firstWordM
{
$convertedWords = $this->changeWordsCase($this->words, $wordsMode);

if ($firstWordMode) {
if (is_int($firstWordMode)) {
$convertedWords = $this->changeFirstWordCase($convertedWords, $firstWordMode);
}

Expand Down
4 changes: 4 additions & 0 deletions src/Split/Splitter.php
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,10 @@ abstract public function split(): array;
*/
protected function splitUsingPattern(string $inputString, string $pattern): array
{
if (empty($pattern)) {
throw new CaseConverterException('Pattern must not be empty.'); // @codeCoverageIgnore
}

$words = preg_split($pattern, $inputString, 0, PREG_SPLIT_DELIM_CAPTURE | PREG_SPLIT_NO_EMPTY);

if ($words === false) {
Expand Down

0 comments on commit a3c957a

Please sign in to comment.