Skip to content
This repository was archived by the owner on Sep 23, 2020. It is now read-only.
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
129 commits
Select commit Hold shift + click to select a range
933ab87
Fix static properties being treated like non-static
BenMorel Apr 8, 2019
581abba
Do not use echo in closure tests
BenMorel Apr 8, 2019
fbdc00e
Allow php-parser v4.0
BenMorel Apr 8, 2019
1910b9e
Travis CI tests with lowest dependencies
BenMorel Apr 8, 2019
2c49310
Allow failures on PHP 7.4snapshot
BenMorel Apr 8, 2019
3394570
Update example version in README
BenMorel Apr 9, 2019
d17c707
Update project description
BenMorel Apr 9, 2019
4068152
README tweaks
BenMorel Apr 9, 2019
7fae7b3
Notes about eval() and SuperClosure
BenMorel Apr 9, 2019
34b8e6b
Option to inline numeric scalar arrays
BenMorel Apr 16, 2019
8d76720
Update README
BenMorel Apr 16, 2019
7587a58
Note about var_export()ing stdClass objects on PHP 7.3
BenMorel Jun 12, 2019
5aed7d8
Note about anonymous classes
BenMorel Jun 18, 2019
da09a7c
Add note about PHP 7.3 and __set_state()
BenMorel Aug 21, 2019
b5e3bbb
PHP 7.4 is now GA
BenMorel Dec 3, 2019
f6cef92
Object type hints, require PHP 7.2
BenMorel Dec 24, 2019
d94f083
Prepare for release
BenMorel Dec 24, 2019
358fdca
Supported exporting closures with use statements.
jasny Jan 22, 2020
c100112
CS fixes
BenMorel Jan 23, 2020
e318e41
Remove unnecessary space
BenMorel Jan 23, 2020
6ed295c
Test against PHP 8 (nightly)
BenMorel Jan 23, 2020
b3f32a3
Fix composer install on nightly
BenMorel Jan 23, 2020
d0da231
Support for arrow functions (#8)
jasny Jan 23, 2020
d317590
Fix title
BenMorel Jan 23, 2020
4b8b416
Replace spl_object_hash() with spl_object_id()
BenMorel Jan 23, 2020
7150917
Added VarExporter::CLOSURE_SNAPSHOT_USES to README
jasny Jan 24, 2020
59fd646
Support for internal classes providing __set_state() implementation (…
GameplayJDK Mar 13, 2020
ec758c9
Upgrade to PHPUnit 8
BenMorel Mar 20, 2020
6d84889
Update composer.json (#12)
GrahamCampbell Apr 6, 2020
cccc53e
Update README
BenMorel May 4, 2020
b98d894
Update Coveralls badge
BenMorel Aug 21, 2020
17e43b0
Remove .idea from .gitignore
BenMorel Oct 14, 2020
6fbfd93
Travis on PHP 8
BenMorel Dec 5, 2020
5e70b5c
Travis on PHP 8
BenMorel Dec 5, 2020
3b4de48
Update composer.json
BenMorel Dec 6, 2020
28ac47d
Upgrade PHPUnit
BenMorel Dec 14, 2020
b0c5e63
Move CI to GitHub Actions
BenMorel Dec 14, 2020
45969ff
Fix minimum PHPUnit version
BenMorel Dec 14, 2020
18e2b60
Fix exporting objects with dynamic numeric properties
BenMorel Dec 24, 2020
0c21e0f
Psalm level 1
BenMorel Dec 24, 2020
85b4c40
Psalm on GitHub Actions
BenMorel Dec 24, 2020
62cf02e
Fix Psalm issue
BenMorel Dec 24, 2020
831d948
Lock Psalm version
BenMorel Jan 8, 2021
eaa8614
Add support for trailing comma in arrays. (#16)
ADmad Feb 7, 2021
9364f77
Change wording
BenMorel Feb 7, 2021
ae90b0a
Clean up phpdoc for non-existing parameter
BenMorel Feb 7, 2021
6dbe63a
Update Psalm
BenMorel Feb 7, 2021
9f32515
Metadata files (#18)
ADmad Feb 8, 2021
6635221
Fix CI workflow file.
ADmad Feb 9, 2021
c9f9854
Mark public properties as readonly
BenMorel Feb 10, 2021
5e9e8ca
Add argument to control the indentation level. (#17)
ADmad Feb 10, 2021
dcc2524
Minor tweaks
BenMorel Feb 10, 2021
a35c0a0
Add types to tests
BenMorel Feb 10, 2021
bc09fd6
Add note about indentation of first line
BenMorel Feb 10, 2021
1ab6a3f
Add downloads badge
BenMorel Feb 10, 2021
0611a6c
Add GitHub Sponsors
BenMorel Mar 20, 2021
f32d734
Update Psalm
BenMorel Jun 20, 2021
718fdc8
Update README.md
BenMorel Jun 23, 2021
42831ae
Run CI on all branches
BenMorel Jul 27, 2021
48e2c40
Test on PHP 8.1
BenMorel Oct 13, 2021
bb624f1
Fix tests on PHP 8.1
BenMorel Oct 17, 2021
ecdc646
Add missing object type-hints
BenMorel Jun 15, 2022
a5a0f9e
Update Psalm
BenMorel Jun 15, 2022
06f837f
Add support for exporting Enums when using PHP8.1+
Jun 15, 2022
af330e7
Run Psalm on PHP 8.1
BenMorel Jun 15, 2022
754d11c
Run coverage on PHP 8.1
BenMorel Jun 25, 2022
cd6402e
Add CHANGELOG
BenMorel Jun 29, 2022
18e8d96
Rename INLINE_NUMERIC_SCALAR_ARRAY to INLINE_SCALAR_LIST
BenMorel Jun 29, 2022
d48ea79
Remove buggy docblock
BenMorel Jun 29, 2022
be1fe97
Add INLINE_ARRAY option
BenMorel Jun 29, 2022
af6a711
Prepare for release
BenMorel Jun 29, 2022
6047560
Test PHP 8.2
dereuromark Nov 1, 2022
fd0e05a
[master] support public readonly properties, fixes #27 (#28)
AnnaDamm Jan 21, 2023
482749e
Prepare for release
BenMorel Jan 21, 2023
946e00e
Upgrade to Psalm 5.7.5
BenMorel Feb 23, 2023
abc3262
Upgrade to Psalm 5.15.0
BenMorel Sep 1, 2023
bbbf580
Test on PHP 8.3
BenMorel Sep 1, 2023
f9f23ad
Require PHP 7.4
BenMorel Sep 1, 2023
501613f
Typed properties
BenMorel Sep 1, 2023
18d9148
Arrow functions
BenMorel Sep 1, 2023
c413afa
Prepare for release
BenMorel Sep 1, 2023
05b38f4
Remove outdated PHP < 7.3 docs
BenMorel Sep 1, 2023
847ece7
Remove outdated PHP < 7.3 docs, again
BenMorel Sep 1, 2023
73a7208
Small README fixes
BenMorel Sep 1, 2023
949c732
Upgrade Psalm to 5.21.1
BenMorel Feb 4, 2024
2d71f13
Env vars for Psalm & coverage PHP versions, use actions/checkout@v4
BenMorel Apr 25, 2024
798c0ce
Use ramsey/composer-install@v3
BenMorel Apr 25, 2024
069caaf
Use fail-fast: false
BenMorel May 2, 2024
d46e694
Use psalm as phar
snapshotpl Apr 3, 2024
bc6fe0b
Update phpunit
snapshotpl Apr 3, 2024
4b8fe1c
Upgrade to nikic/php-parser v5
BenMorel May 10, 2024
494177b
Remove deprecated INLINE_NUMERIC_SCALAR_ARRAY
BenMorel May 10, 2024
84b2a7a
Prepare for release
BenMorel May 10, 2024
478a9d9
Remove pre-PHP 7.4 wording
BenMorel May 24, 2024
78b155d
Update README
BenMorel Feb 20, 2025
430e561
Drop php version support (#39)
reinfi Feb 20, 2025
7591071
Use current php version parser (#38)
reinfi Feb 20, 2025
a60ef48
Test on PHP 8.4
BenMorel Feb 20, 2025
10112bd
Update Psalm to 6.8.4
BenMorel Feb 20, 2025
b9b2b8c
#[Override] attributes
BenMorel Feb 20, 2025
4d44338
Final classes
BenMorel Feb 20, 2025
947090d
Clean up conditional code for PHP < 8.1
BenMorel Feb 20, 2025
fd57339
Use str_ends_with()
BenMorel Feb 20, 2025
d324678
Use $object::class
BenMorel Feb 20, 2025
034135f
Add types
BenMorel Feb 20, 2025
5ffb4fb
Replace gettype() with is_*()
BenMorel Feb 20, 2025
004e7a3
Clean up redundant documented types
BenMorel Feb 20, 2025
47c8aa4
Clean up conditional code for PHP < 8.1
BenMorel Feb 20, 2025
f8e44d3
Use flexible nowdocs
BenMorel Feb 20, 2025
808a570
Update PHPUnit to 10.5
BenMorel Feb 20, 2025
774ce0e
Use int comparison for bitmasks
BenMorel Feb 20, 2025
881a1fd
Apply some rector code style fixes
BenMorel Feb 20, 2025
af98bfc
Prepare for release
BenMorel Feb 20, 2025
eaff138
Add brick/coding-standard
BenMorel Aug 29, 2025
219ae58
Apply coding standard
BenMorel Sep 6, 2025
c84d0b5
Update Psalm to version 6.13.1
BenMorel Sep 6, 2025
990c2ab
Use array_is_list()
BenMorel Jan 6, 2026
2602510
Fix deprecation
BenMorel Jan 6, 2026
f4af632
Update Psalm to 6.14.3
BenMorel Jan 6, 2026
d85a8b5
Test on PHP 8.5
BenMorel Jan 6, 2026
dea3239
Add VarExporter::INLINE_LITERAL_LIST
BenMorel Jan 6, 2026
eeb021a
Clean up annotations for PHP < 8.1
BenMorel Jan 6, 2026
52d7242
Require PHP 8.2
BenMorel Jan 6, 2026
35da8ce
Update brick/coding-standard to v4
BenMorel Jan 6, 2026
7342530
Update to PHPUnit 11
BenMorel Jan 6, 2026
7998fbb
Readonly properties
BenMorel Jan 6, 2026
83fa26f
Promoted property
BenMorel Jan 6, 2026
b3a50b8
Prepare for release
BenMorel Jan 6, 2026
ead7271
Migrate coverage reporting from Coveralls to Codecov (#40)
Copilot Feb 26, 2026
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: 18 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
; This file is for unifying the coding style for different editors and IDEs.
; More information at http://editorconfig.org

root = true

[*]
charset = utf-8
end_of_line = lf
insert_final_newline = true
indent_style = space
indent_size = 4
trim_trailing_whitespace = true

[*.md]
trim_trailing_whitespace = false

[*.{yml,yaml}]
indent_size = 2
4 changes: 3 additions & 1 deletion .gitattributes
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
.editorconfig export-ignore
.gitattributes export-ignore
.gitignore export-ignore
.travis.yml export-ignore
phpunit.xml export-ignore
psalm.xml export-ignore
README.md export-ignore
.github export-ignore
tests/ export-ignore
1 change: 1 addition & 0 deletions .github/FUNDING.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
github: BenMorel
82 changes: 82 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,82 @@
name: CI

on:
push:
pull_request:

env:
PSALM_PHP_VERSION: "8.5"
COVERAGE_PHP_VERSION: "8.5"

jobs:
psalm:
name: Psalm
runs-on: ubuntu-latest

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

- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: ${{ env.PSALM_PHP_VERSION }}

- name: Install composer dependencies
uses: ramsey/composer-install@v3

- name: Run Psalm
run: vendor/bin/psalm --show-info=false --no-progress

coding-standard:
name: Coding Standard
uses: brick/coding-standard/.github/workflows/coding-standard.yml@v4
with:
working-directory: "tools/ecs"

phpunit:
name: PHPUnit
runs-on: ubuntu-latest

strategy:
fail-fast: false
matrix:
php-version:
- "8.2"
- "8.3"
- "8.4"
- "8.5"
deps:
- "highest"
include:
- php-version: "8.2"
deps: "lowest"

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

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

- name: Install composer dependencies
uses: ramsey/composer-install@v3
with:
dependency-versions: ${{ matrix.deps }}

- name: Run PHPUnit
run: vendor/bin/phpunit
if: ${{ matrix.php-version != env.COVERAGE_PHP_VERSION }}

- name: Run PHPUnit with coverage
run: vendor/bin/phpunit --coverage-clover clover.xml
if: ${{ matrix.php-version == env.COVERAGE_PHP_VERSION }}

- name: Upload coverage to Codecov
uses: codecov/codecov-action@v5
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
if: ${{ matrix.php-version == env.COVERAGE_PHP_VERSION }}
7 changes: 5 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
/vendor
/composer.lock
/.phpunit.result.cache
/.idea
/.phpunit.cache

/tools/*
!/tools/ecs/composer.json
!/tools/ecs/ecs.php
17 changes: 0 additions & 17 deletions .travis.yml

This file was deleted.

157 changes: 157 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,157 @@
# Changelog

## [0.7.0](https://github.com/brick/varexporter/releases/tag/0.7.0) - 2026-01-06

✨ **New features**

- Added `VarExporter::INLINE_LITERAL_LIST`, similar to `INLINE_SCALAR_LIST` but includes enum values

💥 **BC breaks**

- Minimum PHP version is now `8.2`

## [0.6.0](https://github.com/brick/varexporter/releases/tag/0.6.0) - 2025-02-20

💥 **BC breaks**

- Minimum PHP version is now `8.1` (#39)

✨ **New features**

- Support for exporting `match` constructs in closures (#38)

Thanks to @reinfi!

## [0.5.0](https://github.com/brick/varexporter/releases/tag/0.5.0) - 2024-05-10

✨ **Compatibility**

- Added compatibility with `nikic/php-parser` `5.x`
- Removed compatibility with `nikic/php-parser` `4.x`

💥 **BC breaks**

- deprecated constant `VarExporter::INLINE_NUMERIC_SCALAR_ARRAY` has been removed, please use `INLINE_SCALAR_LIST` instead

## [0.4.0](https://github.com/brick/varexporter/releases/tag/0.4.0) - 2023-09-01

Minimum PHP version is now `7.4`. No breaking changes.

## [0.3.8](https://github.com/brick/varexporter/releases/tag/0.3.8) - 2023-01-22

✨ **New feature**

- Support for PHP 8.1 `readonly` properties (#27, #28)

Thanks @AnnaDamm!

## [0.3.7](https://github.com/brick/varexporter/releases/tag/0.3.7) - 2022-06-30

✨ **New feature**

- New option: `VarExporter::INLINE_ARRAY`

🗑️ **Deprecated**

- The `VarExporter::INLINE_NUMERIC_SCALAR_ARRAY` is deprecated, please use `INLINE_SCALAR_LIST` instead

## [0.3.6](https://github.com/brick/varexporter/releases/tag/0.3.6) - 2022-06-15

✨ **New feature**

Support for PHP 8.1 enums (#23).

Thanks @Jacobs63!

## [0.3.5](https://github.com/brick/varexporter/releases/tag/0.3.5) - 2021-02-10

✨ **New feature**

Support for controlling the base indentation level (#17).

Thanks @ADmad!

## [0.3.4](https://github.com/brick/varexporter/releases/tag/0.3.4) - 2021-02-07

✨ **New feature**

Support for trailing comma in non-inline arrays, with the `TRAILING_COMMA_IN_ARRAY` flag (#16).

Thanks @ADmad!

## [0.3.3](https://github.com/brick/varexporter/releases/tag/0.3.3) - 2020-12-24

🐛 **Bug fix**

- Exporting an object with numeric dynamic properties would lead to a `TypeError`

## [0.3.2](https://github.com/brick/varexporter/releases/tag/0.3.2) - 2020-03-13

✨ **New feature**

Support for exporting internal classes implementing `__set_state()`:

- `DateTime`
- `DateTimeImmutable`
- `DateTimeZone`
- `DateInterval`
- `DatePeriod`

Thanks @GameplayJDK!

## [0.3.1](https://github.com/brick/varexporter/releases/tag/0.3.1) - 2020-01-23

✨ **New features**

- Support for closures with `use()` using the `CLOSURE_SNAPSHOT_USE` option (#7)
- Support for arrow functions in PHP 7.4 (#8)

Thanks to @jasny for his awesome work!

## [0.3.0](https://github.com/brick/varexporter/releases/tag/0.3.0) - 2019-12-24

Minimum PHP version is now `7.2`. No breaking changes.

## [0.2.1](https://github.com/brick/varexporter/releases/tag/0.2.1) - 2019-04-16

✨ **New option**: `VarExporter::INLINE_NUMERIC_SCALAR_ARRAY` (#3)

Formats numeric arrays containing only scalar values on a single line.

## [0.2.0](https://github.com/brick/varexporter/releases/tag/0.2.0) - 2019-04-09

✨ **New feature**

- Experimental support for closures 🎉

💥 **Minor BC break**

- `export()` does not throw an exception anymore when encountering a `Closure`.
To get the old behaviour back, use the `NO_CLOSURES` option.

## [0.1.2](https://github.com/brick/varexporter/releases/tag/0.1.2) - 2019-04-08

🐛 **Bug fixes**

- Static properties in custom classes were wrongly included—`unset()`—in the output

✨ **Improvements**

- Circular references are now detected, and throw an `ExportException` instead of erroring.

## [0.1.1](https://github.com/brick/varexporter/releases/tag/0.1.1) - 2019-04-08

🐛 **Bug fixes**

- Single-letter properties were wrongly exported using `->{'x'}` notation.

✨ **Improvements**

- Exception messages now contain the path (array keys / object properties) to the failure:

> `[foo][bar][0]` Type "resource" is not supported.

## [0.1.0](https://github.com/brick/varexporter/releases/tag/0.1.0) - 2019-04-07

First release.

Loading