From 6abfd3b050344dde4f8ba12e07cac355ff3ab223 Mon Sep 17 00:00:00 2001 From: Sebastian Meyer Date: Sat, 7 Sep 2024 21:31:09 +0200 Subject: [PATCH] Update documentation --- .phpdoc/guide/changelog.rst | 7 ++ .phpdoc/template/index.html.twig | 8 ++- ...OCC-Basics-DataStructures-StrictArray.html | 68 +++++++++---------- ...asics-DataStructures-StrictCollection.html | 16 ++--- .../OCC-Basics-DataStructures-StrictList.html | 56 +++++++-------- ...OCC-Basics-DataStructures-StrictQueue.html | 56 +++++++-------- ...OCC-Basics-DataStructures-StrictStack.html | 56 +++++++-------- ...Traits-StrictSplDoublyLinkedListTrait.html | 62 ++++++++--------- ...ics-ErrorHandlers-ThrowErrorException.html | 8 +-- ...s-ErrorHandlers-TriggerExceptionError.html | 8 +-- ...CC-Basics-Interfaces-ArrayAccessTrait.html | 20 +++--- .../OCC-Basics-Interfaces-CountableTrait.html | 8 +-- ...ics-Interfaces-IteratorAggregateTrait.html | 8 +-- .../OCC-Basics-Interfaces-IteratorTrait.html | 28 ++++---- .../src/DataStructures/StrictArray.php.txt | 11 +++ .../DataStructures/StrictCollection.php.txt | 2 - .../StrictSplDoublyLinkedListTrait.php.txt | 3 +- .../ErrorHandlers/ThrowErrorException.php.txt | 2 - .../TriggerExceptionError.php.txt | 2 - .../src/Interfaces/ArrayAccessTrait.php.txt | 5 +- .../src/Interfaces/CountableTrait.php.txt | 5 +- .../Interfaces/IteratorAggregateTrait.php.txt | 4 +- .../src/Interfaces/IteratorTrait.php.txt | 5 +- .../src/Traits/OverloadingGetter.php.txt | 2 +- doc/files/src/Traits/Setter.php.txt | 1 + doc/files/src/Traits/TypeChecker.php.txt | 6 +- doc/guides/changelog.html | 50 ++++++++++---- doc/guides/index.html | 10 ++- doc/guides/overview/datastructures.html | 24 +++---- doc/guides/overview/errorhandlers.html | 12 ++-- doc/guides/overview/index.html | 4 +- doc/guides/overview/interfaces.html | 20 +++--- doc/guides/overview/traits.html | 28 ++++---- doc/guides/usage/index.html | 4 +- doc/guides/usage/installation.html | 16 ++--- doc/guides/usage/requirements.html | 12 ++-- doc/index.html | 8 ++- 37 files changed, 339 insertions(+), 306 deletions(-) diff --git a/.phpdoc/guide/changelog.rst b/.phpdoc/guide/changelog.rst index f1e4cc9..5025e9a 100644 --- a/.phpdoc/guide/changelog.rst +++ b/.phpdoc/guide/changelog.rst @@ -6,6 +6,13 @@ Changelog .. sidebar:: Table of Contents .. contents:: +v2.1.2 +====== + +**New Features:** + +* Added Composer commands for development tools (PHP Mess Detector, Psalm Taint Analysis) + v2.1.1 ====== diff --git a/.phpdoc/template/index.html.twig b/.phpdoc/template/index.html.twig index 01d4ee9..5b6a32a 100644 --- a/.phpdoc/template/index.html.twig +++ b/.phpdoc/template/index.html.twig @@ -14,9 +14,11 @@ data structures, error and exception handlers, multiple traits implementing standard interfaces, and more generic traits for common use cases. They share the same design principles - like property and method naming schema, highest coding standards of PHPStan - and Psalm, and full PSR-12 - compliance to make sure they can be combined and easily re-used in other projects.

+ like property and method naming schema, highest coding standards of PHPStan, + Psalm, PHP Mess Detector, + PHP_CodeSniffer, and full + PSR-12 compliance to make sure they can be combined and easily + re-used in other projects.

