Skip to content

Commit

Permalink
Merge branch 'release/2.0.0'
Browse files Browse the repository at this point in the history
  • Loading branch information
cerbero90 committed Oct 5, 2024
2 parents 42a16a8 + c5f5c90 commit 44846f2
Show file tree
Hide file tree
Showing 26 changed files with 1,446 additions and 885 deletions.
27 changes: 15 additions & 12 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
name: build

on:
push:
pull_request:
push:
pull_request:

jobs:
tests:
Expand All @@ -11,7 +11,7 @@ jobs:
strategy:
fail-fast: false
matrix:
php: [8.1]
php: [8.1, 8.2, 8.3]
dependency-version: [prefer-stable]
os: [ubuntu-latest]

Expand All @@ -25,7 +25,6 @@ jobs:
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php }}
extensions: dom, curl, libxml, mbstring, zip
tools: composer:v2
coverage: none

Expand All @@ -34,7 +33,7 @@ jobs:
composer update --${{ matrix.dependency-version }} --prefer-dist --no-interaction
- name: Execute tests
run: vendor/bin/pest --verbose
run: vendor/bin/pest

coverage:
runs-on: ubuntu-latest
Expand Down Expand Up @@ -63,12 +62,12 @@ jobs:

- name: Upload coverage
run: |
vendor/bin/ocular code-coverage:upload --format=php-clover coverage.clover
vendor/bin/ocular code-coverage:upload --format=php-clover coverage.clover
style:
linting:
runs-on: ubuntu-latest

name: Coding style
name: Linting

steps:
- name: Checkout code
Expand All @@ -77,9 +76,13 @@ jobs:
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: 8.0
tools: phpcs
php-version: 8.2
tools: composer:v2
coverage: none

- name: Execute check
run: phpcs --standard=psr12 src/
- name: Install dependencies
run: |
composer update --prefer-stable --prefer-dist --no-interaction
- name: Execute Duster
run: vendor/bin/duster lint -u tlint,phpcodesniffer,pint,phpstan -vvv
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,6 @@ composer.lock
vendor
phpcs.xml
phpunit.xml
.phpunit.cache
.phpunit.result.cache
.DS_Store
31 changes: 31 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,15 @@ All notable changes to `enum` will be documented in this file.

Updates should follow the [Keep a CHANGELOG](https://keepachangelog.com/) principles.


## NEXT - YYYY-MM-DD

### Added
- Nothing

### Changed
- Nothing

### Deprecated
- Nothing

Expand All @@ -22,6 +26,33 @@ Updates should follow the [Keep a CHANGELOG](https://keepachangelog.com/) princi
- Nothing


## 2.0.0 - 2024-10-05

### Added
- Custom and default implementation of magic methods
- The `Meta` attribute and related methods
- Method `value()` to get the value of a backed case or the name of a pure case
- Methods `toArray()`, `map()` to the `CasesCollection`
- Generics in docblocks
- Static analysis

### Changed
- Renamed keys to meta
- `CasesCollection` methods return an instance of the collection whenever possible
- `CasesCollection::groupBy()` groups into instances of the collection
- Filtering methods keep the collection keys
- Renamed methods `CollectsCases::casesBy*()` to `CollectsCases::keyBy*()`
- Renamed `cases()` to `all()` in `CasesCollection`
- Renamed `get()` to `resolveMeta()` in `SelfAware`
- When hydrating from meta, the value is no longer mandatory and it defaults to `true`
- The value for `pluck()` is now mandatory
- Renamed sorting methods
- Introduced PER code style

### Removed
- Parameter `$default` from the `CasesCollection::first()` method


## 1.0.0 - 2022-07-12

### Added
Expand Down
Loading

0 comments on commit 44846f2

Please sign in to comment.