Files
douba_shop/vendor/ergebnis/classy
Karlcarlo 0060b2798f chore: 添加缺失的静态资源文件
添加多个前端界面所需的图片、字体、音频等静态资源文件,包括:
- 管理员后台的图标、背景图、组件图片
- 移动端页面的商品图片、用户中心图片、活动图标
- 第三方库的示例图片和字体文件
- 浏览器兼容性配置文件
- 图标字体文件(eot、ttf、woff、woff2格式)

这些资源是前端界面正常显示所必需的,之前可能因版本控制忽略或遗漏而缺失。
2026-03-06 20:15:52 +08:00
..

classy

Integrate Prune Release Renew

Code Coverage Type Coverage

Latest Stable Version Total Downloads

Provides a finder for classy constructs (classes, enums, interfaces, and traits).

Installation

Run

$ composer require ergebnis/classy

Usage

Collect classy constructs from source code

Use Constructs::fromSource() to collect classy constructs in source code:

<?php

use Ergebnis\Classy\Construct;
use Ergebnis\Classy\Constructs;

$source = <<<'PHP'
<?php

namespace Example;

class Foo {}

enum Bar {}

interface Baz {}

trait Qux {}
PHP;

$constructs = Constructs::fromSource($source);

$names = array_map(static function (Construct $construct): string {
    return $construct->name();
}, $constructs);

var_dump($names); // ['Example\Bar', 'Example\Baz', 'Example\Foo', 'Example\Qux']

Collect classy constructs from a directory

Use Constructs::fromDirectory() to collect classy constructs in a directory:

<?php

use Ergebnis\Classy\Construct;
use Ergebnis\Classy\Constructs;

$constructs = Constructs::fromDirectory(__DIR__ . '/example');

$names = array_map(static function (Construct $construct): string {
    return $construct->name();
}, $constructs);

var_dump($names); // ['Example\Bar', 'Example\Bar\Baz', 'Example\Foo\Bar\Baz']

Changelog

Please have a look at CHANGELOG.md.

Contributing

Please have a look at CONTRIBUTING.md.

Code of Conduct

Please have a look at CODE_OF_CONDUCT.md.

License

This package is licensed using the MIT License.

Please have a look at LICENSE.md.

Credits

The algorithm for finding classes in PHP files in Constructs has been adopted from Zend\File\ClassFileLocator (originally licensed under BSD-3-Clause).

Curious what I am building?

📬 Subscribe to my list, and I will occasionally send you an email to let you know what I am working on.