Skip to content

Commit

Permalink
Update phpDoc
Browse files Browse the repository at this point in the history
  • Loading branch information
sebastian-meyer committed Jan 26, 2024

Verified

This commit was signed with the committer’s verified signature. The key has expired.
zrezke Filip Jeretina
1 parent 1522299 commit 11a7179
Showing 12 changed files with 81 additions and 175 deletions.
2 changes: 1 addition & 1 deletion .phpdoc/template/base.html.twig
Original file line number Diff line number Diff line change
@@ -3,9 +3,9 @@
{%
set topMenu = {
"menu": [
{ "name": "Packagist", "url": "https://packagist.org/packages/opencultureconsulting/basics"}
],
"social": [
{ "iconClass": "fab fa-php", "url": "https://packagist.org/packages/opencultureconsulting/basics"},
{ "iconClass": "fab fa-github", "url": "https://github.com/opencultureconsulting/php-basics"},
{ "iconClass": "fab fa-mastodon", "url": "https://openbiblio.social/@occ"},
{ "iconClass": "fas fa-envelope-open-text", "url": "mailto:office@opencultureconsulting.com"}
31 changes: 31 additions & 0 deletions .phpdoc/template/components/sidebar.html.twig
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
<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">
{% for version in project.versions %}
{% for toc in version.tableOfContents %}
<section class="phpdocumentor-sidebar__category">
<h2 class="phpdocumentor-sidebar__category-header">{{ toc.name|capitalize }}</h2>
{% for root in toc.roots %}
{{ toc(root, 'components/menu.html.twig', 1) }}
{% endfor %}
</section>
{% endfor %}
{% endfor %}

<section class="phpdocumentor-sidebar__category">
<h2 class="phpdocumentor-sidebar__category-header">Reports</h2>
{% if project.settings.custom['graphs.enabled'] %}
<h3 class="phpdocumentor-sidebar__root-package"><a href="graphs/classes.html">Class Diagram</a></h3>
{% endif %}
<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">
<h2 class="phpdocumentor-sidebar__category-header">Indices</h2>
<h3 class="phpdocumentor-sidebar__root-package"><a href="indices/files.html">Files</a></h3>
</section>
</aside>
4 changes: 2 additions & 2 deletions phpdoc.dist.xml
Original file line number Diff line number Diff line change
@@ -26,14 +26,14 @@
<ignore-tag>psalm-suppress</ignore-tag>
</ignore-tags>
</api>
<guide>
<guide format="rst">
<source dsn=".">
<path>/.phpdoc/guide</path>
</source>
<output>guides</output>
</guide>
</version>
<setting name="graphs.enabled" value="true"/>
<setting name="graphs.enabled" value="false"/>
<setting name="guides.enabled" value="true"/>
<setting name="template.color" value="orange"/>
</phpdocumentor>
3 changes: 2 additions & 1 deletion psalm.xml
Original file line number Diff line number Diff line change
@@ -6,7 +6,8 @@
errorLevel="1"
resolveFromConfigFile="true"
findUnusedBaselineEntry="true"
findUnusedCode="false"
findUnusedCode="true"
findUnusedVariablesAndParams="true"
>
<issueHandlers>
<RedundantCastGivenDocblockType errorLevel="suppress"/>
167 changes: 7 additions & 160 deletions src/DataStructures/StrictList.php
Original file line number Diff line number Diff line change
@@ -27,7 +27,6 @@
use Countable;
use InvalidArgumentException;
use Iterator;
use OutOfRangeException;
use RuntimeException;
use SplDoublyLinkedList;
use OCC\Basics\Traits\Getter;
@@ -56,27 +55,7 @@ class StrictList extends SplDoublyLinkedList implements ArrayAccess, Countable,
use Getter;

/**
* Queue style iterator mode (First In, First Out).
*/
public const IT_MODE_FIFO = 0;

/**
* Stack style iterator mode (Last In, First Out).
*/
public const IT_MODE_LIFO = 2;

/**
* Destructive iterator mode (delete values after iteration).
*/
public const IT_MODE_DELETE = 1;

/**
* Preserving iterator mode (keep values after iteration).
*/
public const IT_MODE_KEEP = 0;

/**
* The allowed data types for values.
* The allowed data types for list values.
*
* @var string[]
*
@@ -153,27 +132,15 @@ public function bottom(): mixed
}

/**
* Count the number of values on the list.
*
* @return int The current number of values
* Get allowed data types for list values.
*
* @api
*/
public function count(): int
{
return parent::count();
}

/**
* Get current list value.
*
* @return AllowedType The current value
* @return string[] The list of allowed data types
*
* @api
*/
public function current(): mixed
public function getAllowedTypes(): array
{
return parent::current();
return $this->allowedTypes;
}

/**
@@ -216,30 +183,6 @@ public function isAllowedType(mixed $value): bool
return false;
}

/**
* Check if the list is empty.
*
* @return bool Whether the list is empty
*
* @api
*/
public function isEmpty(): bool
{
return parent::isEmpty();
}

/**
* Get the current value's offset.
*
* @return int The current offset
*
* @api
*/
public function key(): int
{
return parent::key();
}

/**
* Magic getter method for $this->allowedTypes.
*
@@ -249,49 +192,7 @@ public function key(): int
*/
protected function magicGetAllowedTypes(): array
{
return $this->allowedTypes;
}

/**
* Move cursor to the next value on the list.
*
* @return void
*
* @api
*/
public function next(): void
{
parent::next();
}

/**
* Check if the specified offset exists.
*
* @param int $offset The offset being checked
*
* @return bool Whether the offset exists
*
* @api
*/
public function offsetExists(mixed $offset): bool
{
return parent::offsetExists($offset);
}

/**
* Get the value at the specified offset.
*
* @param int $offset The offset to get
*
* @return ?AllowedType The value at the offset or NULL
*
* @throws OutOfRangeException
*
* @api
*/
public function offsetGet(mixed $offset): mixed
{
return parent::offsetGet($offset);
return $this->getAllowedTypes();
}

/**
@@ -304,7 +205,7 @@ public function offsetGet(mixed $offset): mixed
*
* @throws InvalidArgumentException
*
* @api
* @internal
*/
public function offsetSet(mixed $offset, mixed $value): void
{
@@ -320,22 +221,6 @@ public function offsetSet(mixed $offset, mixed $value): void
parent::offsetSet($offset, $value);
}

/**
* Unset the specified offset.
*
* @param int $offset The offset to unset
*
* @return void
*
* @throws OutOfRangeException
*
* @api
*/
public function offsetUnset(mixed $offset): void
{
parent::offsetUnset($offset);
}

/**
* Pops an value from the end of the list.
*
@@ -379,18 +264,6 @@ public function prepend(mixed ...$values): void
}
}

/**
* Move cursor to the previous value on the list.
*
* @return void
*
* @api
*/
public function prev(): void
{
parent::prev();
}

/**
* Push an value at the end of the list.
*
@@ -415,18 +288,6 @@ public function push(mixed $value): void
parent::push($value);
}

/**
* Move cursor back to the start of the list.
*
* @return void
*
* @api
*/
public function rewind(): void
{
parent::rewind();
}

/**
* Get string representation of $this.
*
@@ -447,8 +308,6 @@ public function serialize(): string
* @return void
*
* @throws InvalidArgumentException
*
* @internal
*/
protected function setAllowedTypes(array $allowedTypes = []): void
{
@@ -554,18 +413,6 @@ public function unshift(mixed $value): void
parent::unshift($value);
}

/**
* Check if the list contains any more values.
*
* @return bool Whether the list contains more values
*
* @api
*/
public function valid(): bool
{
return parent::valid();
}

/**
* Create a type-sensitive, traversable list of values.
*
6 changes: 6 additions & 0 deletions src/DataStructures/StrictQueue.php
Original file line number Diff line number Diff line change
@@ -51,6 +51,8 @@ class StrictQueue extends StrictList implements ArrayAccess, Countable, Iterator
* Dequeue an item from the queue.
*
* @return AllowedType The dequeued item
*
* @api
*/
public function dequeue(): mixed
{
@@ -65,6 +67,8 @@ public function dequeue(): mixed
* @return void
*
* @throws \InvalidArgumentException
*
* @api
*/
public function enqueue(mixed $item): void
{
@@ -90,6 +94,8 @@ public function enqueue(mixed $item): void
* @return int The set of flags and modes of iteration
*
* @throws RuntimeException
*
* @api
*/
final public function setIteratorMode(int $mode): int
{
6 changes: 6 additions & 0 deletions src/DataStructures/StrictStack.php
Original file line number Diff line number Diff line change
@@ -55,6 +55,8 @@ class StrictStack extends StrictList implements ArrayAccess, Countable, Iterator
* @return void
*
* @throws \InvalidArgumentException
*
* @api
*/
public function stack(mixed $item): void
{
@@ -65,6 +67,8 @@ public function stack(mixed $item): void
* Unstack an item from the stack.
*
* @return AllowedType The unstacked item
*
* @api
*/
public function unstack(): mixed
{
@@ -90,6 +94,8 @@ public function unstack(): mixed
* @return int The set of flags and modes of iteration
*
* @throws RuntimeException
*
* @api
*/
final public function setIteratorMode(int $mode): int
{
3 changes: 2 additions & 1 deletion src/InterfaceTraits/ArrayAccessTrait.php
Original file line number Diff line number Diff line change
@@ -33,6 +33,7 @@
*
* @template TKey of int|string
* @template TValue of mixed
* @template TData of array<TKey, TValue>
* @implements ArrayAccess<TKey, TValue>
* @phpstan-require-implements ArrayAccess
*/
@@ -41,7 +42,7 @@ trait ArrayAccessTrait
/**
* Holds the array-accessible data.
*
* @var array<TKey, TValue>
* @var TData
*/
protected array $data = [];

Loading

0 comments on commit 11a7179

Please sign in to comment.