efureev/support

PHP支持包是一系列有用的函数和代码片段


README

PHP Package Build Status Codacy Badge Latest Stable Version Total Downloads Maintainability Test Coverage codecov

安装

对于php >= 8.1 (8.1, 8.2)

composer require efureev/support "^4.19"

对于php >= 7.4 and <=8.0

composer require efureev/support "^3.0"

对于php >= 7.2 && <=7.4

composer require efureev/support "^2.0"

内容

  • 助手函数

    • 数组
      • collapse (^4.16.0)
      • prepend (^4.16.0)
      • accessible
      • dataToArray
      • exists
      • fromPostgresArray
      • fromPostgresPoint (^4.8.0)
      • get
      • has
      • merge
      • random (^4.25.0)
      • remove
      • removeByValue
      • replaceByTemplate
      • set
      • toArray
      • toIndexedArray
      • toPostgresArray
      • toPostgresPoint (^4.8.0)
    • 字符串
      • removeAccents (^4.9.0)
      • removeMultiSpace
      • replaceByTemplate
      • replaceStrTo
      • seemsUTF8 (^4.9.0)
      • slugify (^4.9.0)
      • toCamel
      • toDelimited
      • toKebab
      • toLowerCamel
      • toScreamingDelimited
      • toScreamingSnake
      • toSnake
      • truncate (^4.9.0)
    • JSON
      • decode
      • encode
      • htmlEncode
    • 位操作
      • addFlag
      • checkFlag
      • decBinPad
      • exist
      • grant
      • removeFlag
    • B64
      • decode
      • decodeSafe
      • encode
      • encodeSafe
    • 数字
      • isInteger (^4.14.0)
      • safeInt (^4.1.0)
  • 全局函数

    • classNamespace
    • class_basename
    • class_uses_recursive
    • dataGet (^4.16.0)
    • does_trait_use (^4.4.0)
    • eachValue (^4.15.0)
    • instance
    • isTrue
    • mapValue (^4.15.0)
    • remoteCall (^4.3.1)
    • remoteStaticCall (^4.3.1)
    • remoteStaticCallOrTrow (^4.7.0)
    • trait_uses_recursive
    • value
    • when
  • 枚举 (^4.19.0)

    • casesToEscapeString
    • casesToString
    • hasName
    • hasValue
    • names
    • values
  • 异常

    • ConfigException
    • Exception
    • InvalidArgumentException
    • InvalidCallException
    • InvalidConfigException
    • InvalidParamException
    • InvalidValueException
    • JsonException
    • MethodNotAllowedException
    • MissingClassException
    • MissingConfigException
    • MissingPropertyException
    • MissingMethodException (^4.7.0)
    • NotSupportedException
    • UnknownMethodException
    • UnknownPropertyException
  • 接口

    • Arrayable
    • Command
    • Jsonable
    • Prototype
  • 结构体

    • Collections (^4.16.0)
      • ArrayCollections
  • 特质

    • ArrayStorage
    • ArrayStorageConfigurableTrait
    • ConfigurableTrait
    • ConsolePrint
    • Maker
    • Metable
    • ReadOnlyProperties
    • Singleton
    • Thrower
    • TraitBooter
    • TraitInitializer
    • Whener
  • 类型

    • GeoPoint
    • Point

测试

composer test
composer test-cover # with coverage