Skip to content

Commit

Permalink
Explicitly declare used functions
Browse files Browse the repository at this point in the history
  • Loading branch information
sebastian-meyer committed Feb 16, 2024
1 parent 6270834 commit 45c1716
Show file tree
Hide file tree
Showing 12 changed files with 91 additions and 0 deletions.
28 changes: 28 additions & 0 deletions src/DataStructures/StrictCollection.php
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,34 @@
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.
*
Expand Down
30 changes: 30 additions & 0 deletions src/DataStructures/StrictList.php
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,36 @@
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.
*
Expand Down
2 changes: 2 additions & 0 deletions src/DataStructures/StrictQueue.php
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,8 @@
use RuntimeException;
use Serializable;

use function sprintf;

/**
* A type-sensitive, taversable queue (FIFO).
*
Expand Down
2 changes: 2 additions & 0 deletions src/DataStructures/StrictStack.php
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,8 @@
use RuntimeException;
use Serializable;

use function sprintf;

/**
* A type-sensitive, taversable stack (LIFO).
*
Expand Down
2 changes: 2 additions & 0 deletions src/ErrorHandlers/ThrowErrorException.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,8 @@

use ErrorException;

use function error_reporting;

/**
* Throws internal errors as exceptions.
*
Expand Down
3 changes: 3 additions & 0 deletions src/ErrorHandlers/TriggerExceptionError.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,9 @@

use Throwable;

use function sprintf;
use function trigger_error;

/**
* Triggers errors for uncaught exceptions.
*
Expand Down
2 changes: 2 additions & 0 deletions src/Interfaces/ArrayAccessTrait.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,8 @@

use ArrayAccess;

use function is_null;

/**
* A generic implementation of the ArrayAccess interface.
*
Expand Down
2 changes: 2 additions & 0 deletions src/Interfaces/CountableTrait.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,8 @@

use Countable;

use function count;

/**
* A generic implementation of the Countable interface.
*
Expand Down
7 changes: 7 additions & 0 deletions src/Interfaces/IteratorTrait.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,13 @@

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.
*
Expand Down
6 changes: 6 additions & 0 deletions src/Traits/Getter.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,12 @@

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.
*
Expand Down
2 changes: 2 additions & 0 deletions src/Traits/OverloadingGetter.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@

namespace OCC\Basics\Traits;

use function boolval;

/**
* Overloads a class with readable magic properties.
*
Expand Down
5 changes: 5 additions & 0 deletions src/Traits/Setter.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,11 @@

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.
*
Expand Down

0 comments on commit 45c1716

Please sign in to comment.