Table of Contents

diff --git a/doc/classes/OCC-Basics-DataStructures-StrictArray.html b/doc/classes/OCC-Basics-DataStructures-StrictArray.html index 6ce75e4..d4d1dc7 100644 --- a/doc/classes/OCC-Basics-DataStructures-StrictArray.html +++ b/doc/classes/OCC-Basics-DataStructures-StrictArray.html @@ -207,9 +207,9 @@

A type-sensitive, traversable array.

@@ -698,9 +698,9 @@ Possible values are:

Peek at the first item of the array.

@@ -799,9 +799,9 @@ Possible values are:

Count the data items.

@@ -845,9 +845,9 @@ Possible values are:

Return the current item.

@@ -1238,9 +1238,9 @@ from 0.

Return the current key.

@@ -1284,9 +1284,9 @@ from 0.

Move forward to next item.

@@ -1322,9 +1322,9 @@ from 0.

Check if the specified offset exists.

@@ -1380,9 +1380,9 @@ from 0.

Retrieve data at the specified offset.

@@ -1524,9 +1524,9 @@ from 0.

Unset the specified offset.

@@ -1574,9 +1574,9 @@ from 0.

Pop the item from the end of the array.

@@ -1637,9 +1637,9 @@ from 0.

Move back to previous item.

@@ -1675,9 +1675,9 @@ from 0.

Push an item at the end of the array.

@@ -1809,9 +1809,9 @@ from 0.

Rewind the iterator to the first item.

@@ -2034,9 +2034,9 @@ from 0.

Shift the item from the beginning of the array.

@@ -2143,9 +2143,9 @@ from 0.

Peek at the last item of the array.

@@ -2325,9 +2325,9 @@ from 0.

Prepend the array with an item.

@@ -2392,9 +2392,9 @@ from 0.

Check if current position is valid.

diff --git a/doc/classes/OCC-Basics-DataStructures-StrictCollection.html b/doc/classes/OCC-Basics-DataStructures-StrictCollection.html index b88b726..bf63854 100644 --- a/doc/classes/OCC-Basics-DataStructures-StrictCollection.html +++ b/doc/classes/OCC-Basics-DataStructures-StrictCollection.html @@ -649,9 +649,9 @@ Possible values are:

Count the data items.

@@ -1042,9 +1042,9 @@ from 0.

Check if the specified offset exists.

@@ -1100,9 +1100,9 @@ from 0.

Retrieve data at the specified offset.

@@ -1244,9 +1244,9 @@ from 0.

Unset the specified offset.

diff --git a/doc/classes/OCC-Basics-DataStructures-StrictList.html b/doc/classes/OCC-Basics-DataStructures-StrictList.html index 76bb734..ef6a004 100644 --- a/doc/classes/OCC-Basics-DataStructures-StrictList.html +++ b/doc/classes/OCC-Basics-DataStructures-StrictList.html @@ -395,9 +395,9 @@ constructor with an array of atomic types or fully qualified class names.

Create a type-sensitive, traversable list of items.

@@ -477,9 +477,9 @@ Possible values are:

Add/insert a new item at the specified offset.

@@ -563,9 +563,9 @@ Possible values are:

Append items at the end of the list.

@@ -630,9 +630,9 @@ Possible values are:

Clear the list of any items.

@@ -668,9 +668,9 @@ Possible values are:

Get the item at the specified index.

@@ -743,9 +743,9 @@ Possible values are:

Check if this can be considered a list.

@@ -789,9 +789,9 @@ Possible values are:

Set the item at the specified offset.

@@ -875,9 +875,9 @@ Possible values are:

Prepend items at the start of the list.

@@ -942,9 +942,9 @@ Possible values are:

Push an item at the end of the list.

@@ -1009,9 +1009,9 @@ Possible values are:

Remove an item from the list.

@@ -1076,9 +1076,9 @@ Possible values are:

Set an item at the specified index.

@@ -1152,9 +1152,9 @@ Possible values are:

Return array representation of list.

@@ -1198,9 +1198,9 @@ Possible values are:

Turn list into a type-sensitive collection.

@@ -1244,9 +1244,9 @@ Possible values are:

