1
0
Fork 0
mirror of https://github.com/shufflingpixels/php-io.git synced 2026-08-15 11:48:13 +02:00
Commit graph

19 commits

Author SHA1 Message Date
b63e666017 tests: add php 8.5 2026-06-27 09:28:26 +02:00
77f1a16525 composer: update packages to support php 8.2 2026-06-27 09:26:34 +02:00
c9a406d63b drop supprt for php 8.1
php 8.1 requires pest 2.0 that depends on a phpunit version that is
affected by security advisories ("PKSA-z3gr-8qht-p93v")

see: https://packagist.org/security-advisories/PKSA-z3gr-8qht-p93v
2026-06-27 09:23:27 +02:00
66ce04cf5c Add GitHub Actions test workflow 2026-06-27 09:03:13 +02:00
07ec405512 Adopt Go-style minimal interfaces for streams
Replace PSR-7 StreamInterface with a set of small, composable interfaces
(ReaderInterface, WriterInterface, SeekerInterface and their
combinations).
BinaryReader now depends only on ReaderInterface, BinaryWriter on
WriterInterface, making both easy to satisfy with any byte source or
sink.

Buffer and Resource are simplified — no capability flags, no
detach/close
lifecycle, no PSR-7 metadata methods. LimitedResource is replaced by
LimitedReader, a lightweight reader that enforces a byte count limit.
BinaryReader::read() is renamed to readExact() for clarity.

Tests updated throughout to match the new APIs.
2026-06-27 09:01:12 +02:00
a27c0a87ea Minor style fix. 2026-06-26 13:54:46 +02:00
424714bbba Rename Resource::writeable to writable 2026-06-26 13:53:05 +02:00
2ea813589a Rename FileMode::writeable to writable 2026-06-26 13:52:37 +02:00
ad457610d7 Bump PHP requirement to 8.1
Enums was introduced in 8.1 and are used in the project.
2026-06-26 13:44:41 +02:00
2e8197e947 Remove isWriteable alias 2026-06-26 13:42:46 +02:00
eadc96599b Add documentation to classes and methods 2026-06-26 13:41:08 +02:00
4bf5d8084e Add BinaryWriter 2026-06-26 13:26:17 +02:00
785e48a023 Remove BinaryReader stream and string helpers
BinaryReader does not own the stream object. so we should not have a
method that creates one (string) also remove stream() as its the same as
the constructor.
2026-06-26 13:25:40 +02:00
0fa93d691c Add BinaryReader::readPaddedString 2026-06-26 09:46:08 +02:00
08c67dfa19 Add Mago config and strict types 2026-06-26 09:38:18 +02:00
f669183060 Add LimitedResource for scoped stream windows
Wraps any seekable StreamInterface and exposes a fixed byte range
(start offset + length) as an independent stream. Useful for passing
a subsection of a resource to BinaryReader without copying bytes.
2026-06-26 09:35:56 +02:00
89525294de stream: adopt PSR-7 StreamInterface 2026-05-23 21:58:20 +02:00
8d8690f77b composer.json: add support section 2026-04-22 16:50:56 +02:00
c677cfccd4 Initial commit 2026-04-22 07:15:24 +02:00