Skip to content
Merged
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
5 changes: 5 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,8 @@ updates:
interval: daily
time: "04:00"
open-pull-requests-limit: 10
- package-ecosystem: github-actions
directory: "/"
schedule:
interval: weekly
open-pull-requests-limit: 5
68 changes: 68 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
name: CI

on:
push:
branches: [master]
pull_request:

jobs:
validate:
name: Validate and lint
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4

- name: Install PHP
uses: shivammathur/setup-php@v2
with:
php-version: '8.4'
coverage: none
tools: composer:v2

- name: Validate composer manifest
run: composer validate --strict --no-check-lock

- name: Lint PHP sources
run: |
find src tests -name '*.php' -print0 | xargs -0 -n1 -P4 php -l

tests:
name: Tests (PHP ${{ matrix.php-version }}, ${{ matrix.dependencies }} deps)
runs-on: ubuntu-latest
needs: validate

strategy:
fail-fast: false
matrix:
dependencies:
- lowest
- highest
php-version:
- '8.4'

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

# The JIT rewrites the executor internals z-engine hooks into, so it
# stays off; FFI must be enabled for CLI scripts, not only preloading.
- name: Install PHP
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php-version }}
extensions: ffi
ini-values: memory_limit=-1, ffi.enable=1, opcache.jit=off
coverage: none
tools: composer:v2

- name: Install lowest dependencies
if: ${{ matrix.dependencies == 'lowest' }}
run: composer update --prefer-lowest --no-interaction --no-progress

- name: Install highest dependencies
if: ${{ matrix.dependencies == 'highest' }}
run: composer update --no-interaction --no-progress

- name: Run test suite
run: vendor/bin/phpunit
57 changes: 0 additions & 57 deletions .github/workflows/phpunit.yml

This file was deleted.

1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
/vendor/
/build/
composer.lock
.phpunit.result.cache
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
Immutable objects in PHP
-----------------
This library provides native immutable objects for PHP>=7.4.2
This library provides native immutable objects for PHP>=8.4

[![Build Status](https://img.shields.io/travis/com/lisachenko/immutable-object/master)](https://travis-ci.org/lisachenko/immutable-object)
[![GitHub release](https://img.shields.io/github/release/lisachenko/immutable-object.svg)](https://github.com/lisachenko/immutable-object/releases/latest)
[![Minimum PHP Version](http://img.shields.io/badge/php-%3E%3D%207.4-8892BF.svg)](https://php.net/)
[![Minimum PHP Version](http://img.shields.io/badge/php-%3E%3D%208.4-8892BF.svg)](https://php.net/)
[![License](https://img.shields.io/packagist/l/lisachenko/immutable-object.svg)](https://packagist.org/packages/lisachenko/immutable-object)

Rationale
Expand All @@ -24,7 +24,7 @@ of the PHP itself.

Pre-requisites and initialization
--------------
As this library depends on `FFI`, it requires PHP>=7.4 and `FFI` extension to be enabled.
As this library depends on `FFI`, it requires PHP>=8.4 and `FFI` extension to be enabled.

To install this library, simply add it via `composer`:
```bash
Expand Down
7 changes: 4 additions & 3 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,12 @@
],
"minimum-stability": "stable",
"require": {
"php": "^7.4|^8.0",
"lisachenko/z-engine": "^0.8.1|^0.9.1"
"php": "~8.4.0",
"ext-ffi": "*",
"lisachenko/z-engine": "~8.4.0"
},
"require-dev": {
"phpunit/phpunit": "^9.5.5"
"phpunit/phpunit": "^12.2"
},
"autoload": {
"psr-4": {
Expand Down
27 changes: 7 additions & 20 deletions phpunit.xml.dist
Original file line number Diff line number Diff line change
Expand Up @@ -9,34 +9,21 @@
~ with this source code in the file LICENSE.
-->

<phpunit backupGlobals="false"
backupStaticAttributes="false"
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="vendor/phpunit/phpunit/phpunit.xsd"
colors="true"
convertErrorsToExceptions="true"
convertNoticesToExceptions="true"
convertWarningsToExceptions="true"
processIsolation="false"
stopOnFailure="false"
bootstrap="./tests/bootstrap.php"
>
<testsuites>
<testsuite name="Immutable object Test Suite">
<directory>./tests/</directory>
<directory suffix=".phpt">./tests/</directory>
<directory suffix=".phpt">./tests/Functional/</directory>
</testsuite>
</testsuites>

<filter>
<whitelist>
<source>
<include>
<directory>./src/</directory>
</whitelist>
</filter>

<logging>
<log type="coverage-html" target="./build/coverage/html"/>
<log type="coverage-xml" target="./build/coverage/xml"/>
<log type="coverage-clover" target="./build/logs/clover.xml"/>
<log type="coverage-crap4j" target="./build/logs/crap4j.xml"/>
<log type="junit" target="./build/logs/junit.xml"/>
</logging>
</include>
</source>
</phpunit>
Loading