Prepend the list with an item.

diff --git a/doc/classes/OCC-Basics-DataStructures-StrictQueue.html b/doc/classes/OCC-Basics-DataStructures-StrictQueue.html index ad4a58a..db8ad46 100644 --- a/doc/classes/OCC-Basics-DataStructures-StrictQueue.html +++ b/doc/classes/OCC-Basics-DataStructures-StrictQueue.html @@ -409,9 +409,9 @@ array of atomic types or fully qualified class names.

Create a type-sensitive, traversable list of items.

@@ -491,9 +491,9 @@ Possible values are:

Add/insert a new item at the specified offset.

@@ -577,9 +577,9 @@ Possible values are:

Append items at the end of the list.

@@ -644,9 +644,9 @@ Possible values are:

Clear the list of any items.

@@ -812,9 +812,9 @@ Possible values are:

Get the item at the specified index.

@@ -887,9 +887,9 @@ Possible values are:

Check if this can be considered a list.

@@ -933,9 +933,9 @@ Possible values are:

Set the item at the specified offset.

@@ -1019,9 +1019,9 @@ Possible values are:

Prepend items at the start of the list.

@@ -1086,9 +1086,9 @@ Possible values are:

Push an item at the end of the list.

@@ -1153,9 +1153,9 @@ Possible values are:

Remove an item from the list.

@@ -1220,9 +1220,9 @@ Possible values are:

Set an item at the specified index.

@@ -1296,9 +1296,9 @@ Possible values are:

Return array representation of list.

@@ -1342,9 +1342,9 @@ Possible values are:

Turn list into a type-sensitive collection.

@@ -1388,9 +1388,9 @@ Possible values are:

Prepend the list with an item.

diff --git a/doc/classes/OCC-Basics-DataStructures-StrictStack.html b/doc/classes/OCC-Basics-DataStructures-StrictStack.html index 41a2cc1..4ea7cf7 100644 --- a/doc/classes/OCC-Basics-DataStructures-StrictStack.html +++ b/doc/classes/OCC-Basics-DataStructures-StrictStack.html @@ -409,9 +409,9 @@ array of atomic types or fully qualified class names.

Create a type-sensitive, traversable list of items.

@@ -491,9 +491,9 @@ Possible values are:

Add/insert a new item at the specified offset.

@@ -577,9 +577,9 @@ Possible values are:

Append items at the end of the list.

@@ -644,9 +644,9 @@ Possible values are:

Clear the list of any items.

@@ -682,9 +682,9 @@ Possible values are:

Get the item at the specified index.

@@ -757,9 +757,9 @@ Possible values are:

Check if this can be considered a list.

@@ -803,9 +803,9 @@ Possible values are:

Set the item at the specified offset.

@@ -889,9 +889,9 @@ Possible values are:

Prepend items at the start of the list.

@@ -956,9 +956,9 @@ Possible values are:

Push an item at the end of the list.

@@ -1023,9 +1023,9 @@ Possible values are:

Remove an item from the list.

@@ -1090,9 +1090,9 @@ Possible values are:

Set an item at the specified index.

@@ -1233,9 +1233,9 @@ Possible values are:

Return array representation of list.

@@ -1279,9 +1279,9 @@ Possible values are:

Turn list into a type-sensitive collection.

@@ -1325,9 +1325,9 @@ Possible values are:

Prepend the list with an item.

diff --git a/doc/classes/OCC-Basics-DataStructures-Traits-StrictSplDoublyLinkedListTrait.html b/doc/classes/OCC-Basics-DataStructures-Traits-StrictSplDoublyLinkedListTrait.html index b9afa85..7f5726d 100644 --- a/doc/classes/OCC-Basics-DataStructures-Traits-StrictSplDoublyLinkedListTrait.html +++ b/doc/classes/OCC-Basics-DataStructures-Traits-StrictSplDoublyLinkedListTrait.html @@ -183,9 +183,9 @@

The common interface of all type-sensitive, SPL-based datastructures.

@@ -226,7 +226,7 @@ by type-checking to only allow specified data types on the list.

-

SplDoublyLinkedList

