All notable changes to this project will be documented in this file.
The format is based on Keep a Changelog, and this project adheres to Semantic Versioning.
- Added the
peek()
method to look at the next n characters without changing the internal index. - Added the
isOn()
andisOnRegex()
methods to test whether or not the current character (and, potentially, next characters) match a given string or an array of strings.
- Fixed #4, where the
current()
method never returned false when the stream had advanced after the last character or before the first one.
- Added idempotency to navigation methods. You can call navigation methods like
next()
orprevious()
multiple times at the stream's endpoints without updating the internal pointer.
- Reordered the methods in the
Stream
class to be grouped according to usage. Although this mixesprivate
andpublic
methods, it makes it easier to read without jumping around.
- Removed the
hasCharacters()
method. This is not a particularly meaningful method, as it only checks whether or not a current character exists.
- Fixed #2, where attempts to call
previous()
from the end of the string would returnfalse
.
Version 0.3.0
includes a number of breaking changes, intended to make the library easier to use and maintain.
- Removed the
setCharacters()
method. It's better if this low-level implementation detail is not editable. - Removed the
protected
methodshasNextCharacter()
andhasPreviousCharacter()
since they were not being used.
- Updated the library for PHP 7.4+ and PHP 8.
- Changed
Stream
to anabstract class
withFile
andText
implementations to make the source more intentional. - Changed constructor arguments to accept a
string
orChunker
instance. This simplifies instantiation, if you accept the chunker's default encoding and chunk size. - Modernized the classes with property type hints, argument type hints, return type hints, guard clauses, etc.
- Changed
File
tests from using concrete files and folders to using a virtual file system with bovigo/vfsStream. - Updated from PHPUnit version 4 to version 9.
- Updated the README to better explain the problem this library solves.
- Removed lots and lots of unnecessary comments :).
- Changed
protected
methods toprivate
, where possible, and decomposed methods likeread()
into smaller ones.
- Added
ext-mbstring
requirement tocomposer.json
. - Added
CHANGELOG
to keep track of changes. - Added slevomat/coding-standard to enforce coding standards.
- Added roave/security-advisories to exclude dependencies with known vulnerabilities.
- Added continuous integration with CircleCI.
- Added code coverage analysis with CodeCov.
- Duh. I forgot to include the changes to
composer.json
.
- Update to requiring a
Jstewmc\Chunker
instance. Before, both the chunking and the splitting were handled in this class. However, it was becoming a headache. So, I moved the chunking to jstewmc\chunker, and the Chunker is now a required constructor argument.
Initial release