From 6884df9fbd03e2570939e9c5ebd1594989db1765 Mon Sep 17 00:00:00 2001 From: Phil Davis Date: Wed, 3 Nov 2021 12:24:32 +0545 Subject: [PATCH 1/2] Rename GitHub workflow to ci.yml --- .github/workflows/{ci.yaml => ci.yml} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename .github/workflows/{ci.yaml => ci.yml} (100%) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yml similarity index 100% rename from .github/workflows/ci.yaml rename to .github/workflows/ci.yml From bf17ce34b907f8a132b298fe1b2a834256ffb624 Mon Sep 17 00:00:00 2001 From: Phil Davis Date: Wed, 3 Nov 2021 12:27:35 +0545 Subject: [PATCH 2/2] Fix typos and grammar --- CHANGELOG.md | 2 +- lib/ContextStackTrait.php | 2 +- lib/Element/Base.php | 4 ++-- lib/Element/Cdata.php | 6 +++--- lib/Element/Elements.php | 6 +++--- lib/Element/KeyValue.php | 6 +++--- lib/Element/Uri.php | 4 ++-- lib/Element/XmlFragment.php | 6 +++--- lib/LibXMLException.php | 2 +- lib/Reader.php | 8 ++++---- lib/Service.php | 10 +++++----- lib/XmlSerializable.php | 2 +- tests/Sabre/Xml/Deserializer/KeyValueTest.php | 2 +- tests/Sabre/Xml/Element/Eater.php | 2 +- tests/Sabre/Xml/Element/Mock.php | 2 +- .../Xml/{InfiteLoopTest.php => InfiniteLoopTest.php} | 2 +- 16 files changed, 33 insertions(+), 33 deletions(-) rename tests/Sabre/Xml/{InfiteLoopTest.php => InfiniteLoopTest.php} (95%) diff --git a/CHANGELOG.md b/CHANGELOG.md index cdd21fe..13bcc41 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -13,7 +13,7 @@ ChangeLog ------------------ * #183: fixed warning 'xml cannot be empty while reading', which might lead to a infinite-loop (@mrow4a) -* #179, #178, #177 #176: several build/continous integration related improvements (@phil-davis) +* #179, #178, #177 #176: several build/continuous integration related improvements (@phil-davis) 2.2.0 (2020-01-31) ------------------ diff --git a/lib/ContextStackTrait.php b/lib/ContextStackTrait.php index 7570888..4e15bd4 100644 --- a/lib/ContextStackTrait.php +++ b/lib/ContextStackTrait.php @@ -10,7 +10,7 @@ * The Context maintains information about a document during either reading or * writing. * - * During this process, it may be neccesary to override this context + * During this process, it may be necessary to override this context * information. * * This trait allows easy access to the context, and allows the end-user to diff --git a/lib/Element/Base.php b/lib/Element/Base.php index a1ce7ea..8a93191 100644 --- a/lib/Element/Base.php +++ b/lib/Element/Base.php @@ -35,7 +35,7 @@ public function __construct($value = null) } /** - * The xmlSerialize metod is called during xml writing. + * The xmlSerialize method is called during xml writing. * * Use the $writer argument to write its own xml serialization. * @@ -58,7 +58,7 @@ public function xmlSerialize(Xml\Writer $writer) /** * The deserialize method is called during xml parsing. * - * This method is called statictly, this is because in theory this method + * This method is called statically, this is because in theory this method * may be used as a type of constructor, or factory method. * * Often you want to return an instance of the current class, but you are diff --git a/lib/Element/Cdata.php b/lib/Element/Cdata.php index 61d3213..1367343 100644 --- a/lib/Element/Cdata.php +++ b/lib/Element/Cdata.php @@ -12,7 +12,7 @@ * This element allows you to easily inject CDATA. * * Note that we strongly recommend avoiding CDATA nodes, unless you definitely - * know what you're doing, or you're working with unchangable systems that + * know what you're doing, or you're working with unchangeable systems that * require CDATA. * * @copyright Copyright (C) 2009-2015 fruux GmbH (https://fruux.com/). @@ -37,12 +37,12 @@ public function __construct(string $value) } /** - * The xmlSerialize metod is called during xml writing. + * The xmlSerialize method is called during xml writing. * * Use the $writer argument to write its own xml serialization. * * An important note: do _not_ create a parent element. Any element - * implementing XmlSerializble should only ever write what's considered + * implementing XmlSerializable should only ever write what's considered * its 'inner xml'. * * The parent of the current element is responsible for writing a diff --git a/lib/Element/Elements.php b/lib/Element/Elements.php index e511798..fecce4c 100644 --- a/lib/Element/Elements.php +++ b/lib/Element/Elements.php @@ -53,12 +53,12 @@ public function __construct(array $value = []) } /** - * The xmlSerialize metod is called during xml writing. + * The xmlSerialize method is called during xml writing. * * Use the $writer argument to write its own xml serialization. * * An important note: do _not_ create a parent element. Any element - * implementing XmlSerializble should only ever write what's considered + * implementing XmlSerializable should only ever write what's considered * its 'inner xml'. * * The parent of the current element is responsible for writing a @@ -76,7 +76,7 @@ public function xmlSerialize(Xml\Writer $writer) /** * The deserialize method is called during xml parsing. * - * This method is called statictly, this is because in theory this method + * This method is called statically, this is because in theory this method * may be used as a type of constructor, or factory method. * * Often you want to return an instance of the current class, but you are diff --git a/lib/Element/KeyValue.php b/lib/Element/KeyValue.php index dacee00..1744888 100644 --- a/lib/Element/KeyValue.php +++ b/lib/Element/KeyValue.php @@ -53,12 +53,12 @@ public function __construct(array $value = []) } /** - * The xmlSerialize metod is called during xml writing. + * The xmlSerialize method is called during xml writing. * * Use the $writer argument to write its own xml serialization. * * An important note: do _not_ create a parent element. Any element - * implementing XmlSerializble should only ever write what's considered + * implementing XmlSerializable should only ever write what's considered * its 'inner xml'. * * The parent of the current element is responsible for writing a @@ -76,7 +76,7 @@ public function xmlSerialize(Xml\Writer $writer) /** * The deserialize method is called during xml parsing. * - * This method is called staticly, this is because in theory this method + * This method is called statically, this is because in theory this method * may be used as a type of constructor, or factory method. * * Often you want to return an instance of the current class, but you are diff --git a/lib/Element/Uri.php b/lib/Element/Uri.php index 2644fbc..336212a 100644 --- a/lib/Element/Uri.php +++ b/lib/Element/Uri.php @@ -42,12 +42,12 @@ public function __construct($value) } /** - * The xmlSerialize metod is called during xml writing. + * The xmlSerialize method is called during xml writing. * * Use the $writer argument to write its own xml serialization. * * An important note: do _not_ create a parent element. Any element - * implementing XmlSerializble should only ever write what's considered + * implementing XmlSerializable should only ever write what's considered * its 'inner xml'. * * The parent of the current element is responsible for writing a diff --git a/lib/Element/XmlFragment.php b/lib/Element/XmlFragment.php index 12109e5..bf110ea 100644 --- a/lib/Element/XmlFragment.php +++ b/lib/Element/XmlFragment.php @@ -48,12 +48,12 @@ public function getXml(): string } /** - * The xmlSerialize metod is called during xml writing. + * The xmlSerialize method is called during xml writing. * * Use the $writer argument to write its own xml serialization. * * An important note: do _not_ create a parent element. Any element - * implementing XmlSerializble should only ever write what's considered + * implementing XmlSerializable should only ever write what's considered * its 'inner xml'. * * The parent of the current element is responsible for writing a @@ -121,7 +121,7 @@ public function xmlSerialize(Writer $writer) /** * The deserialize method is called during xml parsing. * - * This method is called statictly, this is because in theory this method + * This method is called statically, this is because in theory this method * may be used as a type of constructor, or factory method. * * Often you want to return an instance of the current class, but you are diff --git a/lib/LibXMLException.php b/lib/LibXMLException.php index ae136f5..fb074f9 100644 --- a/lib/LibXMLException.php +++ b/lib/LibXMLException.php @@ -8,7 +8,7 @@ use Throwable; /** - * This exception is thrown when the Readers runs into a parsing error. + * This exception is thrown when the Reader runs into a parsing error. * * This exception effectively wraps 1 or more LibXMLError objects. * diff --git a/lib/Reader.php b/lib/Reader.php index 1a27af7..7871a74 100644 --- a/lib/Reader.php +++ b/lib/Reader.php @@ -92,11 +92,11 @@ public function parse(): array /** * parseGetElements parses everything in the current sub-tree, - * and returns a an array of elements. + * and returns an array of elements. * * Each element has a 'name', 'value' and 'attributes' key. * - * If the the element didn't contain sub-elements, an empty array is always + * If the element didn't contain sub-elements, an empty array is always * returned. If there was any text inside the element, it will be * discarded. * @@ -249,7 +249,7 @@ public function parseCurrentElement(): array * * If the attributes are part of the same namespace, they will simply be * short keys. If they are defined on a different namespace, the attribute - * name will be retured in clark-notation. + * name will be returned in clark-notation. */ public function parseAttributes(): array { @@ -275,7 +275,7 @@ public function parseAttributes(): array /** * Returns the function that should be used to parse the element identified - * by it's clark-notation name. + * by its clark-notation name. */ public function getDeserializerForElementName(string $name): callable { diff --git a/lib/Service.php b/lib/Service.php index 596c93c..a8e34d2 100644 --- a/lib/Service.php +++ b/lib/Service.php @@ -7,7 +7,7 @@ /** * XML parsing and writing service. * - * You are encouraged to make a instance of this for your application and + * You are encouraged to make an instance of this for your application and * potentially extend it, as a central API point for dealing with xml and * configuring the reader and writer. * @@ -117,7 +117,7 @@ public function parse($input, string $contextUri = null, string &$rootElementNam $input = (string) stream_get_contents($input); } - // If input is empty, then its safe to throw exception + // If input is empty, then it's safe to throw an exception if (empty($input)) { throw new ParseException('The input element to parse is empty. Do not attempt to parse'); } @@ -161,7 +161,7 @@ public function expect($rootElementName, $input, string $contextUri = null) $input = (string) stream_get_contents($input); } - // If input is empty, then its safe to throw exception + // If input is empty, then it's safe to throw an exception if (empty($input)) { throw new ParseException('The input element to parse is empty. Do not attempt to parse'); } @@ -217,9 +217,9 @@ public function write(string $rootElementName, $value, string $contextUri = null } /** - * Map an xml element to a PHP class. + * Map an XML element to a PHP class. * - * Calling this function will automatically setup the Reader and Writer + * Calling this function will automatically set up the Reader and Writer * classes to turn a specific XML element to a PHP class. * * For example, given a class such as : diff --git a/lib/XmlSerializable.php b/lib/XmlSerializable.php index b22f8d5..2affc33 100644 --- a/lib/XmlSerializable.php +++ b/lib/XmlSerializable.php @@ -20,7 +20,7 @@ interface XmlSerializable * Use the $writer argument to write its own xml serialization. * * An important note: do _not_ create a parent element. Any element - * implementing XmlSerializble should only ever write what's considered + * implementing XmlSerializable should only ever write what's considered * its 'inner xml'. * * The parent of the current element is responsible for writing a diff --git a/tests/Sabre/Xml/Deserializer/KeyValueTest.php b/tests/Sabre/Xml/Deserializer/KeyValueTest.php index bcde1b3..0a442d8 100644 --- a/tests/Sabre/Xml/Deserializer/KeyValueTest.php +++ b/tests/Sabre/Xml/Deserializer/KeyValueTest.php @@ -110,7 +110,7 @@ public function testKeyValueLoop() public function testEmptyKeyValue() { - // the nested structure below is necessary to detect if one of the deserialization functions eats to much elements + // the nested structure below is necessary to detect if one of the deserialization functions eats too many elements $input = << diff --git a/tests/Sabre/Xml/Element/Eater.php b/tests/Sabre/Xml/Element/Eater.php index 880e317..fe7f02b 100644 --- a/tests/Sabre/Xml/Element/Eater.php +++ b/tests/Sabre/Xml/Element/Eater.php @@ -38,7 +38,7 @@ public function xmlSerialize(Xml\Writer $writer) /** * The deserialize method is called during xml parsing. * - * This method is called statictly, this is because in theory this method + * This method is called statically, this is because in theory this method * may be used as a type of constructor, or factory method. * * Often you want to return an instance of the current class, but you are diff --git a/tests/Sabre/Xml/Element/Mock.php b/tests/Sabre/Xml/Element/Mock.php index 73f5cc0..4e522e7 100644 --- a/tests/Sabre/Xml/Element/Mock.php +++ b/tests/Sabre/Xml/Element/Mock.php @@ -30,7 +30,7 @@ public function xmlSerialize(Xml\Writer $writer) /** * The deserialize method is called during xml parsing. * - * This method is called statictly, this is because in theory this method + * This method is called statically, this is because in theory this method * may be used as a type of constructor, or factory method. * * Often you want to return an instance of the current class, but you are diff --git a/tests/Sabre/Xml/InfiteLoopTest.php b/tests/Sabre/Xml/InfiniteLoopTest.php similarity index 95% rename from tests/Sabre/Xml/InfiteLoopTest.php rename to tests/Sabre/Xml/InfiniteLoopTest.php index 404eaae..a8b56d7 100644 --- a/tests/Sabre/Xml/InfiteLoopTest.php +++ b/tests/Sabre/Xml/InfiniteLoopTest.php @@ -4,7 +4,7 @@ namespace Sabre\Xml; -class InfiteLoopTest extends \PHPUnit\Framework\TestCase +class InfiniteLoopTest extends \PHPUnit\Framework\TestCase { /** * This particular xml body caused the parser to go into an infinite loop.