From 45c17168762b37305ec5a847ebffd90ed122d807 Mon Sep 17 00:00:00 2001 From: Sebastian Meyer Date: Fri, 16 Feb 2024 16:16:05 +0100 Subject: [PATCH] Explicitly declare used functions --- src/DataStructures/StrictCollection.php | 28 +++++++++++++++++++ src/DataStructures/StrictList.php | 30 +++++++++++++++++++++ src/DataStructures/StrictQueue.php | 2 ++ src/DataStructures/StrictStack.php | 2 ++ src/ErrorHandlers/ThrowErrorException.php | 2 ++ src/ErrorHandlers/TriggerExceptionError.php | 3 +++ src/Interfaces/ArrayAccessTrait.php | 2 ++ src/Interfaces/CountableTrait.php | 2 ++ src/Interfaces/IteratorTrait.php | 7 +++++ src/Traits/Getter.php | 6 +++++ src/Traits/OverloadingGetter.php | 2 ++ src/Traits/Setter.php | 5 ++++ 12 files changed, 91 insertions(+) diff --git a/src/DataStructures/StrictCollection.php b/src/DataStructures/StrictCollection.php index 96726e5..d814faa 100644 --- a/src/DataStructures/StrictCollection.php +++ b/src/DataStructures/StrictCollection.php @@ -32,6 +32,34 @@ use OCC\Basics\Interfaces\CountableTrait; use OCC\Basics\Traits\Getter; use Serializable; +use function array_is_list; +use function array_map; +use function array_sum; +use function count; +use function function_exists; +use function get_debug_type; +use function is_a; +use function is_array; +use function is_bool; +use function is_callable; +use function is_countable; +use function is_double; +use function is_float; +use function is_int; +use function is_integer; +use function is_iterable; +use function is_long; +use function is_null; +use function is_numeric; +use function is_resource; +use function is_scalar; +use function is_string; +use function is_object; +use function ltrim; +use function serialize; +use function sprintf; +use function unserialize; + /** * A type-sensitive, unsorted collection. * diff --git a/src/DataStructures/StrictList.php b/src/DataStructures/StrictList.php index 5c3bd4c..db1ec77 100644 --- a/src/DataStructures/StrictList.php +++ b/src/DataStructures/StrictList.php @@ -34,6 +34,36 @@ use SplDoublyLinkedList; use OCC\Basics\Traits\Getter; use Serializable; +use function array_map; +use function array_sum; +use function count; +use function function_exists; +use function get_debug_type; +use function in_array; +use function is_a; +use function is_array; +use function is_bool; +use function is_callable; +use function is_countable; +use function is_double; +use function is_float; +use function is_int; +use function is_integer; +use function is_iterable; +use function is_long; +use function is_null; +use function is_numeric; +use function is_resource; +use function is_scalar; +use function is_string; +use function is_object; +use function iterator_to_array; +use function ltrim; +use function range; +use function serialize; +use function sprintf; +use function unserialize; + /** * A type-sensitive, taversable list. * diff --git a/src/DataStructures/StrictQueue.php b/src/DataStructures/StrictQueue.php index 90bbe00..f132fd7 100644 --- a/src/DataStructures/StrictQueue.php +++ b/src/DataStructures/StrictQueue.php @@ -31,6 +31,8 @@ use RangeException; use RuntimeException; use Serializable; +use function sprintf; + /** * A type-sensitive, taversable queue (FIFO). * diff --git a/src/DataStructures/StrictStack.php b/src/DataStructures/StrictStack.php index 00c355c..357897e 100644 --- a/src/DataStructures/StrictStack.php +++ b/src/DataStructures/StrictStack.php @@ -31,6 +31,8 @@ use RangeException; use RuntimeException; use Serializable; +use function sprintf; + /** * A type-sensitive, taversable stack (LIFO). * diff --git a/src/ErrorHandlers/ThrowErrorException.php b/src/ErrorHandlers/ThrowErrorException.php index f580b6b..f0ccd93 100644 --- a/src/ErrorHandlers/ThrowErrorException.php +++ b/src/ErrorHandlers/ThrowErrorException.php @@ -25,6 +25,8 @@ namespace OCC\Basics\ErrorHandlers; use ErrorException; +use function error_reporting; + /** * Throws internal errors as exceptions. * diff --git a/src/ErrorHandlers/TriggerExceptionError.php b/src/ErrorHandlers/TriggerExceptionError.php index 98d0f02..feddf1c 100644 --- a/src/ErrorHandlers/TriggerExceptionError.php +++ b/src/ErrorHandlers/TriggerExceptionError.php @@ -25,6 +25,9 @@ namespace OCC\Basics\ErrorHandlers; use Throwable; +use function sprintf; +use function trigger_error; + /** * Triggers errors for uncaught exceptions. * diff --git a/src/Interfaces/ArrayAccessTrait.php b/src/Interfaces/ArrayAccessTrait.php index 2cc109d..974da74 100644 --- a/src/Interfaces/ArrayAccessTrait.php +++ b/src/Interfaces/ArrayAccessTrait.php @@ -25,6 +25,8 @@ namespace OCC\Basics\Interfaces; use ArrayAccess; +use function is_null; + /** * A generic implementation of the ArrayAccess interface. * diff --git a/src/Interfaces/CountableTrait.php b/src/Interfaces/CountableTrait.php index 039a725..7e40b10 100644 --- a/src/Interfaces/CountableTrait.php +++ b/src/Interfaces/CountableTrait.php @@ -25,6 +25,8 @@ namespace OCC\Basics\Interfaces; use Countable; +use function count; + /** * A generic implementation of the Countable interface. * diff --git a/src/Interfaces/IteratorTrait.php b/src/Interfaces/IteratorTrait.php index f29c5ae..f222078 100644 --- a/src/Interfaces/IteratorTrait.php +++ b/src/Interfaces/IteratorTrait.php @@ -25,6 +25,13 @@ namespace OCC\Basics\Interfaces; use Iterator; +use function current; +use function is_null; +use function key; +use function next; +use function prev; +use function reset; + /** * A generic implementation of the Iterator interface. * diff --git a/src/Traits/Getter.php b/src/Traits/Getter.php index 68a5d21..5fb7559 100644 --- a/src/Traits/Getter.php +++ b/src/Traits/Getter.php @@ -25,6 +25,12 @@ namespace OCC\Basics\Traits; use InvalidArgumentException; +use function boolval; +use function method_exists; +use function property_exists; +use function sprintf; +use function ucfirst; + /** * Reads data from inaccessible properties by using magic methods. * diff --git a/src/Traits/OverloadingGetter.php b/src/Traits/OverloadingGetter.php index a1a858e..633df97 100644 --- a/src/Traits/OverloadingGetter.php +++ b/src/Traits/OverloadingGetter.php @@ -23,6 +23,8 @@ declare(strict_types=1); namespace OCC\Basics\Traits; +use function boolval; + /** * Overloads a class with readable magic properties. * diff --git a/src/Traits/Setter.php b/src/Traits/Setter.php index 77c8a99..6580164 100644 --- a/src/Traits/Setter.php +++ b/src/Traits/Setter.php @@ -25,6 +25,11 @@ namespace OCC\Basics\Traits; use InvalidArgumentException; +use function method_exists; +use function property_exists; +use function sprintf; +use function ucfirst; + /** * Writes data to inaccessible properties by using magic methods. *