From 7ab0cd4cd266b93ad63d7aa6e7399e79c7b1b998 Mon Sep 17 00:00:00 2001 From: Jagepard Date: Fri, 3 Jul 2026 20:41:07 +0300 Subject: [PATCH 1/4] refactor: remove unused variables in statement builders --- src/Repository.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/Repository.php b/src/Repository.php index 38c3a95..25be46d 100755 --- a/src/Repository.php +++ b/src/Repository.php @@ -225,7 +225,7 @@ protected static function updateStmtString(array $fields): string { $stmtFields = []; - foreach ($fields as $key => $data) { + foreach (array_keys($fields) as $key) { $stmtFields[] = "{$key}=:{$key}"; } @@ -238,14 +238,14 @@ protected static function updateStmtString(array $fields): string * - A list of column names. * - A list of placeholders (prefixed with colons) for parameter binding. * These strings can be directly used in the SQL INSERT query. - */ + */ protected static function createStmtString(array $fields): array { $insert = []; $execute = []; - foreach ($fields as $key => $data) { - $insert[] = "{$key}"; + foreach (array_keys($fields) as $key) { + $insert[] = $key; $execute[] = ":{$key}"; } From 9093ac559e2f8bc2a6ca17e4ad09dbfabd7f7264 Mon Sep 17 00:00:00 2001 From: Jagepard Date: Fri, 3 Jul 2026 20:41:23 +0300 Subject: [PATCH 2/4] add nbproject --- .gitignore | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) mode change 100755 => 100644 .gitignore diff --git a/.gitignore b/.gitignore old mode 100755 new mode 100644 index fa02bc1..d9c2f91 --- a/.gitignore +++ b/.gitignore @@ -4,4 +4,5 @@ /vendor/ /composer.lock /.phpunit.cache/ -/.phpunit.result.cache \ No newline at end of file +/.phpunit.result.cache +/nbproject/ From d75915593f5537cf6961b991932c18be00bc648f Mon Sep 17 00:00:00 2001 From: Jagepard Date: Fri, 3 Jul 2026 20:41:49 +0300 Subject: [PATCH 3/4] add --- .github/workflows/php.yml | 63 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 63 insertions(+) create mode 100644 .github/workflows/php.yml diff --git a/.github/workflows/php.yml b/.github/workflows/php.yml new file mode 100644 index 0000000..3e25318 --- /dev/null +++ b/.github/workflows/php.yml @@ -0,0 +1,63 @@ +name: PHPUnit + +on: + push: + branches: [ "master" ] + pull_request: + branches: [ "master" ] + workflow_dispatch: + +permissions: + contents: read + +jobs: + build: + runs-on: ubuntu-latest + + steps: + - name: Checkout code + uses: actions/checkout@v3 + + - name: Set up PHP + uses: shivammathur/setup-php@v2 + with: + php-version: '8.4' # ← Changed from '8.3' to '8.4' + extensions: xdebug + coverage: xdebug # ← Explicitly enable coverage driver + + - name: Validate composer.json and composer.lock + run: composer validate --strict + + - name: Cache Composer packages + id: composer-cache + uses: actions/cache@v3 + with: + path: vendor + key: ${{ runner.os }}-php-${{ hashFiles('**/composer.lock') }} + restore-keys: | + ${{ runner.os }}-php- + + - name: Install dependencies + run: composer install --prefer-dist --no-progress + + - name: Download PHPUnit PHAR + run: | + wget https://phar.phpunit.de/phpunit.phar + chmod +x phpunit.phar + mv phpunit.phar /usr/local/bin/phpunit + + - name: Check PHPUnit version + run: phpunit --version + + - name: Run PHPUnit tests with coverage + run: | + mkdir -p build/logs + phpunit --configuration phpunit.xml --coverage-clover build/logs/clover.xml --debug + env: + XDEBUG_MODE: coverage + + - name: Send coverage to Coveralls + uses: coverallsapp/github-action@v2 + with: + github-token: ${{ secrets.GITHUB_TOKEN }} + path-to-lcov: build/logs/clover.xml \ No newline at end of file From f517b93b0a793f30208db3e3abc1bae80bd96427 Mon Sep 17 00:00:00 2001 From: Jagepard Date: Fri, 3 Jul 2026 20:45:53 +0300 Subject: [PATCH 4/4] add workflows/php.yml/badge.svg --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 357f653..bbc8f62 100755 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -[![Build Status](https://travis-ci.org/Jagepard/Rudra-Model.svg?branch=master)](https://travis-ci.org/Jagepard/Rudra-Model) +[![PHPunit](https://github.com/Jagepard/Rudra-Model/actions/workflows/php.yml/badge.svg)](https://github.com/Jagepard/Rudra-Model/actions/workflows/php.yml) [![Maintainability](https://qlty.sh/badges/ca8bb591-ff66-41c3-8f18-4d4a93b3ee41/maintainability.svg)](https://qlty.sh/gh/Jagepard/projects/Rudra-Model) [![CodeFactor](https://www.codefactor.io/repository/github/jagepard/rudra-model/badge)](https://www.codefactor.io/repository/github/jagepard/rudra-model) [![Coverage Status](https://coveralls.io/repos/github/Jagepard/Rudra-Model/badge.svg?branch=master)](https://coveralls.io/github/Jagepard/Rudra-Model?branch=master)