empaphy/usephul
最新稳定版本:v1.9.0
Composer 安装命令:
composer require empaphy/usephul
包简介
Provides useful classes and functions that extend the standard functionality of PHP.
README 文档
README
Usephul is a PHP library that provides useful classes and functions that extend the standard functionality of PHP.
Table of Contents
Overview
Array Functions
- array_exclude() — exclude values from an array.
- array_extract() — Extract values from an array.
- array_get() — Retrieve an element from an array that can be located several levels deep.
- array_interchange() — Interchange the values of two elements of an array.
- array_key_types() — Inspects the types of keys used in an array.
- array_omit() — Omit keys from an array.
- array_pick() — Pick keys from an array.
- array_remap() — Applies a (generator) callback to the elements of a given array, allowing the remapping of its keys in the process.
- array_split() — Split an array by a value.
- array_zip() — Perform a zip operation on multiple arrays.
Attribute Functions
- applies() — Finds whether an attribute has been applied to a given object, class, interface, or trait.
Enumerations
- EnumDynamicity — Adds dynamicity of case names to PHP Enumerations.
Error Handling Functions
- debug_backtrace_depth() — Returns the current stack trace depth.
Generators
Math
- greatest() — Finds the value that is greater than all the other values.
- least() — Finds the value that is less than all the other values.
- rank() — Returns the ordinal rank for a given value.
Paths
Classes:
- PathInfo — Provides information about a file path.
Functions:
- Path\basename() — Returns the trailing name component of a path.
- Path\components() — Returns an array of path components for the given path.
- Path\directory_separator() — Returns the directory separator used in the given path.
- Path\dirname() — Returns a parent directory's path.
- Path\extension() — Returns the extension component of a path.
- Path\extension_replace() — Replaces the extension component of a path with something else.
- Path\filename() — Returns the name component of a path without the extension.
- Path\suffix() — Returns a suffix for a path based on a given set of separators.
- Path\suffix_replace() — Replaces a suffix in a path with a new value.
PCRE Functions
- preg_escape() — Escapes all instances of the given PCRE delimiter character in a raw regular expression pattern.
SPL Functions
- class_parents_uses() — Return the traits used by the parent classes of the given class.
- class_parents_traits_uses() — Return the traits used by the parent classes of the given class, recursively.
- class_traits_uses() — Return the traits used by the given class or trait, recursively.
Trait Functions
- uses() — Checks whether an object or class uses a given trait.
Types
Enums:
- Fallback — A unit enum representing an fallback value.
Constants:
- fallback
— An alias to
Fallback::default, representing a default fallback value.
Variable handling Functions
- is_closed_resource() — Finds whether the given variable is a resource that has been closed.
- is_non_empty_string() — Find whether a variable is a non-empty string.
- is_negative_int() — Find whether a variable is an integer and less than zero.
- is_non_negative_int() — Find whether a variable is an integer and not less than zero.
- is_non_positive_int() — Find whether a variable is an integer and not greater than zero.
- is_non_zero_int() — Find whether a variable is an integer and not zero.
- is_number() — Find whether a variable is a number (either an integer or a float).
- is_positive_int() — Find whether a variable is an integer and greater than zero.
- is_zero() — Finds whether the given number is (sufficiently close to) 0.
统计信息
- 总下载量: 20.88k
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 1
- 点击次数: 1
- 依赖项目数: 2
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2025-02-12