+

\SplDoublyLinkedList

@@ -384,9 +384,9 @@ by type-checking to only allow specified data types on the list.

Create a type-sensitive, traversable list of items.

@@ -466,9 +466,9 @@ Possible values are:

Add/insert a new item at the specified offset.

@@ -552,9 +552,9 @@ Possible values are:

Append items at the end of the list.

@@ -619,9 +619,9 @@ Possible values are:

Clear the list of any items.

@@ -657,9 +657,9 @@ Possible values are:

Get the item at the specified index.

@@ -732,9 +732,9 @@ Possible values are:

Check if this can be considered a list.

@@ -778,9 +778,9 @@ Possible values are:

Set the item at the specified offset.

@@ -864,9 +864,9 @@ Possible values are:

Prepend items at the start of the list.

@@ -931,9 +931,9 @@ Possible values are:

Push an item at the end of the list.

@@ -998,9 +998,9 @@ Possible values are:

Remove an item from the list.

@@ -1065,9 +1065,9 @@ Possible values are:

Set an item at the specified index.

@@ -1141,9 +1141,9 @@ Possible values are:

Return array representation of list.

@@ -1187,9 +1187,9 @@ Possible values are:

Turn list into a type-sensitive collection.

@@ -1233,9 +1233,9 @@ Possible values are:

Prepend the list with an item.

diff --git a/doc/classes/OCC-Basics-ErrorHandlers-ThrowErrorException.html b/doc/classes/OCC-Basics-ErrorHandlers-ThrowErrorException.html index 2ff480e..241f123 100644 --- a/doc/classes/OCC-Basics-ErrorHandlers-ThrowErrorException.html +++ b/doc/classes/OCC-Basics-ErrorHandlers-ThrowErrorException.html @@ -198,9 +198,9 @@

Throws internal errors as exceptions.

@@ -291,9 +291,9 @@

Convert an internal PHP error into an ErrorException.

diff --git a/doc/classes/OCC-Basics-ErrorHandlers-TriggerExceptionError.html b/doc/classes/OCC-Basics-ErrorHandlers-TriggerExceptionError.html index b8ad1b3..c5ddbb2 100644 --- a/doc/classes/OCC-Basics-ErrorHandlers-TriggerExceptionError.html +++ b/doc/classes/OCC-Basics-ErrorHandlers-TriggerExceptionError.html @@ -198,9 +198,9 @@

Triggers errors for uncaught exceptions.

@@ -291,9 +291,9 @@ converts it into an internal PHP error of severity E_U

Convert an uncaught exception into an PHP error.

diff --git a/doc/classes/OCC-Basics-Interfaces-ArrayAccessTrait.html b/doc/classes/OCC-Basics-Interfaces-ArrayAccessTrait.html index 86328d4..83cc9db 100644 --- a/doc/classes/OCC-Basics-Interfaces-ArrayAccessTrait.html +++ b/doc/classes/OCC-Basics-Interfaces-ArrayAccessTrait.html @@ -182,9 +182,9 @@

A generic implementation of the ArrayAccess interface.

@@ -302,9 +302,9 @@

Check if the specified offset exists.

@@ -360,9 +360,9 @@

Retrieve data at the specified offset.

@@ -418,9 +418,9 @@

Assign a value to the specified offset.

@@ -477,9 +477,9 @@

Unset the specified offset.

diff --git a/doc/classes/OCC-Basics-Interfaces-CountableTrait.html b/doc/classes/OCC-Basics-Interfaces-CountableTrait.html index 213bef8..a4f9272 100644 --- a/doc/classes/OCC-Basics-Interfaces-CountableTrait.html +++ b/doc/classes/OCC-Basics-Interfaces-CountableTrait.html @@ -182,9 +182,9 @@

A generic implementation of the Countable interface.

@@ -281,9 +281,9 @@

Count the data items.

diff --git a/doc/classes/OCC-Basics-Interfaces-IteratorAggregateTrait.html b/doc/classes/OCC-Basics-Interfaces-IteratorAggregateTrait.html index df9fed6..f2e5d6e 100644 --- a/doc/classes/OCC-Basics-Interfaces-IteratorAggregateTrait.html +++ b/doc/classes/OCC-Basics-Interfaces-IteratorAggregateTrait.html @@ -182,9 +182,9 @@

