定制 mathiasverraes/classfunctions 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

mathiasverraes/classfunctions

最新稳定版本:1.1.0

Composer 安装命令:

composer require mathiasverraes/classfunctions

包简介

Functions to manipulate class names

README 文档

README

PHP Utilities to get different variations of class names

use Verraes\ClassFunctions;

// Fully qualified class name of an object, without a leading backslash
ClassFunctions\fqcn($object);

// Canonical class name of an object, of the form "My.Namespace.MyClass"
ClassFunctions\canonical($object);

// Underscored and lowercased class name of an object, of the form "my.namespace.my_class"
ClassFunctions\underscore($object);

// The class name of an object, without the namespace
ClassFunctions\short($object);

The above methods also accept strings, and ClassFunctions\fqcn() accepts a canonical class name as returned from ClassFunctions\canonical().

Free bonus feature:

// Returns an associative array of 'CONSTANT_NAME' => 'value'
ClassFunctions\constants('Verraes\ClassFunctions\Tests\MyClass')

Installation

You can install ClassFunctions with Composer:

composer require mathiasverraes/classfunctions

Run composer install or composer update and you're ready to start.

统计信息

  • 总下载量: 452.26k
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 34
  • 点击次数: 2
  • 依赖项目数: 12
  • 推荐数: 0

GitHub 信息

  • Stars: 34
  • Watchers: 2
  • Forks: 2
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2014-02-06