Skip to content

Commit

Permalink
Update documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
sebastian-meyer committed Feb 19, 2024
1 parent 45c1716 commit 3db89b5
Show file tree
Hide file tree
Showing 73 changed files with 910 additions and 1,109 deletions.
35 changes: 16 additions & 19 deletions .phpdoc/guide/changelog.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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 <https://www.php.net/releases/8.1/>`_ like
`array_is_list() <https://www.php.net/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:**

Expand All @@ -39,8 +42,6 @@ v2.0.0
* Extended API for all datastructures
* Extended `documentation <https://opencultureconsulting.github.io/php-basics/>`_

.. _v1-1-0:

v1.1.0
======

Expand All @@ -57,17 +58,13 @@ v1.1.0
// new constructor signature
public function __construct(array $allowedTypes = [])
.. _v1-0-1:

v1.0.1
======

**New Features:**

* Improved exception handling in :php:trait:`Singleton <OCC\Basics\Traits\Singleton>` trait

.. _v1-0-0:

v1.0.0
======

Expand Down
11 changes: 5 additions & 6 deletions .phpdoc/guide/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,11 @@ Documentation
#############

.. meta::
:layout: landingpage
:layout: landingpage

.. toctree::
:hidden:
:titlesonly:
:hidden:

overview/index
usage/index
changelog
overview/index
usage/index
changelog
50 changes: 49 additions & 1 deletion .phpdoc/guide/usage/installation.rst
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,54 @@
Installation
############

Composer
========

The intended and recommended way of re-using this package is via `Composer <https://getcomposer.org/>`_. 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
# 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
composer require opencultureconsulting/basics
# 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 <https://packagist.org/packages/opencultureconsulting/basics>`_.

Git
===

Alternatively, you can fetch the files from `GitHub <https://github.com/opencultureconsulting/php-basics>`_ 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 <https://github.com/opencultureconsulting/php-basics/releases>`_.
15 changes: 13 additions & 2 deletions .phpdoc/guide/usage/requirements.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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 <https://getcomposer.org/>`_ 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.
Loading

0 comments on commit 3db89b5

Please sign in to comment.