From 3db89b5841a355440ca0177c96c4e87c89cf5cfc Mon Sep 17 00:00:00 2001
From: Sebastian Meyer
Date: Mon, 19 Feb 2024 14:52:57 +0100
Subject: [PATCH] Update documentation
---
.phpdoc/guide/changelog.rst | 35 ++-
.phpdoc/guide/index.rst | 11 +-
.phpdoc/guide/usage/installation.rst | 50 ++++-
.phpdoc/guide/usage/requirements.rst | 15 +-
...asics-DataStructures-StrictCollection.html | 107 ++++-----
.../OCC-Basics-DataStructures-StrictList.html | 163 +++++++-------
...OCC-Basics-DataStructures-StrictQueue.html | 171 +++++++-------
...OCC-Basics-DataStructures-StrictStack.html | 171 +++++++-------
...ics-ErrorHandlers-ThrowErrorException.html | 23 +-
...s-ErrorHandlers-TriggerExceptionError.html | 23 +-
...CC-Basics-Interfaces-ArrayAccessTrait.html | 35 +--
.../OCC-Basics-Interfaces-CountableTrait.html | 23 +-
...ics-Interfaces-IteratorAggregateTrait.html | 15 +-
.../OCC-Basics-Interfaces-IteratorTrait.html | 43 ++--
doc/classes/OCC-Basics-Traits-Getter.html | 27 +--
.../OCC-Basics-Traits-OverloadingGetter.html | 27 +--
.../OCC-Basics-Traits-OverloadingSetter.html | 15 +-
doc/classes/OCC-Basics-Traits-Setter.html | 27 +--
doc/classes/OCC-Basics-Traits-Singleton.html | 15 +-
doc/css/template.css | 2 +-
.../src-datastructures-strictcollection.html | 15 +-
doc/files/src-datastructures-strictlist.html | 15 +-
doc/files/src-datastructures-strictqueue.html | 15 +-
doc/files/src-datastructures-strictstack.html | 15 +-
...src-errorhandlers-throwerrorexception.html | 15 +-
...c-errorhandlers-triggerexceptionerror.html | 15 +-
.../src-interfaces-arrayaccesstrait.html | 15 +-
doc/files/src-interfaces-countabletrait.html | 15 +-
...src-interfaces-iteratoraggregatetrait.html | 15 +-
doc/files/src-interfaces-iteratortrait.html | 15 +-
doc/files/src-traits-getter.html | 15 +-
doc/files/src-traits-overloadinggetter.html | 15 +-
doc/files/src-traits-overloadingsetter.html | 15 +-
doc/files/src-traits-setter.html | 15 +-
doc/files/src-traits-singleton.html | 15 +-
.../DataStructures/StrictCollection.php.txt | 28 +++
.../src/DataStructures/StrictList.php.txt | 30 +++
.../src/DataStructures/StrictQueue.php.txt | 2 +
.../src/DataStructures/StrictStack.php.txt | 2 +
.../ErrorHandlers/ThrowErrorException.php.txt | 2 +
.../TriggerExceptionError.php.txt | 3 +
.../src/Interfaces/ArrayAccessTrait.php.txt | 2 +
.../src/Interfaces/CountableTrait.php.txt | 2 +
.../src/Interfaces/IteratorTrait.php.txt | 7 +
doc/files/src/Traits/Getter.php.txt | 6 +
.../src/Traits/OverloadingGetter.php.txt | 2 +
doc/files/src/Traits/Setter.php.txt | 5 +
doc/graphs/classes.html | 15 +-
doc/guides/changelog.html | 59 ++---
doc/guides/cheatsheet.html | 212 ++++++++++++++++++
doc/guides/index.html | 15 +-
doc/guides/overview/index.html | 15 +-
doc/guides/usage/index.html | 31 +--
doc/guides/usage/installation.html | 56 +++--
doc/guides/usage/requirements.html | 32 +--
doc/index.html | 15 +-
doc/indices/files.html | 15 +-
doc/namespaces/default.html | 15 +-
doc/namespaces/occ-basics-datastructures.html | 15 +-
doc/namespaces/occ-basics-errorhandlers.html | 15 +-
doc/namespaces/occ-basics-interfaces.html | 15 +-
doc/namespaces/occ-basics-traits.html | 15 +-
doc/namespaces/occ-basics.html | 15 +-
doc/namespaces/occ.html | 15 +-
doc/packages/Basics-DataStructures.html | 15 +-
doc/packages/Basics-ErrorHandlers.html | 15 +-
doc/packages/Basics-Interfaces.html | 15 +-
doc/packages/Basics-Traits.html | 15 +-
doc/packages/Basics.html | 15 +-
doc/packages/default.html | 15 +-
doc/reports/deprecated.html | 15 +-
doc/reports/errors.html | 15 +-
doc/reports/markers.html | 15 +-
73 files changed, 910 insertions(+), 1109 deletions(-)
create mode 100644 doc/guides/cheatsheet.html
diff --git a/.phpdoc/guide/changelog.rst b/.phpdoc/guide/changelog.rst
index 00d0f88..ab8d7be 100644
--- a/.phpdoc/guide/changelog.rst
+++ b/.phpdoc/guide/changelog.rst
@@ -3,32 +3,35 @@
Changelog
#########
-* :ref:`v2-0-0`
-* :ref:`v1-1-0`
-* :ref:`v1-0-1`
-* :ref:`v1-0-0`
-
-.. _v2-0-0:
+.. contents::
v2.0.0
======
**Breaking Changes:**
-* Raised minimum PHP version from 8.0 to 8.1
-* Renamed traits for :php:namespace:`OCC\Basics\Interfaces` and moved to different namespace
+* Raised minimum PHP version from 8.0 to 8.1 in order to use `new features `_ like
+ `array_is_list() `_ and the spread operator on string-keyed arrays
+* :php:namespace:`OCC\Basics\Interfaces` traits renamed and moved to different namespace
+
+ .. code-block::
+ OCC\Basics\InterfaceTraits\ArrayAccess -> OCC\Basics\Interfaces\ArrayAccessTrait
+ OCC\Basics\InterfaceTraits\Countable -> OCC\Basics\Interfaces\CountableTrait
+ OCC\Basics\InterfaceTraits\IteratorAggregate -> OCC\Basics\Interfaces\IteratorAggregateTrait
+ OCC\Basics\InterfaceTraits\Iterator -> OCC\Basics\Interfaces\IteratorTrait
+
* Renamed internal methods for :php:trait:`OCC\Basics\Traits\Getter` and :php:trait:`OCC\Basics\Traits\Setter` to avoid
- confusion with regular class method
+ confusion with regular class methods
.. code-block:: php
// old methods
- protected function magicGet{PascalCasePropertyName}(): mixed
- protected function magicSet{PascalCasePropertyName}(mixed $value): void
+ function magicGet{PascalCasePropertyName}(): mixed
+ function magicSet{PascalCasePropertyName}(mixed $value): void
.. code-block:: php
// new methods
- protected function _magicGet{PascalCasePropertyName}(): mixed
- protected function _magicSet{PascalCasePropertyName}(mixed $value): void
+ function _magicGet{PascalCasePropertyName}(): mixed
+ function _magicSet{PascalCasePropertyName}(mixed $value): void
**New Features:**
@@ -39,8 +42,6 @@ v2.0.0
* Extended API for all datastructures
* Extended `documentation `_
-.. _v1-1-0:
-
v1.1.0
======
@@ -57,8 +58,6 @@ v1.1.0
// new constructor signature
public function __construct(array $allowedTypes = [])
-.. _v1-0-1:
-
v1.0.1
======
@@ -66,8 +65,6 @@ v1.0.1
* Improved exception handling in :php:trait:`Singleton ` trait
-.. _v1-0-0:
-
v1.0.0
======
diff --git a/.phpdoc/guide/index.rst b/.phpdoc/guide/index.rst
index e3f6b33..c2a08f9 100644
--- a/.phpdoc/guide/index.rst
+++ b/.phpdoc/guide/index.rst
@@ -4,12 +4,11 @@ Documentation
#############
.. meta::
- :layout: landingpage
+ :layout: landingpage
.. toctree::
- :hidden:
- :titlesonly:
+ :hidden:
- overview/index
- usage/index
- changelog
+ overview/index
+ usage/index
+ changelog
diff --git a/.phpdoc/guide/usage/installation.rst b/.phpdoc/guide/usage/installation.rst
index c0dcfbd..ad96dc2 100644
--- a/.phpdoc/guide/usage/installation.rst
+++ b/.phpdoc/guide/usage/installation.rst
@@ -3,6 +3,54 @@
Installation
############
+Composer
+========
+
+The intended and recommended way of re-using this package is via `Composer `_. The following
+command will get you the latest version and make it a dependency of your project. It will also register all classes and
+traits with the autoloader to make them available inside the application.
+
.. code-block:: shell
- composer require opencultureconsulting/basics
+ # This will install the latest stable version suitable for your project
+ composer require "opencultureconsulting/basics"
+
+If you want to use a specific version other than the latest available for your environment, you can do so by appending
+the desired version constraint:
+
+.. code-block:: shell
+
+ # This will install the latest patch level version of 2.0 (i. e. >=2.0.0 && <2.1.0)
+ composer require "opencultureconsulting/basics:~2.0"
+
+All available versions as well as further information about :doc:`requirements` and dependencies can be found on
+`Packagist `_.
+
+Git
+===
+
+Alternatively, you can fetch the files from `GitHub `_ and add
+them to your project manually. The best way is by cloning the repository, because then you can easily update to a newer
+version by just pulling the changes and checking out a different version tag.
+
+.. code-block:: shell
+
+ # This will clone the repository into the "basics" directory
+ git clone https://github.com/opencultureconsulting/php-basics.git basics
+
+If you want to use a specific version other than the latest development state, you have to specify the desired tag as
+well:
+
+.. code-block:: shell
+
+ # This will clone the repository state at version "2.0.0" into the "basics" directory
+ git clone --branch=v2.0.0 https://github.com/opencultureconsulting/php-basics.git basics
+
+Be aware that you also need to make the classes and traits available in your application by either adding them to your
+autoloader or by including all files individually in PHP.
+
+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/.phpdoc/guide/usage/requirements.rst b/.phpdoc/guide/usage/requirements.rst
index 5f8a60d..a46e1a2 100644
--- a/.phpdoc/guide/usage/requirements.rst
+++ b/.phpdoc/guide/usage/requirements.rst
@@ -3,5 +3,16 @@
Requirements
############
-PHP 8.1
-Composer 2
+Environment
+===========
+
+This package requires at least **PHP 8.1**.
+
+It is highly recommended to use `Composer `_ for dependency management and autoloading,
+although it is technically not strictly required for re-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/classes/OCC-Basics-DataStructures-StrictCollection.html b/doc/classes/OCC-Basics-DataStructures-StrictCollection.html
index b4dbb74..a73c5a9 100644
--- a/doc/classes/OCC-Basics-DataStructures-StrictCollection.html
+++ b/doc/classes/OCC-Basics-DataStructures-StrictCollection.html
@@ -142,8 +142,8 @@
-
Create a type-sensitive collection of items.
@@ -575,9 +575,9 @@ Possible values are:
Read data from an inaccessible property.
@@ -645,9 +645,9 @@ Possible values are:
Check if an inaccessible property is set and not empty.
@@ -698,9 +698,9 @@ Possible values are:
Add/insert a new item at the specified index.
@@ -771,9 +771,9 @@ Possible values are:
Clear the collection of any items.
@@ -806,9 +806,9 @@ Possible values are:
Count the data items.
@@ -849,9 +849,9 @@ Possible values are:
Get the item at the specified index.
@@ -904,9 +904,9 @@ Possible values are:
Get allowed data types for collection items.
@@ -947,9 +947,9 @@ Possible values are:
Check if the item's data type is allowed in the collection.
@@ -1002,9 +1002,9 @@ Possible values are:
Check if collection is empty.
@@ -1045,9 +1045,9 @@ Possible values are:
Check if this collection can be considered a list.
@@ -1106,9 +1106,9 @@ from 0
.
Check if the specified offset exists.
@@ -1161,9 +1161,9 @@ from 0
.
Retrieve data at the specified offset.
@@ -1216,9 +1216,9 @@ from 0
.
Set the item at the specified offset.
@@ -1289,9 +1289,9 @@ from 0
.
Unset the specified offset.
@@ -1336,9 +1336,9 @@ from 0
.
Remove an item from the collection.
@@ -1383,9 +1383,9 @@ from 0
.
Get string representation of $this.
@@ -1424,9 +1424,9 @@ from 0
.
Set an item at the specified index.
@@ -1497,9 +1497,9 @@ from 0
.
Return array representation of collection.
@@ -1540,9 +1540,9 @@ from 0
.
Turn collection into a type-sensitive list.
@@ -1608,9 +1608,9 @@ from 0
.
Restore $this from string representation.
@@ -1653,9 +1653,9 @@ from 0
.
Set allowed data types of collection items.
@@ -1854,17 +1854,6 @@ from 0
.
diff --git a/doc/classes/OCC-Basics-DataStructures-StrictList.html b/doc/classes/OCC-Basics-DataStructures-StrictList.html
index 1d66cd2..72bc23b 100644
--- a/doc/classes/OCC-Basics-DataStructures-StrictList.html
+++ b/doc/classes/OCC-Basics-DataStructures-StrictList.html
@@ -142,8 +142,8 @@
-