Skip to content
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
2 changes: 1 addition & 1 deletion .github/dependabot.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@ updates:
directory: "/"
schedule:
interval: "weekly"
open-pull-requests-limit: 10
open-pull-requests-limit: 5
5 changes: 4 additions & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,13 @@ jobs:
- name: Run composer
uses: php-actions/composer@v5

- name: PHP CodeSniffer
run: ./vendor/bin/phpcs --runtime-set ignore_warnings_on_exit 1 --standard=PSR12 --exclude=Generic.NamingConventions.UpperCaseConstantName,PSR1.Methods.CamelCapsMethodName,PSR2.Methods.MethodDeclaration ./src

- name: PHPUnit Tests
uses: php-actions/phpunit@v3
with:
version: 9.5
version: 10.0
php_version: 8.1
bootstrap: ./vendor/autoload.php
configuration: ./.github/workflows/phpunit.xml
59 changes: 59 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
# Define the PHP executable and commonly used paths
PHP := php
PHPUNIT := ./vendor/bin/phpunit
RECTOR := ./vendor/bin/rector
PHPCS := ./vendor/bin/phpcs
PHPCBF := ./vendor/bin/phpcbf
PHPCSARGS := --standard=PSR12 --exclude=Generic.NamingConventions.UpperCaseConstantName,PSR1.Methods.CamelCapsMethodName,PSR2.Methods.MethodDeclaration

# Default target
all: help

# PHPUnit target
test:
@echo "Running PHPUnit tests..."
$(PHPUNIT) --configuration phpunit.xml --colors=always

# Rector targets for code refactoring
rector:
@echo "Running Rector refactoring..."
$(RECTOR) process src --dry-run --clear-cache --config rector.php

rector-fix:
@echo "Applying Rector refactoring..."
$(RECTOR) process src --clear-cache --config rector.php

# PHPCS target for linting
lint:
@echo "Running PHP CodeSniffer (PHPCS) for linting..."
$(PHPCS) $(PHPCSARGS) src/


# PHPCBF target for auto-fixing code style issues
lint-fix:
@echo "Running PHP Code Beautifier and Fixer (PHPCBF) for auto-fixing..."
$(PHPCBF) $(PHPCSARGS) src/

# Clean up cache generated by Rector, PHPUnit, and PHPCS
clean:
@echo "Cleaning caches for Rector, PHPUnit, and PHPCS..."
rm -rf .rector/cache
rm -rf .phpunit.result.cache
rm -rf .phpcs.cache

# Run both test and lint targets
check: test lint

# Help menu
help:
@echo "Available targets:"
@echo " test - Run PHPUnit tests with default configuration"
@echo " rector - Run Rector in dry-run mode"
@echo " rector-fix - Apply Rector refactoring"
@echo " lint - Run PHP CodeSniffer (PHPCS) for code style checks"
@echo " lint-fix - Auto-fix code style issues with PHP Code Beautifier (PHPCBF)"
@echo " clean - Remove cache for Rector, PHPUnit, and PHPCS"
@echo " check - Run both tests and linting in dry-run mode"

# Phony targets to prevent issues with files named like targets
.PHONY: all test rector rector-fix lint lint-fix clean check help
5 changes: 3 additions & 2 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
"keywords": ["bluem", "php", "interface", "wrapper", "emandate", "epayment", "idin"],
"homepage": "https://bluem-development.github.io/bluem-php/",
"license": "GPL-3.0-or-later",
"version": "2.3.4.2",
"authors": [{
"name": "Bluem Plugin Support",
"email": "pluginsupport@bluem.nl",
Expand All @@ -31,11 +32,11 @@
}
},
"require-dev": {
"phpunit/phpunit": "^9.5",
"phpunit/phpunit": "^10",
"phpspec/prophecy": "~1.0",
"vlucas/phpdotenv": "^5.4",
"rector/rector": "^0.15.10",
"squizlabs/php_codesniffer": "^3.7",
"squizlabs/php_codesniffer": "^3.10",
"magento/magento-coding-standard": "^31.0",
"phpcompatibility/php-compatibility": "^9.3"
},
Expand Down
Loading