Skip to content
Draft
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
18 changes: 15 additions & 3 deletions .github/workflows/codesniffer.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,22 @@ jobs:

steps:
- name: Checkout code
uses: actions/checkout@v2
uses: actions/checkout@v4

- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: '8.4'

- name: Cache Composer dependencies
uses: actions/cache@v4
with:
path: ~/.composer/cache
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }}
restore-keys: ${{ runner.os }}-composer-

- name: Composer update
run: composer update --no-progress --no-interaction
run: composer update --no-progress --no-interaction --prefer-dist

- name: Code sniffer
run: vendor/bin/phpcs src --standard=PSR2 -n
run: vendor/bin/phpcs src --standard=PSR12 -n
21 changes: 17 additions & 4 deletions .github/workflows/phpunit.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,21 +12,34 @@ jobs:
strategy:
fail-fast: false
matrix:
php: [ '7.1', '7.2', '7.3', '7.4', '8.0', '8.1', '8.2' ]
php: [ '8.4' ]

name: PHPunit PHP ${{ matrix.php }}

steps:
- name: Checkout code
uses: actions/checkout@v2
uses: actions/checkout@v4

- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php }}
coverage: xdebug

- name: Cache Composer dependencies
uses: actions/cache@v4
with:
path: ~/.composer/cache
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }}
restore-keys: ${{ runner.os }}-composer-

- name: Composer update
run: composer update --no-progress --no-interaction
run: composer update --no-progress --no-interaction --prefer-dist

- name: PHPunit
run: vendor/bin/phpunit --coverage-text
run: vendor/bin/phpunit --coverage-text --coverage-clover=coverage.xml

- name: Upload coverage to Codecov
uses: codecov/codecov-action@v3
with:
file: ./coverage.xml
8 changes: 2 additions & 6 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,7 @@ language: php
services:

php:
- 7.1
- 7.2
- 7.3
- 7.4
- 8.0snapshot
- 8.4

sudo: false

Expand All @@ -17,7 +13,7 @@ before_script:

script:
- mkdir -p build/logs
- php vendor/bin/phpcs src/ --standard=PSR2 -n
- php vendor/bin/phpcs src/ --standard=PSR12 -n
- vendor/bin/phpunit --coverage-text --coverage-clover=coverage.clover

after_script:
Expand Down
31 changes: 31 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,37 @@ Updates should follow the [Keep a CHANGELOG](http://keepachangelog.com/) princip

## [Unreleased][unreleased]

## 8.4.0 - PHP 8.4 Modernization

### Breaking Changes
- **PHP 8.4 Required**: Minimum PHP version increased from 7.1 to 8.4
- **BC Break**: Several classes are now readonly, affecting inheritance
- **BC Break**: ValidationResult constructor now uses enum instead of string constants

### Added
- **PHP 8.4 Property Hooks**: Added computed properties with automatic validation
- `EndpointIdentifier::$method` with automatic case conversion
- `EndpointIdentifier::$url` with automatic URL generation
- `ValidationResult::$isOk` computed from status
- **PHP 8.4 Array Functions**: New utility functions utilizing `array_find`, `array_find_key`, `array_any`, `array_all`
- **Asymmetric Visibility**: Properties can now be publicly readable but privately writable
- **Enums**: Replaced string constants with typed enums (ValidationStatus)
- **New ArrayUtils Class**: Modern utility class demonstrating PHP 8.4 features
- **Enhanced Type Safety**: Union types and strict typing throughout codebase
- **Readonly Classes**: Immutable data structures for better performance and safety

### Changed
- **Modernized Core Classes**: Api, EndpointIdentifier, JsonApiResponse, ApiDecider, ValidationResult
- **Updated Dependencies**: PHPUnit v11, latest Nette packages, PHP 8.4 compatible versions
- **CI/CD Improvements**: GitHub Actions with PHP 8.4, dependency caching, PSR-12 standards

### Deprecated
- `BaseHandler::getEndpointIdentifier()` - Use `getEndpoint()` instead (uses new `#[\Deprecated]` attribute)

### Removed
- Support for PHP < 8.4
- Legacy PHPUnit configuration syntax

## 3.0.0

### Changed
Expand Down
Loading
Loading