定制 webchemistry/service-attribute 二次开发

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

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

webchemistry/service-attribute

最新稳定版本:v2.2.1

Composer 安装命令:

composer require webchemistry/service-attribute

包简介

README 文档

README

<?php declare(strict_types = 1);

use Nette\Utils\Finder;
use WebChemistry\ServiceAttribute\DecoratorFinder;
use WebChemistry\ServiceAttribute\Generator\DecoratorNeonGenerator;
use WebChemistry\ServiceAttribute\Generator\NeonFile;
use WebChemistry\ServiceAttribute\Generator\ServiceNeonGenerator;
use WebChemistry\ServiceAttribute\ServiceFinder;
use WebChemistry\ServiceAttribute\Validator\DecoratorValidator;

require __DIR__ . '/vendor/autoload.php';

$directory = Finder::find('*.php')
	->from(__DIR__ . '/app');

// decorators
echo "\e[36mDecorators\e[39m\n";

$decorators = DecoratorFinder::findDecorators($directory);

DecoratorValidator::validate($decorators);

$neon = new NeonFile($path = __DIR__ . '/app/generated/decorators.neon', (new DecoratorNeonGenerator($decorators))->generate());
$neon->diff();
$neon->save();

echo sprintf("File generated from %d decorators: file://%s\n", count($decorators), $path);

// services
echo "\e[36mServices\e[39m\n";
$services = ServiceFinder::findServices($directory);

$neon = new NeonFile($path = __DIR__ . '/app/generated/services.neon', (new ServiceNeonGenerator($services))->generate());
$neon->diff();
$neon->save();

echo sprintf("File generated from %d services: file://%s\n", count($services), $path);

run:

php services.php

统计信息

  • 总下载量: 3.15k
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 0
  • 点击次数: 0
  • 依赖项目数: 1
  • 推荐数: 0

GitHub 信息

  • Stars: 0
  • Watchers: 1
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: Unknown
  • 更新时间: 2020-12-22