A generic implementation of the IteratorAggregate interface.

@@ -281,9 +281,9 @@

Retrieve an external iterator.

diff --git a/doc/classes/OCC-Basics-Interfaces-IteratorTrait.html b/doc/classes/OCC-Basics-Interfaces-IteratorTrait.html index 22869eb..99ab35d 100644 --- a/doc/classes/OCC-Basics-Interfaces-IteratorTrait.html +++ b/doc/classes/OCC-Basics-Interfaces-IteratorTrait.html @@ -182,9 +182,9 @@

A generic implementation of the Iterator interface.

@@ -316,9 +316,9 @@

Return the current item.

@@ -362,9 +362,9 @@

Return the current key.

@@ -408,9 +408,9 @@

Move forward to next item.

@@ -446,9 +446,9 @@

Move back to previous item.

@@ -484,9 +484,9 @@

Rewind the iterator to the first item.

@@ -522,9 +522,9 @@

Check if current position is valid.

diff --git a/doc/files/src/DataStructures/StrictArray.php.txt b/doc/files/src/DataStructures/StrictArray.php.txt index 7a05194..65f555e 100644 --- a/doc/files/src/DataStructures/StrictArray.php.txt +++ b/doc/files/src/DataStructures/StrictArray.php.txt @@ -28,6 +28,17 @@ use OCC\Basics\DataStructures\Exceptions\InvalidDataTypeException; use OCC\Basics\Interfaces\IteratorTrait; use RuntimeException; +use function array_key_first; +use function array_key_last; +use function array_pop; +use function array_push; +use function array_shift; +use function array_unshift; +use function count; +use function get_debug_type; +use function is_null; +use function sprintf; + /** * A type-sensitive, traversable array. * diff --git a/doc/files/src/DataStructures/StrictCollection.php.txt b/doc/files/src/DataStructures/StrictCollection.php.txt index 78f6883..abcfe6f 100644 --- a/doc/files/src/DataStructures/StrictCollection.php.txt +++ b/doc/files/src/DataStructures/StrictCollection.php.txt @@ -362,8 +362,6 @@ class StrictCollection implements ArrayAccess, Countable, Serializable * @return void * * @internal - * - * @hpsalm-suppress MethodSignatureMismatch */ public function __unserialize(array $data): void { diff --git a/doc/files/src/DataStructures/Traits/StrictSplDoublyLinkedListTrait.php.txt b/doc/files/src/DataStructures/Traits/StrictSplDoublyLinkedListTrait.php.txt index 73f34d1..57209fa 100644 --- a/doc/files/src/DataStructures/Traits/StrictSplDoublyLinkedListTrait.php.txt +++ b/doc/files/src/DataStructures/Traits/StrictSplDoublyLinkedListTrait.php.txt @@ -28,7 +28,6 @@ use OCC\Basics\DataStructures\Exceptions\InvalidDataTypeException; use OCC\Basics\DataStructures\StrictCollection; use OCC\Basics\Traits\TypeChecker; use OutOfRangeException; -use SplDoublyLinkedList; use function get_debug_type; use function iterator_to_array; @@ -47,7 +46,7 @@ use function unserialize; * @package Basics\DataStructures * * @template AllowedType of mixed - * @phpstan-require-extends SplDoublyLinkedList + * @phpstan-require-extends \SplDoublyLinkedList */ trait StrictSplDoublyLinkedListTrait { diff --git a/doc/files/src/ErrorHandlers/ThrowErrorException.php.txt b/doc/files/src/ErrorHandlers/ThrowErrorException.php.txt index 695ce23..271b77b 100644 --- a/doc/files/src/ErrorHandlers/ThrowErrorException.php.txt +++ b/doc/files/src/ErrorHandlers/ThrowErrorException.php.txt @@ -35,8 +35,6 @@ use function error_reporting; * * > Usage: `set_error_handler(new ThrowErrorException());` * - * @api - * * @author Sebastian Meyer * @package Basics\ErrorHandlers */ diff --git a/doc/files/src/ErrorHandlers/TriggerExceptionError.php.txt b/doc/files/src/ErrorHandlers/TriggerExceptionError.php.txt index dcc08fc..16e9527 100644 --- a/doc/files/src/ErrorHandlers/TriggerExceptionError.php.txt +++ b/doc/files/src/ErrorHandlers/TriggerExceptionError.php.txt @@ -36,8 +36,6 @@ use function trigger_error; * * > Usage: `set_exception_handler(new TriggerExceptionError());` * - * @api - * * @author Sebastian Meyer * @package Basics\ErrorHandlers */ diff --git a/doc/files/src/Interfaces/ArrayAccessTrait.php.txt b/doc/files/src/Interfaces/ArrayAccessTrait.php.txt index 974da74..9769703 100644 --- a/doc/files/src/Interfaces/ArrayAccessTrait.php.txt +++ b/doc/files/src/Interfaces/ArrayAccessTrait.php.txt @@ -23,8 +23,6 @@ declare(strict_types=1); namespace OCC\Basics\Interfaces; -use ArrayAccess; - use function is_null; /** @@ -38,8 +36,7 @@ use function is_null; * @api * * @template TValue of mixed - * @implements ArrayAccess - * @phpstan-require-implements ArrayAccess + * @phpstan-require-implements \ArrayAccess */ trait ArrayAccessTrait { diff --git a/doc/files/src/Interfaces/CountableTrait.php.txt b/doc/files/src/Interfaces/CountableTrait.php.txt index 7e40b10..c31e39e 100644 --- a/doc/files/src/Interfaces/CountableTrait.php.txt +++ b/doc/files/src/Interfaces/CountableTrait.php.txt @@ -23,8 +23,6 @@ declare(strict_types=1); namespace OCC\Basics\Interfaces; -use Countable; - use function count; /** @@ -38,8 +36,7 @@ use function count; * @api * * @template TValue of mixed - * @implements Countable - * @phpstan-require-implements Countable + * @phpstan-require-implements \Countable */ trait CountableTrait { diff --git a/doc/files/src/Interfaces/IteratorAggregateTrait.php.txt b/doc/files/src/Interfaces/IteratorAggregateTrait.php.txt index d9d23bb..9bca3ca 100644 --- a/doc/files/src/Interfaces/IteratorAggregateTrait.php.txt +++ b/doc/files/src/Interfaces/IteratorAggregateTrait.php.txt @@ -24,7 +24,6 @@ declare(strict_types=1); namespace OCC\Basics\Interfaces; use ArrayIterator; -use IteratorAggregate; /** * A generic implementation of the IteratorAggregate interface. @@ -37,8 +36,7 @@ use IteratorAggregate; * @api * * @template TValue of mixed - * @implements IteratorAggregate - * @phpstan-require-implements IteratorAggregate + * @phpstan-require-implements \IteratorAggregate */ trait IteratorAggregateTrait { diff --git a/doc/files/src/Interfaces/IteratorTrait.php.txt b/doc/files/src/Interfaces/IteratorTrait.php.txt index f222078..624d402 100644 --- a/doc/files/src/Interfaces/IteratorTrait.php.txt +++ b/doc/files/src/Interfaces/IteratorTrait.php.txt @@ -23,8 +23,6 @@ declare(strict_types=1); namespace OCC\Basics\Interfaces; -use Iterator; - use function current; use function is_null; use function key; @@ -43,8 +41,7 @@ use function reset; * @api * * @template TValue of mixed - * @implements Iterator - * @phpstan-require-implements Iterator + * @phpstan-require-implements \Iterator */ trait IteratorTrait { diff --git a/doc/files/src/Traits/OverloadingGetter.php.txt b/doc/files/src/Traits/OverloadingGetter.php.txt index 633df97..8a635c9 100644 --- a/doc/files/src/Traits/OverloadingGetter.php.txt +++ b/doc/files/src/Traits/OverloadingGetter.php.txt @@ -68,7 +68,7 @@ trait OverloadingGetter */ public function __isset(string $property): bool { - $value = $this->__get($property); + $value = $this->_data[$property] ?? null; return boolval($value) !== false; } } diff --git a/doc/files/src/Traits/Setter.php.txt b/doc/files/src/Traits/Setter.php.txt index e1208a7..121f979 100644 --- a/doc/files/src/Traits/Setter.php.txt +++ b/doc/files/src/Traits/Setter.php.txt @@ -85,6 +85,7 @@ trait Setter try { $this->__set($property, null); } catch (InvalidArgumentException) { + // Unsetting an invalid property should not lead to an error. } } } diff --git a/doc/files/src/Traits/TypeChecker.php.txt b/doc/files/src/Traits/TypeChecker.php.txt index 9a2042a..8fb8d55 100644 --- a/doc/files/src/Traits/TypeChecker.php.txt +++ b/doc/files/src/Traits/TypeChecker.php.txt @@ -96,10 +96,10 @@ trait TypeChecker */ public function hasAllowedType(mixed $value): bool { - if (count($this->getAllowedTypes()) === 0) { + if (count($this->_allowedTypes) === 0) { return true; } - foreach ($this->getAllowedTypes() as $type) { + foreach ($this->_allowedTypes as $type) { $function = 'is_' . $type; if (function_exists($function) && $function($value)) { return true; @@ -124,7 +124,7 @@ trait TypeChecker */ public function isAllowedType(string $type): bool { - return in_array($type, $this->getAllowedTypes(), true); + return in_array($type, $this->_allowedTypes, true); } /** diff --git a/doc/guides/changelog.html b/doc/guides/changelog.html index fff628e..e5c41cc 100644 --- a/doc/guides/changelog.html +++ b/doc/guides/changelog.html @@ -168,7 +168,7 @@
-
+

Changelog

@@ -176,6 +176,12 @@
-
+
+

v2.1.2

+ + +

New Features: +

+ + + +
    +
  • Added Composer commands for development tools (PHP Mess Detector, Psalm Taint Analysis)
  • + +
+ +
+ +

v2.1.1

@@ -242,9 +264,9 @@ -
+
-
+

v2.1.0

@@ -273,9 +295,9 @@ -
+ -
+

v2.0.0

@@ -357,9 +379,9 @@ function _magicSet{Property}(mixed $value): void
-
+ -
+

v1.1.0

@@ -381,9 +403,9 @@ public function __construct(array $allowedTypes = []) -
+ -
+

v1.0.1

@@ -398,18 +420,18 @@ public function __construct(array $allowedTypes = []) -
+ -
+

v1.0.0

Initial Release

-
+ -
+
diff --git a/doc/guides/index.html b/doc/guides/index.html index ff67c83..b710099 100644 --- a/doc/guides/index.html +++ b/doc/guides/index.html @@ -168,7 +168,7 @@
-
+

Documentation

@@ -227,6 +227,12 @@ Changelog
-
+
diff --git a/doc/guides/overview/datastructures.html b/doc/guides/overview/datastructures.html index 635de33..8929e91 100644 --- a/doc/guides/overview/datastructures.html +++ b/doc/guides/overview/datastructures.html @@ -168,7 +168,7 @@
-
+

Typed Datastructures

@@ -269,7 +269,7 @@ $middlewareQueue = new StrictQueue(['Psr\Http\Server\MiddlewareInterface�
-
+

StrictCollection

@@ -304,9 +304,9 @@ package.

- +
-
+

StrictArray

@@ -341,9 +341,9 @@ package.

- + -
+

StrictList

@@ -367,9 +367,9 @@ types for list items. The list can be accessed and traversed like an array, but
- + -
+

StrictQueue

@@ -400,9 +400,9 @@ queue, because those will ensure proper FIFO behavior and remove items while tra
- + -
+

StrictStack

@@ -420,9 +420,9 @@ last-in, first-out (LIFO) principle meaning that items are returned in the rever alias methods when working with a stack, because those will ensure proper LIFO behavior and remove items while traversing.

-
+ - +
diff --git a/doc/guides/overview/errorhandlers.html b/doc/guides/overview/errorhandlers.html index 5bbcf75..d01c704 100644 --- a/doc/guides/overview/errorhandlers.html +++ b/doc/guides/overview/errorhandlers.html @@ -168,7 +168,7 @@
-
+

Error and Exception Handlers

@@ -184,7 +184,7 @@
-
+

ThrowErrorException

@@ -230,9 +230,9 @@ directive by only throwing an exception if the severity of the internal error is
- +
-
+

TriggerExceptionError

@@ -249,9 +249,9 @@ severity E_USER_ERROR
set_exception_handler(new TriggerExceptionError());
-
+ - +
diff --git a/doc/guides/overview/index.html b/doc/guides/overview/index.html index 5b9c629..ed9c1a4 100644 --- a/doc/guides/overview/index.html +++ b/doc/guides/overview/index.html @@ -168,7 +168,7 @@
-
+

Overview

@@ -313,7 +313,7 @@ projects.

-
+
diff --git a/doc/guides/overview/interfaces.html b/doc/guides/overview/interfaces.html index 954106a..8e89465 100644 --- a/doc/guides/overview/interfaces.html +++ b/doc/guides/overview/interfaces.html @@ -168,7 +168,7 @@
-
+

Interface Traits

@@ -234,7 +234,7 @@ this package.

-
+

ArrayAccessTrait

@@ -265,9 +265,9 @@ this package.

- +
-
+

CountableTrait

@@ -298,9 +298,9 @@ this package.

- + -
+

IteratorAggregateTrait

@@ -331,9 +331,9 @@ this package.

- + -
+

IteratorTrait

@@ -352,9 +352,9 @@ array.

} -
+ - +
diff --git a/doc/guides/overview/traits.html b/doc/guides/overview/traits.html index 4627f22..e699b65 100644 --- a/doc/guides/overview/traits.html +++ b/doc/guides/overview/traits.html @@ -168,7 +168,7 @@
-
+

Traits

@@ -235,7 +235,7 @@ are dependencies of the Typed Data
-
+

Getter

@@ -276,9 +276,9 @@ called when $fooBar
- +
-
+

Setter

@@ -319,9 +319,9 @@ called when $fooBar
- + -
+

OverloadingGetter

@@ -365,9 +365,9 @@ package.

- + -
+

OverloadingSetter

@@ -411,9 +411,9 @@ package.

- + -
+

Singleton

@@ -451,9 +451,9 @@ instantiation of the class.

- + -
+

TypeChecker

@@ -484,9 +484,9 @@ check if a value's data type matches at least one of these types.

and string .

-
+ - +
diff --git a/doc/guides/usage/index.html b/doc/guides/usage/index.html index ce4cc99..e3c622c 100644 --- a/doc/guides/usage/index.html +++ b/doc/guides/usage/index.html @@ -168,7 +168,7 @@
-
+

Download

As a last resort you can also just download the files. You can find all available versions as well as the current development state on the GitHub release page.

-
+ - +
diff --git a/doc/guides/usage/requirements.html b/doc/guides/usage/requirements.html index 15880cf..0aecfb5 100644 --- a/doc/guides/usage/requirements.html +++ b/doc/guides/usage/requirements.html @@ -168,10 +168,10 @@
-
+

Requirements

-
+

Environment

@@ -183,17 +183,17 @@ although it is technically not strictly required for using any of these classes and traits. But it certainly makes it a lot easier!

-
+
-
+

Dependencies

This package does not have any external dependencies.

-
+
- +
diff --git a/doc/index.html b/doc/index.html index ac56e13..3d979a8 100644 --- a/doc/index.html +++ b/doc/index.html @@ -180,9 +180,11 @@ data structures, error and exception handlers, multiple traits implementing standard interfaces, and more generic traits for common use cases. They share the same design principles - like property and method naming schema, highest coding standards of PHPStan - and Psalm, and full PSR-12 - compliance to make sure they can be combined and easily re-used in other projects.

+ like property and method naming schema, highest coding standards of PHPStan, + Psalm, PHP Mess Detector, + PHP_CodeSniffer, and full + PSR-12 compliance to make sure they can be combined and easily + re-used in other projects.

Table of Contents