Update documentation
This commit is contained in:
parent
0bbeec44c9
commit
d0dcdb5110
|
@ -3,7 +3,8 @@
|
|||
Changelog
|
||||
#########
|
||||
|
||||
.. contents::
|
||||
.. sidebar:: Table of Contents
|
||||
.. contents::
|
||||
|
||||
v2.0.0
|
||||
======
|
||||
|
@ -39,7 +40,9 @@ v2.0.0
|
|||
* Added new error handler :php:class:`OCC\Basics\ErrorHandlers\TriggerExceptionError`
|
||||
* Added new trait :php:trait:`OCC\Basics\Traits\OverloadingGetter`
|
||||
* Added new trait :php:trait:`OCC\Basics\Traits\OverloadingSetter`
|
||||
* Extended API for all datastructures
|
||||
* Added new trait :php:trait:`OCC\Basics\Traits\TypeChecker`
|
||||
* Extended API for all datastructures (see :php:trait:`OCC\Basics\DataStructures\Traits\StrictSplDatastructureTrait`)
|
||||
* Introduced :php:class:`OCC\Basics\DataStructures\Exceptions\InvalidDataTypeException` for strict datastructures
|
||||
* Extended `documentation <https://opencultureconsulting.github.io/php-basics/>`_
|
||||
|
||||
v1.1.0
|
||||
|
|
|
@ -3,11 +3,8 @@
|
|||
Documentation
|
||||
#############
|
||||
|
||||
.. meta::
|
||||
:layout: landingpage
|
||||
|
||||
.. toctree::
|
||||
:hidden:
|
||||
:maxdepth: 2
|
||||
|
||||
overview/index
|
||||
usage/index
|
||||
|
|
|
@ -0,0 +1,79 @@
|
|||
.. title:: Datastructures
|
||||
|
||||
Typed Datastructures
|
||||
####################
|
||||
|
||||
.. sidebar:: Table of Contents
|
||||
.. contents::
|
||||
|
||||
All datastructures in this package have in common that you can control the types of items they can hold.
|
||||
|
||||
To restrict allowed data types for items, provide the constructor with an array of atomic types or fully qualified
|
||||
class names you want to allow as item types. Available atomic types are `array`, `bool`, `callable`, `countable`,
|
||||
`float` / `double`, `int` / `integer` / `long`, `iterable`, `null`, `numeric`, `object`, `resource`, `scalar` and
|
||||
`string`.
|
||||
|
||||
Trying to add an item with a data type not on the list of allowed types to a strict datastructure will result in an
|
||||
:php:class:`OCC\Basics\DataStructures\Exceptions\InvalidDataTypeException`.
|
||||
|
||||
Examples:
|
||||
|
||||
.. code-block:: php
|
||||
// create a collection of strings
|
||||
$stringCollection = new StrictCollection(['string']);
|
||||
|
||||
// create a queue of PSR-15 middlewares
|
||||
$middlewareQueue = new StrictQueue(['Psr\Http\Server\MiddlewareInterface']);
|
||||
|
||||
StrictCollection
|
||||
================
|
||||
|
||||
.. sidebar:: API Documentation
|
||||
:php:class:`OCC\Basics\DataStructures\StrictCollection`
|
||||
|
||||
*A type-sensitive, unsorted collection of items.*
|
||||
|
||||
Holds items as key/value pairs where keys identify the items and have to be valid array keys while values can be of any
|
||||
controlled type.
|
||||
|
||||
A `StrictCollection` can be accessed like an array, but not traversed because it has no particular order. Technically
|
||||
speaking, `StrictCollection` implements `\ArrayAccess <https://www.php.net/arrayaccess>`_, `\Countable
|
||||
<https://www.php.net/countable>`_ and `\Serializable <https://www.php.net/serializable>`_, but no `\Traversable
|
||||
<https://www.php.net/traversable>`_ interface.
|
||||
|
||||
.. note::
|
||||
Internally it holds the items in the `$_data` array, the same as most :php:namespace:`OCC\Basics\Interfaces` and
|
||||
:php:namespace:`OCC\Basics\Traits` of this package.
|
||||
|
||||
StrictList
|
||||
==========
|
||||
|
||||
.. sidebar:: API Documentation
|
||||
:php:class:`OCC\Basics\DataStructures\StrictList`
|
||||
|
||||
*A type-sensitive, taversable list of items.*
|
||||
|
||||
Extends `\SplDoublyLinkedList <https://www.php.net/spldoublylinkedlist>`_ with an option to restrict the allowed data
|
||||
types for list items.
|
||||
|
||||
StrictQueue
|
||||
===========
|
||||
|
||||
.. sidebar:: API Documentation
|
||||
:php:class:`OCC\Basics\DataStructures\StrictQueue`
|
||||
|
||||
*A type-sensitive, taversable queue (FIFO) of items.*
|
||||
|
||||
Extends `\SplDoublyLinkedList <https://www.php.net/spldoublylinkedlist>`_ with an option to restrict the allowed data
|
||||
types for list items.
|
||||
|
||||
StrictStack
|
||||
===========
|
||||
|
||||
.. sidebar:: API Documentation
|
||||
:php:class:`OCC\Basics\DataStructures\StrictStack`
|
||||
|
||||
*A type-sensitive, taversable stack (LIFO) of items.*
|
||||
|
||||
Extends `\SplDoublyLinkedList <https://www.php.net/spldoublylinkedlist>`_ with an option to restrict the allowed data
|
||||
types for list items.
|
|
@ -0,0 +1,27 @@
|
|||
.. title:: Error Handlers
|
||||
|
||||
Error and Exception Handlers
|
||||
############################
|
||||
|
||||
.. sidebar:: Table of Contents
|
||||
.. contents::
|
||||
|
||||
ThrowErrorException
|
||||
===================
|
||||
|
||||
Throws internal errors as exceptions.
|
||||
|
||||
If registered as error handler, this converts an internal PHP error into an
|
||||
`ErrorException`. It respects the `error_reporting` directive.
|
||||
|
||||
> Usage: `set_error_handler(new ThrowErrorException());`
|
||||
|
||||
TriggerExceptionError
|
||||
=====================
|
||||
|
||||
Triggers errors for uncaught exceptions.
|
||||
|
||||
If registered as exception handler, this catches an uncaught exception and
|
||||
converts it into an internal PHP error of severity `E_USER_ERROR`.
|
||||
|
||||
> Usage: `set_exception_handler(new TriggerExceptionError());`
|
|
@ -2,3 +2,17 @@
|
|||
|
||||
Overview
|
||||
########
|
||||
|
||||
The package currently contains classes for :doc:`datastructures`, :doc:`errorhandlers`, multiple :doc:`interfaces`, and
|
||||
more generic :doc:`traits` for common use cases. They share the same design principles like property and method naming
|
||||
schema, the highest coding standards of `PHPStan <https://phpstan.org/>`_ and `Psalm <https://psalm.dev/>`_, and full
|
||||
`PSR-12 <https://www.php-fig.org/psr/psr-12/>`_ compliance to make sure they can be combined and easily re-used in
|
||||
other projects.
|
||||
|
||||
.. toctree::
|
||||
:maxdepth: 2
|
||||
|
||||
datastructures
|
||||
errorhandlers
|
||||
interfaces
|
||||
traits
|
||||
|
|
|
@ -0,0 +1,35 @@
|
|||
.. title:: Interfaces
|
||||
|
||||
Interface Traits
|
||||
################
|
||||
|
||||
.. sidebar:: Table of Contents
|
||||
.. contents::
|
||||
|
||||
ArrayAccessTrait
|
||||
================
|
||||
|
||||
A generic implementation of the ArrayAccess interface.
|
||||
|
||||
Internally it accesses the protected `$_data` array.
|
||||
|
||||
CountableTrait
|
||||
==============
|
||||
|
||||
A generic implementation of the Countable interface.
|
||||
|
||||
Internally it counts the values of the protected `$_data` array.
|
||||
|
||||
IteratorAggregateTrait
|
||||
======================
|
||||
|
||||
A generic implementation of the IteratorAggregate interface.
|
||||
|
||||
Internally it iterates over the protected `$_data` array.
|
||||
|
||||
IteratorTrait
|
||||
=============
|
||||
|
||||
A generic implementation of the Iterator interface.
|
||||
|
||||
Internally it iterates over the protected `$_data` array.
|
|
@ -0,0 +1,78 @@
|
|||
.. title:: Traits
|
||||
|
||||
Traits
|
||||
######
|
||||
|
||||
.. sidebar:: Table of Contents
|
||||
.. contents::
|
||||
|
||||
Getter
|
||||
======
|
||||
|
||||
Reads data from inaccessible properties by using magic methods.
|
||||
|
||||
To make a `protected` or `private` property readable, provide a method named
|
||||
`_magicGet{Property}()` which handles the reading. Replace `{Property}` in
|
||||
the method's name with the name of the actual property (with an uppercase
|
||||
first letter).
|
||||
|
||||
> Example: If the property is named `$fooBar`, the "magic" method has to be
|
||||
> `_magicGetFooBar()`. This method is then called when `$fooBar` is read in
|
||||
> a context where it normally would not be accessible.
|
||||
|
||||
OverloadingGetter
|
||||
=================
|
||||
|
||||
Overloads a class with readable magic properties.
|
||||
|
||||
Internally it reads the protected `$_data` array whose keys are interpreted
|
||||
as property names.
|
||||
|
||||
> Example: Reading `Foo->bar` will return the value of `$_data['bar']`.
|
||||
|
||||
OverloadingSetter
|
||||
=================
|
||||
|
||||
Overloads a class with writable magic properties.
|
||||
|
||||
Internally it writes the protected `$_data` array whose keys are interpreted
|
||||
as property names.
|
||||
|
||||
> Example: `Foo->bar = 42;` will set `$_data['bar']` to `42`.
|
||||
|
||||
Setter
|
||||
======
|
||||
|
||||
Writes data to inaccessible properties by using magic methods.
|
||||
|
||||
To make a `protected` or `private` property writable, provide a method named
|
||||
`_magicSet{Property}()` which handles the writing. Replace `{Property}` in
|
||||
the method's name with the name of the actual property (with an uppercase
|
||||
first letter).
|
||||
|
||||
> Example: If the property is named `$fooBar`, the "magic" method has to be
|
||||
> `_magicSetFooBar()`. This method is then called when `$fooBar` is written
|
||||
> to in a context where it normally would not be accessible.
|
||||
|
||||
Singleton
|
||||
=========
|
||||
|
||||
Allows just a single instance of the class using this trait.
|
||||
|
||||
Get the singleton by calling the static method `getInstance()`.
|
||||
|
||||
If there is no object yet, the constructor is called with the same arguments
|
||||
as `getInstance()`. Any later call will just return the already instantiated
|
||||
object (irrespective of the given arguments).
|
||||
|
||||
In order for this to work as expected, the constructor has to be implemented
|
||||
as `private` to prevent direct instantiation of the class.
|
||||
|
||||
TypeChecker
|
||||
===========
|
||||
|
||||
A generic data type checker.
|
||||
|
||||
This allows to set a list of allowed atomic data types and fully qualified
|
||||
class names. It also provides a method to check if a value's data type matches
|
||||
at least one of these types.
|
|
@ -3,8 +3,12 @@
|
|||
User Guide
|
||||
##########
|
||||
|
||||
.. toctree::
|
||||
:maxdepth: 2
|
||||
The *PHP Basics* are a library package, not a stand-alone application. The following documentation of requirements and
|
||||
installation procedures describes how to make use of the classes and traits within your own application. For a detailed
|
||||
description of the package's contents have a look at the :doc:`../overview/index` page.
|
||||
|
||||
requirements
|
||||
installation
|
||||
.. toctree::
|
||||
:maxdepth: 2
|
||||
|
||||
requirements
|
||||
installation
|
||||
|
|
|
@ -3,6 +3,9 @@
|
|||
Installation
|
||||
############
|
||||
|
||||
.. sidebar:: Table of Contents
|
||||
.. contents::
|
||||
|
||||
Composer
|
||||
========
|
||||
|
||||
|
|
|
@ -40,6 +40,8 @@ aside.phpdocumentor-sidebar
|
|||
padding: 0 var(--spacing-md) !important;
|
||||
}
|
||||
|
||||
p > code,
|
||||
li > code,
|
||||
code.prettyprint
|
||||
{
|
||||
background-color: var(--code-background-color);
|
||||
|
@ -50,6 +52,38 @@ code.prettyprint
|
|||
padding: var(--spacing-xxxs);
|
||||
}
|
||||
|
||||
@media (max-width: 999px) {
|
||||
div.admonition-wrapper
|
||||
{
|
||||
display: none;
|
||||
}
|
||||
}
|
||||
|
||||
@media (min-width: 1000px) {
|
||||
div.admonition-wrapper
|
||||
{
|
||||
display: block;
|
||||
float: right;
|
||||
padding: var(--spacing-md);
|
||||
margin: 0 0 var(--spacing-md) var(--spacing-md);
|
||||
width: auto;
|
||||
font-size: var(--text-sm);
|
||||
border: 1px solid var(--primary-color-lighten);
|
||||
}
|
||||
}
|
||||
|
||||
div.admonition-wrapper
|
||||
p.sidebar-title
|
||||
{
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
div.contents
|
||||
ul.phpdocumentor-list
|
||||
{
|
||||
margin-bottom: 0;
|
||||
}
|
||||
|
||||
div.phpdocumentor-content
|
||||
div.section
|
||||
ul
|
||||
|
|
|
@ -10,10 +10,10 @@
|
|||
|
||||
<p class="phpdocumentor-summary">A collection of generic classes and useful traits for PHP projects.</p>
|
||||
|
||||
<p>The package currently contains classes for <a href="packages/Basics-DataStructures.html">type-sensitive
|
||||
data structures</a>, <a href="packages/Basics-ErrorHandlers.html">error and exception handlers</a>, multiple
|
||||
<a href="packages/Basics-Interfaces.html">traits implementing standard interfaces</a>, and more generic
|
||||
<a href="packages/Basics-Traits.html">traits for common use cases</a>. They share the same design principles
|
||||
<p>The package currently contains classes for <a href="guides/overview/datastructures.html">type-sensitive
|
||||
data structures</a>, <a href="guides/overview/errorhandlers.html">error and exception handlers</a>, multiple
|
||||
<a href="guides/overview/interfaces.html">traits implementing standard interfaces</a>, and more generic
|
||||
<a href="guides/overview/traits.html">traits for common use cases</a>. They share the same design principles
|
||||
like property and method naming schema, highest coding standards of <a href="https://phpstan.org/">PHPStan</a>
|
||||
and <a href="https://psalm.dev/">Psalm</a>, and full <a href="https://www.php-fig.org/psr/psr-12/">PSR-12</a>
|
||||
compliance to make sure they can be combined and easily re-used in other projects.</p>
|
||||
|
|
|
@ -0,0 +1,396 @@
|
|||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<title>PHP Basics</title>
|
||||
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<base href="../">
|
||||
<link rel="icon" href="images/favicon.ico"/>
|
||||
<link rel="stylesheet" href="css/normalize.css">
|
||||
<link rel="stylesheet" href="css/base.css">
|
||||
<link rel="preconnect" href="https://fonts.gstatic.com">
|
||||
<link href="https://fonts.googleapis.com/css2?family=Open+Sans:wght@100;200;300;400;600;700&display=swap" rel="stylesheet">
|
||||
<link href="https://fonts.googleapis.com/css2?family=Source+Code+Pro:wght@400;600;700&display=swap" rel="stylesheet">
|
||||
<link rel="stylesheet" href="css/template.css">
|
||||
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.12.0/css/all.min.css" integrity="sha256-ybRkN9dBjhcS2qrW1z+hfCxq+1aBdwyQM5wlQoQVt/0=" crossorigin="anonymous" />
|
||||
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/prismjs@1.23.0/themes/prism-okaidia.css">
|
||||
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/prismjs@1.23.0/plugins/line-numbers/prism-line-numbers.css">
|
||||
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/prismjs@1.23.0/plugins/line-highlight/prism-line-highlight.css">
|
||||
<script src="https://cdn.jsdelivr.net/npm/fuse.js@3.4.6"></script>
|
||||
<script src="https://cdn.jsdelivr.net/npm/css-vars-ponyfill@2"></script>
|
||||
<script src="js/template.js"></script>
|
||||
<script src="js/search.js"></script>
|
||||
<script defer src="js/searchIndex.js"></script>
|
||||
</head>
|
||||
<body id="top">
|
||||
<header class="phpdocumentor-header phpdocumentor-section">
|
||||
<h1 class="phpdocumentor-title"><a href="" class="phpdocumentor-title__link">PHP Basics</a></h1>
|
||||
<input class="phpdocumentor-header__menu-button" type="checkbox" id="menu-button" name="menu-button" />
|
||||
<label class="phpdocumentor-header__menu-icon" for="menu-button">
|
||||
<i class="fas fa-bars"></i>
|
||||
</label>
|
||||
<section data-search-form class="phpdocumentor-search">
|
||||
<label>
|
||||
<span class="visually-hidden">Search for</span>
|
||||
<svg class="phpdocumentor-search__icon" width="21" height="20" viewBox="0 0 21 20" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||||
<circle cx="7.5" cy="7.5" r="6.5" stroke="currentColor" stroke-width="2"/>
|
||||
<line x1="12.4892" y1="12.2727" x2="19.1559" y2="18.9393" stroke="currentColor" stroke-width="3"/>
|
||||
</svg>
|
||||
<input type="search" class="phpdocumentor-field phpdocumentor-search__field" placeholder="Loading .." disabled />
|
||||
</label>
|
||||
</section>
|
||||
|
||||
|
||||
<nav class="phpdocumentor-topnav">
|
||||
<ul class="phpdocumentor-topnav__menu">
|
||||
<li class="phpdocumentor-topnav__menu-item -menu">
|
||||
<a href="https://packagist.org/packages/opencultureconsulting/basics">
|
||||
<span>
|
||||
<i class="fab fa-php"></i>
|
||||
|
||||
</span>
|
||||
</a>
|
||||
</li>
|
||||
<li class="phpdocumentor-topnav__menu-item -menu">
|
||||
<a href="https://github.com/opencultureconsulting/php-basics">
|
||||
<span>
|
||||
<i class="fab fa-github"></i>
|
||||
|
||||
</span>
|
||||
</a>
|
||||
</li>
|
||||
</ul>
|
||||
</nav>
|
||||
</header>
|
||||
|
||||
<main class="phpdocumentor">
|
||||
<div class="phpdocumentor-section">
|
||||
<input class="phpdocumentor-sidebar__menu-button" type="checkbox" id="sidebar-button" name="sidebar-button" />
|
||||
<label class="phpdocumentor-sidebar__menu-icon" for="sidebar-button">
|
||||
Menu
|
||||
</label>
|
||||
<aside class="phpdocumentor-column -three phpdocumentor-sidebar">
|
||||
<section class="phpdocumentor-sidebar__category -documentation">
|
||||
<h2 class="phpdocumentor-sidebar__category-header">Documentation</h2>
|
||||
<h4 class="phpdocumentor-sidebar__root-namespace">
|
||||
<a href="guides/overview/index.html#overview" class="">Overview</a>
|
||||
</h4>
|
||||
<ul class="phpdocumentor-list">
|
||||
<li>
|
||||
<a href="guides/overview/datastructures.html#typed-datastructures" class="">Typed Datastructures</a>
|
||||
|
||||
</li>
|
||||
<li>
|
||||
<a href="guides/overview/errorhandlers.html#error-and-exception-handlers" class="">Error and Exception Handlers</a>
|
||||
|
||||
</li>
|
||||
<li>
|
||||
<a href="guides/overview/interfaces.html#interface-traits" class="">Interface Traits</a>
|
||||
|
||||
</li>
|
||||
<li>
|
||||
<a href="guides/overview/traits.html#traits" class="">Traits</a>
|
||||
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
<h4 class="phpdocumentor-sidebar__root-namespace">
|
||||
<a href="guides/usage/index.html#user-guide" class="">User Guide</a>
|
||||
</h4>
|
||||
<ul class="phpdocumentor-list">
|
||||
<li>
|
||||
<a href="guides/usage/requirements.html#requirements" class="">Requirements</a>
|
||||
|
||||
</li>
|
||||
<li>
|
||||
<a href="guides/usage/installation.html#installation" class="">Installation</a>
|
||||
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
<h4 class="phpdocumentor-sidebar__root-namespace">
|
||||
<a href="guides/changelog.html#changelog" class="">Changelog</a>
|
||||
</h4>
|
||||
|
||||
</section>
|
||||
<section class="phpdocumentor-sidebar__category -namespaces">
|
||||
<h2 class="phpdocumentor-sidebar__category-header">Namespaces</h2>
|
||||
<h4 class="phpdocumentor-sidebar__root-namespace">
|
||||
<a href="namespaces/occ.html" class="">OCC</a>
|
||||
</h4>
|
||||
<ul class="phpdocumentor-list">
|
||||
<li>
|
||||
<a href="namespaces/occ-basics.html" class="">Basics</a>
|
||||
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
</section>
|
||||
<section class="phpdocumentor-sidebar__category -packages">
|
||||
<h2 class="phpdocumentor-sidebar__category-header">Packages</h2>
|
||||
<h4 class="phpdocumentor-sidebar__root-namespace">
|
||||
<a href="packages/Basics.html" class="">Basics</a>
|
||||
</h4>
|
||||
<ul class="phpdocumentor-list">
|
||||
<li>
|
||||
<a href="packages/Basics-DataStructures.html" class="">DataStructures</a>
|
||||
|
||||
</li>
|
||||
<li>
|
||||
<a href="packages/Basics-ErrorHandlers.html" class="">ErrorHandlers</a>
|
||||
|
||||
</li>
|
||||
<li>
|
||||
<a href="packages/Basics-Interfaces.html" class="">Interfaces</a>
|
||||
|
||||
</li>
|
||||
<li>
|
||||
<a href="packages/Basics-Traits.html" class="">Traits</a>
|
||||
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
</section>
|
||||
|
||||
<section class="phpdocumentor-sidebar__category -reports">
|
||||
<h2 class="phpdocumentor-sidebar__category-header">Reports</h2>
|
||||
<h3 class="phpdocumentor-sidebar__root-package"><a href="reports/deprecated.html">Deprecated</a></h3>
|
||||
<h3 class="phpdocumentor-sidebar__root-package"><a href="reports/errors.html">Errors</a></h3>
|
||||
<h3 class="phpdocumentor-sidebar__root-package"><a href="reports/markers.html">Markers</a></h3>
|
||||
</section>
|
||||
|
||||
<section class="phpdocumentor-sidebar__category -indices">
|
||||
<h2 class="phpdocumentor-sidebar__category-header">Indices</h2>
|
||||
<h3 class="phpdocumentor-sidebar__root-package"><a href="indices/files.html">Files</a></h3>
|
||||
</section>
|
||||
</aside>
|
||||
|
||||
<div class="phpdocumentor-column -nine phpdocumentor-content">
|
||||
<section>
|
||||
<ul class="phpdocumentor-breadcrumbs">
|
||||
<li class="phpdocumentor-breadcrumb"><a href="namespaces/occ.html">OCC</a></li>
|
||||
<li class="phpdocumentor-breadcrumb"><a href="namespaces/occ-basics.html">Basics</a></li>
|
||||
<li class="phpdocumentor-breadcrumb"><a href="namespaces/occ-basics-datastructures.html">DataStructures</a></li>
|
||||
<li class="phpdocumentor-breadcrumb"><a href="namespaces/occ-basics-datastructures-exceptions.html">Exceptions</a></li>
|
||||
</ul>
|
||||
|
||||
<article class="phpdocumentor-element -class">
|
||||
<h2 class="phpdocumentor-content__title">
|
||||
InvalidDataTypeException
|
||||
|
||||
<span class="phpdocumentor-element__extends">
|
||||
extends <abbr title="\DomainException">DomainException</abbr>
|
||||
</span>
|
||||
|
||||
<div class="phpdocumentor-element__package">
|
||||
in package
|
||||
<ul class="phpdocumentor-breadcrumbs">
|
||||
<li class="phpdocumentor-breadcrumb"><a href="packages/Basics.html">Basics</a></li>
|
||||
<li class="phpdocumentor-breadcrumb"><a href="packages/Basics-DataStructures.html">DataStructures</a></li>
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
|
||||
</h2>
|
||||
|
||||
<div class="phpdocumentor-label-line">
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
<aside class="phpdocumentor-element-found-in">
|
||||
<abbr class="phpdocumentor-element-found-in__file" title="src/DataStructures/Exceptions/InvalidDataTypeException.php"><a href="files/src-datastructures-exceptions-invaliddatatypeexception.html"><abbr title="src/DataStructures/Exceptions/InvalidDataTypeException.php">InvalidDataTypeException.php</abbr></a></abbr>
|
||||
:
|
||||
<span class="phpdocumentor-element-found-in__line">37</span>
|
||||
|
||||
<a href="classes/OCC-Basics-DataStructures-Exceptions-InvalidDataTypeException.html#source-view.37" class="phpdocumentor-element-found-in__source" data-line="37" data-modal="source-view" data-src="files/src/DataStructures/Exceptions/InvalidDataTypeException.php.txt"></a>
|
||||
</aside>
|
||||
|
||||
<p class="phpdocumentor-summary">Common exception for type-sensitive datastructures.</p>
|
||||
|
||||
<section class="phpdocumentor-description"><p>Exception thrown if a value does not adhere to the defined list of valid
|
||||
data types.</p>
|
||||
</section>
|
||||
|
||||
|
||||
<h5 class="phpdocumentor-tag-list__heading" id="tags">
|
||||
Tags
|
||||
<a href="classes/OCC-Basics-DataStructures-Exceptions-InvalidDataTypeException.html#tags" class="headerlink"><i class="fas fa-link"></i></a>
|
||||
|
||||
</h5>
|
||||
<dl class="phpdocumentor-tag-list">
|
||||
<dt class="phpdocumentor-tag-list__entry">
|
||||
<span class="phpdocumentor-tag__name">author</span>
|
||||
</dt>
|
||||
<dd class="phpdocumentor-tag-list__definition">
|
||||
|
||||
<section class="phpdocumentor-description"><p>Sebastian Meyer <a href="mailto:sebastian.meyer@opencultureconsulting.com">sebastian.meyer@opencultureconsulting.com</a></p>
|
||||
</section>
|
||||
|
||||
</dd>
|
||||
</dl>
|
||||
|
||||
|
||||
|
||||
<h3 id="toc">
|
||||
Table of Contents
|
||||
<a href="classes/OCC-Basics-DataStructures-Exceptions-InvalidDataTypeException.html#toc" class="headerlink"><i class="fas fa-link"></i></a>
|
||||
|
||||
</h3>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<div class="phpdocumentor-modal" id="source-view">
|
||||
<div class="phpdocumentor-modal-bg" data-exit-button></div>
|
||||
<div class="phpdocumentor-modal-container">
|
||||
<div class="phpdocumentor-modal-content">
|
||||
<pre style="max-height: 500px; overflow-y: scroll" data-src="files/src/DataStructures/Exceptions/InvalidDataTypeException.php.txt" class="language-php line-numbers linkable-line-numbers"></pre>
|
||||
</div>
|
||||
<button data-exit-button class="phpdocumentor-modal__close">×</button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<script type="text/javascript">
|
||||
(function () {
|
||||
function loadExternalCodeSnippet(el, url, line) {
|
||||
Array.prototype.slice.call(el.querySelectorAll('pre[data-src]')).forEach((pre) => {
|
||||
const src = url || pre.getAttribute('data-src').replace(/\\/g, '/');
|
||||
const language = 'php';
|
||||
|
||||
const code = document.createElement('code');
|
||||
code.className = 'language-' + language;
|
||||
pre.textContent = '';
|
||||
pre.setAttribute('data-line', line)
|
||||
code.textContent = 'Loading…';
|
||||
pre.appendChild(code);
|
||||
|
||||
var xhr = new XMLHttpRequest();
|
||||
|
||||
xhr.open('GET', src, true);
|
||||
|
||||
xhr.onreadystatechange = function () {
|
||||
if (xhr.readyState !== 4) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (xhr.status < 400 && xhr.responseText) {
|
||||
code.textContent = xhr.responseText;
|
||||
Prism.highlightElement(code);
|
||||
return;
|
||||
}
|
||||
|
||||
if (xhr.status === 404) {
|
||||
code.textContent = '✖ Error: File could not be found';
|
||||
return;
|
||||
}
|
||||
|
||||
if (xhr.status >= 400) {
|
||||
code.textContent = '✖ Error ' + xhr.status + ' while fetching file: ' + xhr.statusText;
|
||||
return;
|
||||
}
|
||||
|
||||
code.textContent = '✖ Error: An unknown error occurred';
|
||||
};
|
||||
|
||||
xhr.send(null);
|
||||
});
|
||||
}
|
||||
|
||||
const modalButtons = document.querySelectorAll("[data-modal]");
|
||||
const openedAsLocalFile = window.location.protocol === 'file:';
|
||||
if (modalButtons.length > 0 && openedAsLocalFile) {
|
||||
console.warn(
|
||||
'Viewing the source code is unavailable because you are opening this page from the file:// scheme; ' +
|
||||
'browsers block XHR requests when a page is opened this way'
|
||||
);
|
||||
}
|
||||
|
||||
modalButtons.forEach(function (trigger) {
|
||||
if (openedAsLocalFile) {
|
||||
trigger.setAttribute("hidden", "hidden");
|
||||
}
|
||||
|
||||
trigger.addEventListener("click", function (event) {
|
||||
event.preventDefault();
|
||||
const modal = document.getElementById(trigger.dataset.modal);
|
||||
if (!modal) {
|
||||
console.error(`Modal with id "${trigger.dataset.modal}" could not be found`);
|
||||
return;
|
||||
}
|
||||
modal.classList.add("phpdocumentor-modal__open");
|
||||
|
||||
loadExternalCodeSnippet(modal, trigger.dataset.src || null, trigger.dataset.line)
|
||||
const exits = modal.querySelectorAll("[data-exit-button]");
|
||||
exits.forEach(function (exit) {
|
||||
exit.addEventListener("click", function (event) {
|
||||
event.preventDefault();
|
||||
modal.classList.remove("phpdocumentor-modal__open");
|
||||
});
|
||||
});
|
||||
});
|
||||
});
|
||||
})();
|
||||
</script>
|
||||
|
||||
</article>
|
||||
</section>
|
||||
<section class="phpdocumentor-on-this-page__sidebar">
|
||||
|
||||
<section class="phpdocumentor-on-this-page__content">
|
||||
<strong class="phpdocumentor-on-this-page__title">On this page</strong>
|
||||
|
||||
<ul class="phpdocumentor-list -clean">
|
||||
<li class="phpdocumentor-on-this-page-section__title">Table Of Contents</li>
|
||||
<li>
|
||||
<ul class="phpdocumentor-list -clean">
|
||||
</ul>
|
||||
</li>
|
||||
|
||||
|
||||
</ul>
|
||||
</section>
|
||||
|
||||
</section>
|
||||
</div>
|
||||
<section data-search-results class="phpdocumentor-search-results phpdocumentor-search-results--hidden">
|
||||
<section class="phpdocumentor-search-results__dialog">
|
||||
<header class="phpdocumentor-search-results__header">
|
||||
<h2 class="phpdocumentor-search-results__title">Search results</h2>
|
||||
<button class="phpdocumentor-search-results__close"><i class="fas fa-times"></i></button>
|
||||
</header>
|
||||
<section class="phpdocumentor-search-results__body">
|
||||
<ul class="phpdocumentor-search-results__entries"></ul>
|
||||
</section>
|
||||
</section>
|
||||
</section>
|
||||
</div>
|
||||
<a href="classes/OCC-Basics-DataStructures-Exceptions-InvalidDataTypeException.html#top" class="phpdocumentor-back-to-top"><i class="fas fa-chevron-circle-up"></i></a>
|
||||
|
||||
</main>
|
||||
|
||||
<script>
|
||||
cssVars({});
|
||||
</script>
|
||||
<script src="https://cdn.jsdelivr.net/npm/prismjs@1.23.0/prism.min.js"></script>
|
||||
<script src="https://cdn.jsdelivr.net/npm/prismjs@1.23.0/plugins/autoloader/prism-autoloader.min.js"></script>
|
||||
<script src="https://cdn.jsdelivr.net/npm/prismjs@1.23.0/plugins/line-numbers/prism-line-numbers.min.js"></script>
|
||||
<script src="https://cdn.jsdelivr.net/npm/prismjs@1.23.0/plugins/line-highlight/prism-line-highlight.min.js"></script>
|
||||
</body>
|
||||
</html>
|
|
@ -76,6 +76,24 @@
|
|||
<h4 class="phpdocumentor-sidebar__root-namespace">
|
||||
<a href="guides/overview/index.html#overview" class="">Overview</a>
|
||||
</h4>
|
||||
<ul class="phpdocumentor-list">
|
||||
<li>
|
||||
<a href="guides/overview/datastructures.html#typed-datastructures" class="">Typed Datastructures</a>
|
||||
|
||||
</li>
|
||||
<li>
|
||||
<a href="guides/overview/errorhandlers.html#error-and-exception-handlers" class="">Error and Exception Handlers</a>
|
||||
|
||||
</li>
|
||||
<li>
|
||||
<a href="guides/overview/interfaces.html#interface-traits" class="">Interface Traits</a>
|
||||
|
||||
</li>
|
||||
<li>
|
||||
<a href="guides/overview/traits.html#traits" class="">Traits</a>
|
||||
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
<h4 class="phpdocumentor-sidebar__root-namespace">
|
||||
<a href="guides/usage/index.html#user-guide" class="">User Guide</a>
|
||||
|
@ -175,7 +193,7 @@
|
|||
|
||||
<span class="phpdocumentor-element__extends">
|
||||
Uses
|
||||
<a href="classes/OCC-Basics-Interfaces-ArrayAccessTrait.html"><abbr title="\OCC\Basics\Interfaces\ArrayAccessTrait">ArrayAccessTrait</abbr></a>, <a href="classes/OCC-Basics-Interfaces-CountableTrait.html"><abbr title="\OCC\Basics\Interfaces\CountableTrait">CountableTrait</abbr></a>, <a href="classes/OCC-Basics-Traits-Getter.html"><abbr title="\OCC\Basics\Traits\Getter">Getter</abbr></a> </span>
|
||||
<a href="classes/OCC-Basics-Interfaces-ArrayAccessTrait.html"><abbr title="\OCC\Basics\Interfaces\ArrayAccessTrait">ArrayAccessTrait</abbr></a>, <a href="classes/OCC-Basics-Interfaces-CountableTrait.html"><abbr title="\OCC\Basics\Interfaces\CountableTrait">CountableTrait</abbr></a>, <a href="classes/OCC-Basics-Traits-TypeChecker.html"><abbr title="\OCC\Basics\Traits\TypeChecker">TypeChecker</abbr></a> </span>
|
||||
</h2>
|
||||
|
||||
<div class="phpdocumentor-label-line">
|
||||
|
@ -186,9 +204,9 @@
|
|||
<aside class="phpdocumentor-element-found-in">
|
||||
<abbr class="phpdocumentor-element-found-in__file" title="src/DataStructures/StrictCollection.php"><a href="files/src-datastructures-strictcollection.html"><abbr title="src/DataStructures/StrictCollection.php">StrictCollection.php</abbr></a></abbr>
|
||||
:
|
||||
<span class="phpdocumentor-element-found-in__line">83</span>
|
||||
<span class="phpdocumentor-element-found-in__line">63</span>
|
||||
|
||||
<a href="classes/OCC-Basics-DataStructures-StrictCollection.html#source-view.83" class="phpdocumentor-element-found-in__source" data-line="83" data-modal="source-view" data-src="files/src/DataStructures/StrictCollection.php.txt"></a>
|
||||
<a href="classes/OCC-Basics-DataStructures-StrictCollection.html#source-view.63" class="phpdocumentor-element-found-in__source" data-line="63" data-modal="source-view" data-src="files/src/DataStructures/StrictCollection.php.txt"></a>
|
||||
</aside>
|
||||
|
||||
<p class="phpdocumentor-summary">A type-sensitive, unsorted collection.</p>
|
||||
|
@ -250,19 +268,6 @@ names.</p>
|
|||
|
||||
|
||||
|
||||
<h4 id="toc-properties">
|
||||
Properties
|
||||
<a href="classes/OCC-Basics-DataStructures-StrictCollection.html#toc-properties" class="headerlink"><i class="fas fa-link"></i></a>
|
||||
|
||||
</h4>
|
||||
<dl class="phpdocumentor-table-of-contents">
|
||||
<dt class="phpdocumentor-table-of-contents__entry -property -public">
|
||||
<a href="classes/OCC-Basics-DataStructures-StrictCollection.html#property_allowedTypes">$allowedTypes</a>
|
||||
<span>
|
||||
: array<string|int, string> </span>
|
||||
</dt>
|
||||
|
||||
</dl>
|
||||
|
||||
<h4 id="toc-methods">
|
||||
Methods
|
||||
|
@ -277,26 +282,12 @@ names.</p>
|
|||
</dt>
|
||||
<dd>Create a type-sensitive collection of items.</dd>
|
||||
|
||||
<dt class="phpdocumentor-table-of-contents__entry -method -public">
|
||||
<a href="classes/OCC-Basics-Traits-Getter.html#method___get">__get()</a>
|
||||
<span>
|
||||
: mixed </span>
|
||||
</dt>
|
||||
<dd>Read data from an inaccessible property.</dd>
|
||||
|
||||
<dt class="phpdocumentor-table-of-contents__entry -method -public">
|
||||
<a href="classes/OCC-Basics-Traits-Getter.html#method___isset">__isset()</a>
|
||||
<span>
|
||||
: bool </span>
|
||||
</dt>
|
||||
<dd>Check if an inaccessible property is set and not empty.</dd>
|
||||
|
||||
<dt class="phpdocumentor-table-of-contents__entry -method -public">
|
||||
<a href="classes/OCC-Basics-DataStructures-StrictCollection.html#method_add">add()</a>
|
||||
<span>
|
||||
: void </span>
|
||||
</dt>
|
||||
<dd>Add/insert a new item at the specified index.</dd>
|
||||
<dd>Add/insert a item at the specified index.</dd>
|
||||
|
||||
<dt class="phpdocumentor-table-of-contents__entry -method -public">
|
||||
<a href="classes/OCC-Basics-DataStructures-StrictCollection.html#method_clear">clear()</a>
|
||||
|
@ -315,23 +306,30 @@ names.</p>
|
|||
<dt class="phpdocumentor-table-of-contents__entry -method -public">
|
||||
<a href="classes/OCC-Basics-DataStructures-StrictCollection.html#method_get">get()</a>
|
||||
<span>
|
||||
: <abbr title="\OCC\Basics\DataStructures\AllowedType">AllowedType</abbr>|null </span>
|
||||
: <abbr title="\OCC\Basics\DataStructures\AllowedType">AllowedType</abbr> </span>
|
||||
</dt>
|
||||
<dd>Get the item at the specified index.</dd>
|
||||
|
||||
<dt class="phpdocumentor-table-of-contents__entry -method -public">
|
||||
<a href="classes/OCC-Basics-DataStructures-StrictCollection.html#method_getAllowedTypes">getAllowedTypes()</a>
|
||||
<a href="classes/OCC-Basics-Traits-TypeChecker.html#method_getAllowedTypes">getAllowedTypes()</a>
|
||||
<span>
|
||||
: array<string|int, string> </span>
|
||||
</dt>
|
||||
<dd>Get allowed data types for collection items.</dd>
|
||||
<dd>Get allowed data types.</dd>
|
||||
|
||||
<dt class="phpdocumentor-table-of-contents__entry -method -public">
|
||||
<a href="classes/OCC-Basics-DataStructures-StrictCollection.html#method_isAllowedType">isAllowedType()</a>
|
||||
<a href="classes/OCC-Basics-Traits-TypeChecker.html#method_hasAllowedType">hasAllowedType()</a>
|
||||
<span>
|
||||
: bool </span>
|
||||
</dt>
|
||||
<dd>Check if the item's data type is allowed in the collection.</dd>
|
||||
<dd>Check if a value's data type is allowed.</dd>
|
||||
|
||||
<dt class="phpdocumentor-table-of-contents__entry -method -public">
|
||||
<a href="classes/OCC-Basics-Traits-TypeChecker.html#method_isAllowedType">isAllowedType()</a>
|
||||
<span>
|
||||
: bool </span>
|
||||
</dt>
|
||||
<dd>Check if a data type is allowed.</dd>
|
||||
|
||||
<dt class="phpdocumentor-table-of-contents__entry -method -public">
|
||||
<a href="classes/OCC-Basics-DataStructures-StrictCollection.html#method_isEmpty">isEmpty()</a>
|
||||
|
@ -396,6 +394,13 @@ names.</p>
|
|||
</dt>
|
||||
<dd>Set an item at the specified index.</dd>
|
||||
|
||||
<dt class="phpdocumentor-table-of-contents__entry -method -public">
|
||||
<a href="classes/OCC-Basics-Traits-TypeChecker.html#method_setAllowedTypes">setAllowedTypes()</a>
|
||||
<span>
|
||||
: void </span>
|
||||
</dt>
|
||||
<dd>Set allowed data types.</dd>
|
||||
|
||||
<dt class="phpdocumentor-table-of-contents__entry -method -public">
|
||||
<a href="classes/OCC-Basics-DataStructures-StrictCollection.html#method_toArray">toArray()</a>
|
||||
<span>
|
||||
|
@ -417,13 +422,6 @@ names.</p>
|
|||
</dt>
|
||||
<dd>Restore $this from string representation.</dd>
|
||||
|
||||
<dt class="phpdocumentor-table-of-contents__entry -method -protected">
|
||||
<a href="classes/OCC-Basics-DataStructures-StrictCollection.html#method_setAllowedTypes">setAllowedTypes()</a>
|
||||
<span>
|
||||
: void </span>
|
||||
</dt>
|
||||
<dd>Set allowed data types of collection items.</dd>
|
||||
|
||||
</dl>
|
||||
|
||||
|
||||
|
@ -432,49 +430,6 @@ names.</p>
|
|||
|
||||
|
||||
|
||||
<section class="phpdocumentor-properties">
|
||||
<h3 class="phpdocumentor-elements__header" id="properties">
|
||||
Properties
|
||||
<a href="classes/OCC-Basics-DataStructures-StrictCollection.html#properties" class="headerlink"><i class="fas fa-link"></i></a>
|
||||
|
||||
</h3>
|
||||
<article
|
||||
class="
|
||||
phpdocumentor-element
|
||||
-property
|
||||
-public
|
||||
-read-only "
|
||||
>
|
||||
<h4 class="phpdocumentor-element__name" id="property_allowedTypes">
|
||||
$allowedTypes
|
||||
<a href="classes/OCC-Basics-DataStructures-StrictCollection.html#property_allowedTypes" class="headerlink"><i class="fas fa-link"></i></a>
|
||||
|
||||
<span class="phpdocumentor-element__modifiers">
|
||||
<small class="phpdocumentor-element__modifier">read-only</small> </span>
|
||||
</h4>
|
||||
<aside class="phpdocumentor-element-found-in">
|
||||
<abbr class="phpdocumentor-element-found-in__file" title="src/DataStructures/StrictCollection.php"><a href="files/src-datastructures-strictcollection.html"><abbr title="src/DataStructures/StrictCollection.php">StrictCollection.php</abbr></a></abbr>
|
||||
:
|
||||
<span class="phpdocumentor-element-found-in__line">0</span>
|
||||
|
||||
<a href="classes/OCC-Basics-DataStructures-StrictCollection.html#source-view.0" class="phpdocumentor-element-found-in__source" data-line="0" data-modal="source-view" data-src="files/src/DataStructures/StrictCollection.php.txt"></a>
|
||||
</aside>
|
||||
|
||||
|
||||
<code class="phpdocumentor-code phpdocumentor-signature ">
|
||||
<span class="phpdocumentor-signature__visibility">public</span>
|
||||
<span class="phpdocumentor-signature__type">array<string|int, string></span>
|
||||
<span class="phpdocumentor-signature__name">$allowedTypes</span>
|
||||
</code>
|
||||
|
||||
<section class="phpdocumentor-description"><p>The allowed data types for items.</p>
|
||||
</section>
|
||||
|
||||
|
||||
|
||||
|
||||
</article>
|
||||
</section>
|
||||
|
||||
<section class="phpdocumentor-methods">
|
||||
<h3 class="phpdocumentor-elements__header" id="methods">
|
||||
|
@ -496,9 +451,9 @@ names.</p>
|
|||
<aside class="phpdocumentor-element-found-in">
|
||||
<abbr class="phpdocumentor-element-found-in__file" title="src/DataStructures/StrictCollection.php"><a href="files/src-datastructures-strictcollection.html"><abbr title="src/DataStructures/StrictCollection.php">StrictCollection.php</abbr></a></abbr>
|
||||
:
|
||||
<span class="phpdocumentor-element-found-in__line">401</span>
|
||||
<span class="phpdocumentor-element-found-in__line">325</span>
|
||||
|
||||
<a href="classes/OCC-Basics-DataStructures-StrictCollection.html#source-view.401" class="phpdocumentor-element-found-in__source" data-line="401" data-modal="source-view" data-src="files/src/DataStructures/StrictCollection.php.txt"></a>
|
||||
<a href="classes/OCC-Basics-DataStructures-StrictCollection.html#source-view.325" class="phpdocumentor-element-found-in__source" data-line="325" data-modal="source-view" data-src="files/src/DataStructures/StrictCollection.php.txt"></a>
|
||||
</aside>
|
||||
|
||||
<p class="phpdocumentor-summary">Create a type-sensitive collection of items.</p>
|
||||
|
@ -560,129 +515,6 @@ Possible values are:</p>
|
|||
</dl>
|
||||
|
||||
|
||||
</article>
|
||||
<article
|
||||
class="phpdocumentor-element
|
||||
-method
|
||||
-public
|
||||
"
|
||||
>
|
||||
<h4 class="phpdocumentor-element__name" id="method___get">
|
||||
__get()
|
||||
<a href="classes/OCC-Basics-Traits-Getter.html#method___get" class="headerlink"><i class="fas fa-link"></i></a>
|
||||
|
||||
</h4>
|
||||
<aside class="phpdocumentor-element-found-in">
|
||||
<abbr class="phpdocumentor-element-found-in__file" title="src/Traits/Getter.php"><a href="files/src-traits-getter.html"><abbr title="src/Traits/Getter.php">Getter.php</abbr></a></abbr>
|
||||
:
|
||||
<span class="phpdocumentor-element-found-in__line">60</span>
|
||||
|
||||
<a href="classes/OCC-Basics-DataStructures-StrictCollection.html#source-view.60" class="phpdocumentor-element-found-in__source" data-line="60" data-modal="source-view" data-src="files/src/Traits/Getter.php.txt"></a>
|
||||
</aside>
|
||||
|
||||
<p class="phpdocumentor-summary">Read data from an inaccessible property.</p>
|
||||
|
||||
<code class="phpdocumentor-code phpdocumentor-signature ">
|
||||
<span class="phpdocumentor-signature__visibility">public</span>
|
||||
<span class="phpdocumentor-signature__name">__get</span><span>(</span><span class="phpdocumentor-signature__argument"><span class="phpdocumentor-signature__argument__return-type">string </span><span class="phpdocumentor-signature__argument__name">$property</span></span><span>)</span><span> : </span><span class="phpdocumentor-signature__response_type">mixed</span></code>
|
||||
|
||||
<div class="phpdocumentor-label-line">
|
||||
</div>
|
||||
|
||||
<h5 class="phpdocumentor-argument-list__heading">Parameters</h5>
|
||||
<dl class="phpdocumentor-argument-list">
|
||||
<dt class="phpdocumentor-argument-list__entry">
|
||||
<span class="phpdocumentor-signature__argument__name">$property</span>
|
||||
: <span class="phpdocumentor-signature__argument__return-type">string</span>
|
||||
</dt>
|
||||
<dd class="phpdocumentor-argument-list__definition">
|
||||
<section class="phpdocumentor-description"><p>The class property to get</p>
|
||||
</section>
|
||||
|
||||
</dd>
|
||||
</dl>
|
||||
|
||||
|
||||
<h5 class="phpdocumentor-tag-list__heading" id="tags">
|
||||
Tags
|
||||
<a href="classes/OCC-Basics-Traits-Getter.html#method___get#tags" class="headerlink"><i class="fas fa-link"></i></a>
|
||||
|
||||
</h5>
|
||||
<dl class="phpdocumentor-tag-list">
|
||||
<dt class="phpdocumentor-tag-list__entry">
|
||||
<span class="phpdocumentor-tag__name">throws</span>
|
||||
</dt>
|
||||
<dd class="phpdocumentor-tag-list__definition">
|
||||
<span class="phpdocumentor-tag-link"><abbr title="\InvalidArgumentException">InvalidArgumentException</abbr></span>
|
||||
|
||||
<section class="phpdocumentor-description"><p>if the property or getter method do not exist</p>
|
||||
</section>
|
||||
|
||||
</dd>
|
||||
</dl>
|
||||
|
||||
<section>
|
||||
<h5 class="phpdocumentor-return-value__heading">Return values</h5>
|
||||
<span class="phpdocumentor-signature__response_type">mixed</span>
|
||||
—
|
||||
<section class="phpdocumentor-description"><p>The class property's current value</p>
|
||||
</section>
|
||||
|
||||
</section>
|
||||
|
||||
</article>
|
||||
<article
|
||||
class="phpdocumentor-element
|
||||
-method
|
||||
-public
|
||||
"
|
||||
>
|
||||
<h4 class="phpdocumentor-element__name" id="method___isset">
|
||||
__isset()
|
||||
<a href="classes/OCC-Basics-Traits-Getter.html#method___isset" class="headerlink"><i class="fas fa-link"></i></a>
|
||||
|
||||
</h4>
|
||||
<aside class="phpdocumentor-element-found-in">
|
||||
<abbr class="phpdocumentor-element-found-in__file" title="src/Traits/Getter.php"><a href="files/src-traits-getter.html"><abbr title="src/Traits/Getter.php">Getter.php</abbr></a></abbr>
|
||||
:
|
||||
<span class="phpdocumentor-element-found-in__line">83</span>
|
||||
|
||||
<a href="classes/OCC-Basics-DataStructures-StrictCollection.html#source-view.83" class="phpdocumentor-element-found-in__source" data-line="83" data-modal="source-view" data-src="files/src/Traits/Getter.php.txt"></a>
|
||||
</aside>
|
||||
|
||||
<p class="phpdocumentor-summary">Check if an inaccessible property is set and not empty.</p>
|
||||
|
||||
<code class="phpdocumentor-code phpdocumentor-signature ">
|
||||
<span class="phpdocumentor-signature__visibility">public</span>
|
||||
<span class="phpdocumentor-signature__name">__isset</span><span>(</span><span class="phpdocumentor-signature__argument"><span class="phpdocumentor-signature__argument__return-type">string </span><span class="phpdocumentor-signature__argument__name">$property</span></span><span>)</span><span> : </span><span class="phpdocumentor-signature__response_type">bool</span></code>
|
||||
|
||||
<div class="phpdocumentor-label-line">
|
||||
</div>
|
||||
|
||||
<h5 class="phpdocumentor-argument-list__heading">Parameters</h5>
|
||||
<dl class="phpdocumentor-argument-list">
|
||||
<dt class="phpdocumentor-argument-list__entry">
|
||||
<span class="phpdocumentor-signature__argument__name">$property</span>
|
||||
: <span class="phpdocumentor-signature__argument__return-type">string</span>
|
||||
</dt>
|
||||
<dd class="phpdocumentor-argument-list__definition">
|
||||
<section class="phpdocumentor-description"><p>The class property to check</p>
|
||||
</section>
|
||||
|
||||
</dd>
|
||||
</dl>
|
||||
|
||||
|
||||
|
||||
<section>
|
||||
<h5 class="phpdocumentor-return-value__heading">Return values</h5>
|
||||
<span class="phpdocumentor-signature__response_type">bool</span>
|
||||
—
|
||||
<section class="phpdocumentor-description"><p>Whether the class property is set and not empty</p>
|
||||
</section>
|
||||
|
||||
</section>
|
||||
|
||||
</article>
|
||||
<article
|
||||
class="phpdocumentor-element
|
||||
|
@ -698,12 +530,12 @@ Possible values are:</p>
|
|||
<aside class="phpdocumentor-element-found-in">
|
||||
<abbr class="phpdocumentor-element-found-in__file" title="src/DataStructures/StrictCollection.php"><a href="files/src-datastructures-strictcollection.html"><abbr title="src/DataStructures/StrictCollection.php">StrictCollection.php</abbr></a></abbr>
|
||||
:
|
||||
<span class="phpdocumentor-element-found-in__line">121</span>
|
||||
<span class="phpdocumentor-element-found-in__line">94</span>
|
||||
|
||||
<a href="classes/OCC-Basics-DataStructures-StrictCollection.html#source-view.121" class="phpdocumentor-element-found-in__source" data-line="121" data-modal="source-view" data-src="files/src/DataStructures/StrictCollection.php.txt"></a>
|
||||
<a href="classes/OCC-Basics-DataStructures-StrictCollection.html#source-view.94" class="phpdocumentor-element-found-in__source" data-line="94" data-modal="source-view" data-src="files/src/DataStructures/StrictCollection.php.txt"></a>
|
||||
</aside>
|
||||
|
||||
<p class="phpdocumentor-summary">Add/insert a new item at the specified index.</p>
|
||||
<p class="phpdocumentor-summary">Add/insert a item at the specified index.</p>
|
||||
|
||||
<code class="phpdocumentor-code phpdocumentor-signature ">
|
||||
<span class="phpdocumentor-signature__visibility">public</span>
|
||||
|
@ -721,7 +553,7 @@ Possible values are:</p>
|
|||
: <span class="phpdocumentor-signature__argument__return-type">string|int</span>
|
||||
</dt>
|
||||
<dd class="phpdocumentor-argument-list__definition">
|
||||
<section class="phpdocumentor-description"><p>The new item's index</p>
|
||||
<section class="phpdocumentor-description"><p>The item's index</p>
|
||||
</section>
|
||||
|
||||
</dd>
|
||||
|
@ -730,7 +562,7 @@ Possible values are:</p>
|
|||
: <span class="phpdocumentor-signature__argument__return-type"><abbr title="\OCC\Basics\DataStructures\AllowedType">AllowedType</abbr></span>
|
||||
</dt>
|
||||
<dd class="phpdocumentor-argument-list__definition">
|
||||
<section class="phpdocumentor-description"><p>The new item</p>
|
||||
<section class="phpdocumentor-description"><p>The item</p>
|
||||
</section>
|
||||
|
||||
</dd>
|
||||
|
@ -747,9 +579,9 @@ Possible values are:</p>
|
|||
<span class="phpdocumentor-tag__name">throws</span>
|
||||
</dt>
|
||||
<dd class="phpdocumentor-tag-list__definition">
|
||||
<span class="phpdocumentor-tag-link"><abbr title="\InvalidArgumentException">InvalidArgumentException</abbr></span>
|
||||
<span class="phpdocumentor-tag-link"><a href="classes/OCC-Basics-DataStructures-Exceptions-InvalidDataTypeException.html"><abbr title="\OCC\Basics\DataStructures\Exceptions\InvalidDataTypeException">InvalidDataTypeException</abbr></a></span>
|
||||
|
||||
<section class="phpdocumentor-description"><p>if <code class="prettyprint">$offset</code> is not of allowed type</p>
|
||||
<section class="phpdocumentor-description"><p>if <code class="prettyprint">$value</code> is not of allowed type</p>
|
||||
</section>
|
||||
|
||||
</dd>
|
||||
|
@ -771,9 +603,9 @@ Possible values are:</p>
|
|||
<aside class="phpdocumentor-element-found-in">
|
||||
<abbr class="phpdocumentor-element-found-in__file" title="src/DataStructures/StrictCollection.php"><a href="files/src-datastructures-strictcollection.html"><abbr title="src/DataStructures/StrictCollection.php">StrictCollection.php</abbr></a></abbr>
|
||||
:
|
||||
<span class="phpdocumentor-element-found-in__line">133</span>
|
||||
<span class="phpdocumentor-element-found-in__line">106</span>
|
||||
|
||||
<a href="classes/OCC-Basics-DataStructures-StrictCollection.html#source-view.133" class="phpdocumentor-element-found-in__source" data-line="133" data-modal="source-view" data-src="files/src/DataStructures/StrictCollection.php.txt"></a>
|
||||
<a href="classes/OCC-Basics-DataStructures-StrictCollection.html#source-view.106" class="phpdocumentor-element-found-in__source" data-line="106" data-modal="source-view" data-src="files/src/DataStructures/StrictCollection.php.txt"></a>
|
||||
</aside>
|
||||
|
||||
<p class="phpdocumentor-summary">Clear the collection of any items.</p>
|
||||
|
@ -849,16 +681,16 @@ Possible values are:</p>
|
|||
<aside class="phpdocumentor-element-found-in">
|
||||
<abbr class="phpdocumentor-element-found-in__file" title="src/DataStructures/StrictCollection.php"><a href="files/src-datastructures-strictcollection.html"><abbr title="src/DataStructures/StrictCollection.php">StrictCollection.php</abbr></a></abbr>
|
||||
:
|
||||
<span class="phpdocumentor-element-found-in__line">147</span>
|
||||
<span class="phpdocumentor-element-found-in__line">122</span>
|
||||
|
||||
<a href="classes/OCC-Basics-DataStructures-StrictCollection.html#source-view.147" class="phpdocumentor-element-found-in__source" data-line="147" data-modal="source-view" data-src="files/src/DataStructures/StrictCollection.php.txt"></a>
|
||||
<a href="classes/OCC-Basics-DataStructures-StrictCollection.html#source-view.122" class="phpdocumentor-element-found-in__source" data-line="122" data-modal="source-view" data-src="files/src/DataStructures/StrictCollection.php.txt"></a>
|
||||
</aside>
|
||||
|
||||
<p class="phpdocumentor-summary">Get the item at the specified index.</p>
|
||||
|
||||
<code class="phpdocumentor-code phpdocumentor-signature ">
|
||||
<span class="phpdocumentor-signature__visibility">public</span>
|
||||
<span class="phpdocumentor-signature__name">get</span><span>(</span><span class="phpdocumentor-signature__argument"><span class="phpdocumentor-signature__argument__return-type">string|int </span><span class="phpdocumentor-signature__argument__name">$offset</span></span><span>)</span><span> : </span><span class="phpdocumentor-signature__response_type"><abbr title="\OCC\Basics\DataStructures\AllowedType">AllowedType</abbr>|null</span></code>
|
||||
<span class="phpdocumentor-signature__name">get</span><span>(</span><span class="phpdocumentor-signature__argument"><span class="phpdocumentor-signature__argument__return-type">string|int </span><span class="phpdocumentor-signature__argument__name">$offset</span></span><span>)</span><span> : </span><span class="phpdocumentor-signature__response_type"><abbr title="\OCC\Basics\DataStructures\AllowedType">AllowedType</abbr></span></code>
|
||||
|
||||
<div class="phpdocumentor-label-line">
|
||||
<div class="phpdocumentor-label phpdocumentor-label--success"><span>API</span><span>Yes</span></div>
|
||||
|
@ -879,12 +711,29 @@ Possible values are:</p>
|
|||
</dl>
|
||||
|
||||
|
||||
<h5 class="phpdocumentor-tag-list__heading" id="tags">
|
||||
Tags
|
||||
<a href="classes/OCC-Basics-DataStructures-StrictCollection.html#method_get#tags" class="headerlink"><i class="fas fa-link"></i></a>
|
||||
|
||||
</h5>
|
||||
<dl class="phpdocumentor-tag-list">
|
||||
<dt class="phpdocumentor-tag-list__entry">
|
||||
<span class="phpdocumentor-tag__name">throws</span>
|
||||
</dt>
|
||||
<dd class="phpdocumentor-tag-list__definition">
|
||||
<span class="phpdocumentor-tag-link"><abbr title="\OutOfRangeException">OutOfRangeException</abbr></span>
|
||||
|
||||
<section class="phpdocumentor-description"><p>when <code class="prettyprint">$offset</code> is out of bounds</p>
|
||||
</section>
|
||||
|
||||
</dd>
|
||||
</dl>
|
||||
|
||||
<section>
|
||||
<h5 class="phpdocumentor-return-value__heading">Return values</h5>
|
||||
<span class="phpdocumentor-signature__response_type"><abbr title="\OCC\Basics\DataStructures\AllowedType">AllowedType</abbr>|null</span>
|
||||
<span class="phpdocumentor-signature__response_type"><abbr title="\OCC\Basics\DataStructures\AllowedType">AllowedType</abbr></span>
|
||||
—
|
||||
<section class="phpdocumentor-description"><p>The item or NULL if key is invalid</p>
|
||||
<section class="phpdocumentor-description"><p>The item</p>
|
||||
</section>
|
||||
|
||||
</section>
|
||||
|
@ -898,18 +747,18 @@ Possible values are:</p>
|
|||
>
|
||||
<h4 class="phpdocumentor-element__name" id="method_getAllowedTypes">
|
||||
getAllowedTypes()
|
||||
<a href="classes/OCC-Basics-DataStructures-StrictCollection.html#method_getAllowedTypes" class="headerlink"><i class="fas fa-link"></i></a>
|
||||
<a href="classes/OCC-Basics-Traits-TypeChecker.html#method_getAllowedTypes" class="headerlink"><i class="fas fa-link"></i></a>
|
||||
|
||||
</h4>
|
||||
<aside class="phpdocumentor-element-found-in">
|
||||
<abbr class="phpdocumentor-element-found-in__file" title="src/DataStructures/StrictCollection.php"><a href="files/src-datastructures-strictcollection.html"><abbr title="src/DataStructures/StrictCollection.php">StrictCollection.php</abbr></a></abbr>
|
||||
<abbr class="phpdocumentor-element-found-in__file" title="src/Traits/TypeChecker.php"><a href="files/src-traits-typechecker.html"><abbr title="src/Traits/TypeChecker.php">TypeChecker.php</abbr></a></abbr>
|
||||
:
|
||||
<span class="phpdocumentor-element-found-in__line">159</span>
|
||||
<span class="phpdocumentor-element-found-in__line">83</span>
|
||||
|
||||
<a href="classes/OCC-Basics-DataStructures-StrictCollection.html#source-view.159" class="phpdocumentor-element-found-in__source" data-line="159" data-modal="source-view" data-src="files/src/DataStructures/StrictCollection.php.txt"></a>
|
||||
<a href="classes/OCC-Basics-DataStructures-StrictCollection.html#source-view.83" class="phpdocumentor-element-found-in__source" data-line="83" data-modal="source-view" data-src="files/src/Traits/TypeChecker.php.txt"></a>
|
||||
</aside>
|
||||
|
||||
<p class="phpdocumentor-summary">Get allowed data types for collection items.</p>
|
||||
<p class="phpdocumentor-summary">Get allowed data types.</p>
|
||||
|
||||
<code class="phpdocumentor-code phpdocumentor-signature ">
|
||||
<span class="phpdocumentor-signature__visibility">public</span>
|
||||
|
@ -939,24 +788,24 @@ Possible values are:</p>
|
|||
-public
|
||||
"
|
||||
>
|
||||
<h4 class="phpdocumentor-element__name" id="method_isAllowedType">
|
||||
isAllowedType()
|
||||
<a href="classes/OCC-Basics-DataStructures-StrictCollection.html#method_isAllowedType" class="headerlink"><i class="fas fa-link"></i></a>
|
||||
<h4 class="phpdocumentor-element__name" id="method_hasAllowedType">
|
||||
hasAllowedType()
|
||||
<a href="classes/OCC-Basics-Traits-TypeChecker.html#method_hasAllowedType" class="headerlink"><i class="fas fa-link"></i></a>
|
||||
|
||||
</h4>
|
||||
<aside class="phpdocumentor-element-found-in">
|
||||
<abbr class="phpdocumentor-element-found-in__file" title="src/DataStructures/StrictCollection.php"><a href="files/src-datastructures-strictcollection.html"><abbr title="src/DataStructures/StrictCollection.php">StrictCollection.php</abbr></a></abbr>
|
||||
<abbr class="phpdocumentor-element-found-in__file" title="src/Traits/TypeChecker.php"><a href="files/src-traits-typechecker.html"><abbr title="src/Traits/TypeChecker.php">TypeChecker.php</abbr></a></abbr>
|
||||
:
|
||||
<span class="phpdocumentor-element-found-in__line">173</span>
|
||||
<span class="phpdocumentor-element-found-in__line">97</span>
|
||||
|
||||
<a href="classes/OCC-Basics-DataStructures-StrictCollection.html#source-view.173" class="phpdocumentor-element-found-in__source" data-line="173" data-modal="source-view" data-src="files/src/DataStructures/StrictCollection.php.txt"></a>
|
||||
<a href="classes/OCC-Basics-DataStructures-StrictCollection.html#source-view.97" class="phpdocumentor-element-found-in__source" data-line="97" data-modal="source-view" data-src="files/src/Traits/TypeChecker.php.txt"></a>
|
||||
</aside>
|
||||
|
||||
<p class="phpdocumentor-summary">Check if the item's data type is allowed in the collection.</p>
|
||||
<p class="phpdocumentor-summary">Check if a value's data type is allowed.</p>
|
||||
|
||||
<code class="phpdocumentor-code phpdocumentor-signature ">
|
||||
<span class="phpdocumentor-signature__visibility">public</span>
|
||||
<span class="phpdocumentor-signature__name">isAllowedType</span><span>(</span><span class="phpdocumentor-signature__argument"><span class="phpdocumentor-signature__argument__return-type"><abbr title="\OCC\Basics\DataStructures\AllowedType">AllowedType</abbr> </span><span class="phpdocumentor-signature__argument__name">$value</span></span><span>)</span><span> : </span><span class="phpdocumentor-signature__response_type">bool</span></code>
|
||||
<span class="phpdocumentor-signature__name">hasAllowedType</span><span>(</span><span class="phpdocumentor-signature__argument"><span class="phpdocumentor-signature__argument__return-type">mixed </span><span class="phpdocumentor-signature__argument__name">$value</span></span><span>)</span><span> : </span><span class="phpdocumentor-signature__response_type">bool</span></code>
|
||||
|
||||
<div class="phpdocumentor-label-line">
|
||||
<div class="phpdocumentor-label phpdocumentor-label--success"><span>API</span><span>Yes</span></div>
|
||||
|
@ -967,10 +816,10 @@ Possible values are:</p>
|
|||
<dl class="phpdocumentor-argument-list">
|
||||
<dt class="phpdocumentor-argument-list__entry">
|
||||
<span class="phpdocumentor-signature__argument__name">$value</span>
|
||||
: <span class="phpdocumentor-signature__argument__return-type"><abbr title="\OCC\Basics\DataStructures\AllowedType">AllowedType</abbr></span>
|
||||
: <span class="phpdocumentor-signature__argument__return-type">mixed</span>
|
||||
</dt>
|
||||
<dd class="phpdocumentor-argument-list__definition">
|
||||
<section class="phpdocumentor-description"><p>The item to check</p>
|
||||
<section class="phpdocumentor-description"><p>The value to check</p>
|
||||
</section>
|
||||
|
||||
</dd>
|
||||
|
@ -982,7 +831,62 @@ Possible values are:</p>
|
|||
<h5 class="phpdocumentor-return-value__heading">Return values</h5>
|
||||
<span class="phpdocumentor-signature__response_type">bool</span>
|
||||
—
|
||||
<section class="phpdocumentor-description"><p>Whether the item's data type is allowed</p>
|
||||
<section class="phpdocumentor-description"><p>Whether the value's data type is allowed</p>
|
||||
</section>
|
||||
|
||||
</section>
|
||||
|
||||
</article>
|
||||
<article
|
||||
class="phpdocumentor-element
|
||||
-method
|
||||
-public
|
||||
"
|
||||
>
|
||||
<h4 class="phpdocumentor-element__name" id="method_isAllowedType">
|
||||
isAllowedType()
|
||||
<a href="classes/OCC-Basics-Traits-TypeChecker.html#method_isAllowedType" class="headerlink"><i class="fas fa-link"></i></a>
|
||||
|
||||
</h4>
|
||||
<aside class="phpdocumentor-element-found-in">
|
||||
<abbr class="phpdocumentor-element-found-in__file" title="src/Traits/TypeChecker.php"><a href="files/src-traits-typechecker.html"><abbr title="src/Traits/TypeChecker.php">TypeChecker.php</abbr></a></abbr>
|
||||
:
|
||||
<span class="phpdocumentor-element-found-in__line">125</span>
|
||||
|
||||
<a href="classes/OCC-Basics-DataStructures-StrictCollection.html#source-view.125" class="phpdocumentor-element-found-in__source" data-line="125" data-modal="source-view" data-src="files/src/Traits/TypeChecker.php.txt"></a>
|
||||
</aside>
|
||||
|
||||
<p class="phpdocumentor-summary">Check if a data type is allowed.</p>
|
||||
|
||||
<code class="phpdocumentor-code phpdocumentor-signature ">
|
||||
<span class="phpdocumentor-signature__visibility">public</span>
|
||||
<span class="phpdocumentor-signature__name">isAllowedType</span><span>(</span><span class="phpdocumentor-signature__argument"><span class="phpdocumentor-signature__argument__return-type">string </span><span class="phpdocumentor-signature__argument__name">$type</span></span><span>)</span><span> : </span><span class="phpdocumentor-signature__response_type">bool</span></code>
|
||||