File: |
src/YAML.php |
Role: |
Class source |
Content type: |
text/plain |
Description: |
Class source |
Class: |
PHP Common Class Library
Set of classes that provides common functionality |
Author: |
By Caleb |
Last change: |
YAML handler update.
Changelog excerpt:
- Added support for compact nested mapping to the YAML handler.
YAML handler patch.
Changelog excerpt:
- Improved the support for embedding JSON within YAML to the YAML handler
so that switching syntax mid-parse is less messy.
YAML handler update.
Changelog excerpt:
- Added support for Nette/NEON-style entities to the YAML handler.
PHPDoc patch.
Changelog excerpt:
- Added phpDoc comments for thrown errors/exceptions.
YAML handler patch.
Changelog excerpt:
- Improved type-guarding for the YAML handler's scalarToString method.
YAML handler update.
Changelog excerpt:
- Added list functionality to the YAML handler (i.e., using flow sequences
in keys to assign a singular value to all of those keys at once, or to
determine the keys to use to convert corresponding flow sequences in
values to flow maps).
Bug-fix (CIDRAM/CIDRAM#547).
Changelog excerpt:
- Not escaping keys when reconstructing YAML data could prevent successful
reprocessing of those keys if said keys contained any hashes or
backslashes. The solution is to enforce escaping of keys when such bytes
are detected, regardless of how the property for quoting keys is defined.
Accordingly, that's been done, and a new method added for that purpose.
Improve escaping.
YAML handler bug-fix.
Code-style patch.
YAML handler bug-fix (CIDRAM/CIDRAM#532).
Changelog excerpt:
- The YAML handler's unescape method wasn't unescaping correctly when
escaped backslashes preceded other escapable symbols; Fixed.
New abstract class.
Changelog excerpt:
- Moved the version constant and the dataTraverse method to an abstract
class, which the other classes can then extend from, due to those being
common to all/most classes in the package.
- Added support for dot notation to the L10N handler.
v2.9.7
v2.9.6
Bug-fix.
Changelog excerpt:
- The YAML handler wasn't correctly dealing with sequences which terminate
with folded scalars; Fixed.
YAML handler patch.
Changelog excerpt:
- The YAML handler's dataTraverse method synchronised with the operation
handler's dataTraverse method to be the same, to be able to likewise have
it specified whether to allow or prohibit non-scalar return values and
etc.
v2.9.5
v2.9.4
v2.9.3
YAML handler patch.
Changelog excerpt:
- The YAML handler can now handle objects when reconstructing YAML data, as
long as those objects implement the __toString method.
v2.9.2
Refactor.
Bug-fix.
Changelog excerpt:
- Fix prevents YAML handler from using multiline when reconstructing values
containing hashes, because multiline values are normally unquoted and
unescaped, thus meaning that data which occurs after the hash would be
treated as a comment when reprocessed.
v2.9.1
v2.9.0
YAML handler patch.
Changelog excerpt:
- Added the ability to apply quotes to keys for the YAML handler.
YAML handler patch.
Changelog excerpt:
- Added the ability to the YAML handler to reconstruct flows at specified
depths and to switch between JSON-style YAML-style mappings/sequences
based on depth.
v2.8.0
YAML handler patch.
Changelog excerpt:
- Added support for infinity, negative infinity, and NAN to the YAML
handler.
YAML handler patch.
Changelog excerpt:
- Added support for chomping to the YAML handler.
YAML handler patch.
Older PHP versions (5.4, 5.5) don't like concatenated strings as property
defaults, which was causing the tests for the YAML handler to fail (v1).
I had concatenated some properties in an attempt to improve readability (as
opposed to having ginormously long lines of code to read through), but I'll
revert them back to being ginormous single lines again if it means I can
get the tests for 5.4 and 5.5 working again.
v2 requires PHP 7.2 or later, but I'll replicate the reversion there too,
at least for now, in order to maintain consistency between the two current
major versions (v1, v2) for the time being.
YAML handler patch.
- Improve support for sequences of mappings.
- Update documentation and tests.
YAML handler patch.
Avoid mistyping due to excess whitespace.
YAML handler patch.
Add support for hashing.
YAML handler patch.
Ensure older PHP versions behave the same as PHP 8.1.
Use more 'link' tags.
YAML handler patch.
Changelog excerpt:
- Added support for calling a limited range of various safe PHP functions
as tags to the YAML handler.
YAML handler patch.
Changelog excerpt:
- Added support for flattening arrays.
YAML handler patch.
YAML is meant to be an extension of JSON. Therefore, assuming that both the
YAML handler and PHP's own JSON functionality have both been written
correctly, processing a pure JSON file via the YAML handler or via
json_decode should, in theory, produce the exact same results. We'll use
our composer.json file to test for this.
YAML handler patch.
Changelog excerpt:
- Implemented a flow control mechanism to the YAML handler, improving
support for flow sequences and flow mappings.
YAML handler patch.
Changelog excerpt:
- Removed newline guard from the YAML handler (YAML is allowed to exist on
a single line, e.g., by using entirely inline syntax).
YAML handler patch.
Add more code comments and refactor some of the code to improve readability
and coherence for other programmers/coders/devs/whatever reading the code.
YAML handler patch.
Refactoring, some cleanup, adding links and references for supported tags,
adding support for reconstructing end of document markers, support for
underscores in integers/floats, etc.
YAML handler patch.
Changelog excerpt:
- Added support for merging to the YAML handler.
YAML handler patch.
Changelog excerpt:
- Added support for flow mapping to the YAML handler.
YAML handler patch.
Changelog excerpt:
- Added support for binary tags.
- Explicit tags can now be used for both individual entries and entire
blocks alike.
YAML handler patch.
Changelog excerpt:
- Added support for null sets (mapping keys) and some basic, rudimentary
support for explicit tags and and related type coercion to the YAML
handler. Support for explicit tags currently only works on individual
entries, not entire blocks (I aim to implement the latter soon).
Refactor and fix typo.
YAML handler patch.
Changelog excerpt:
- Added support for hexadecimal, binary, and octal number notation.
YAML handler patch.
Changelog excerpt:
- Added the ability to specify the preferred style of quotes for strings
for the YAML handler.
YAML handler patch.
Improve escaping.
YAML handler patch.
Ensure that escaped UTF-8/UTF-16/UTF-32 bytes are correctly unescaped by
the decoder.
Bug-fix.
Wrong bytes used by the YAML handler for some escape characters; Fixed.
Bug-fix.
Wrong value lengths calculated for escaped values; Fixed.
YAML handler patch.
Set EscapeBySpec to false by default to prevent backwards-compatibility
problems with existent implementations from arising.
Bug-fix.
The YAML handler's BE/LE detection wasn't quite working properly; Fixed.
Bug-fix.
Newlines shouldn't escape on explicit multiline values.
YAML handler patch.
Changelog excerpt:
- Added the optional ability to perform spec-compliant (un/)escaping.
YAML handler patch.
Changelog excerpt:
- Added UTF-16 and UTF-32 support to the YAML handler.
Refactor.
YAML handler patch.
Changelog excerpt:
- Added the ability to reconstruct anchors to the YAML handler.
- Added guards against invalid data types for keys to the YAML handler.
Code-style patch.
YAML handler patch.
Changelog excerpt:
- Provided a means to avoid some theoretical problems with data
reconstruction by the YAML handler.
YAML handler patch.
Changelog excerpt:
- Provided a means to avoid some theoretical problems with data
reconstruction by the YAML handler.
Code-style cleanup.
- Public before private properties.
- Magic before public before private methods.
Trim inline array elements.
Trim inline array elements.
YAML handler patch.
Changelog excerpt:
- The YAML handler now supports inline arrays.
YAML handler patch.
Widens the accepted character range for tryStringDataTraverseByRef, and
improves the tests for the YAML handler as to be able to properly test
support for inline variables.
YAML handler patch.
Inline variables weren't being recognised when processing from a multiline
context; Fixed.
YAML handler patch.
Changelog excerpt:
- Inline variables (similar to as is done with Ansible) can now be used in
data for the YAML handler.
Add missing PHPDoc comments.
v2.6.2
Changelog excerpt:
- Allow dots to be escaped for dataTraverse in the operation handler.
Comment improvements.
Changelog excerpt:
- Improved and refactored some of the docblock comments across all classes.
Add public version constant.
Changelog excerpt:
- Added a public version constant to all classes, since it might be needed
by some implementations to ensure compatibility.
Reword copyright notice on some classes.
Add some missing return type declarations.
Anchors and __toString patch.
Changelog excerpt:
- Added support for __toString and for anchors to the YAML handler.
- Also updated some PHPDocs.
YAML handler patch.
Changelog excerpt:
- Added support for null values and folded multi-line values to the YAML
handler, plus some additional aliases for true and false.
- Also updated some of the test files.
Add FUNDING.yml file.
|
Date: |
2 days ago |
Size: |
56,888 bytes |
|
|
|