承接 barlito/utils 相关项目开发

从需求分析到上线部署,全程专人跟进,保证项目质量与交付效率

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

barlito/utils

Composer 安装命令:

composer require barlito/utils

包简介

My personal library of utilities

README 文档

README

CI

Personal library of Symfony utilities: Doctrine ID traits and reusable Behat contexts.

Requirements

  • PHP >= 8.4
  • Symfony 7 or 8
  • Doctrine ORM 3

Installation

composer require barlito/utils

Usage

Doctrine ID traits

Add a UUID or ULID primary key to an entity (generated by the Symfony bridge generators):

use Barlito\Utils\Traits\IdUuidTrait; // or IdUlidTrait
use Doctrine\ORM\Mapping as ORM;

#[ORM\Entity]
class MyEntity
{
    use IdUuidTrait;
}

Behat contexts

Register the contexts in your behat.yml suite and wire them as services:

  • Barlito\Utils\Behat\Component\EntityManagerContext — assert on database state:
Given a "User" entity found by "email=foo@bar.com" should match:
    | name | Foo |
Given a "User" entity found by "deletedAt:date=2024-01-01" should not exist
Given I should find 3 "User" entity found by "status=active"
Then I create a "User" entity with data:
    """
    {"email": "foo@bar.com"}
    """
  • Barlito\Utils\Behat\Component\LoggerContext + Barlito\Utils\Behat\Mock\LoggerMock — decorate the logger in test env with LoggerMock, then:
Then the logger logged the error with message "Something went wrong"
Then the logger logged an error containing "went wrong"

Reusable QA configs

The config/ directory ships ready-to-use QA configs for consuming projects (install the tools in your own require-dev):

PHPStanphpstan.dist.neon:

includes:
    - vendor/barlito/utils/config/phpstan.neon

parameters:
    paths:
        - src

Rectorrector.php:

$builder = require 'vendor/barlito/utils/config/rector.php';

return $builder
    ->withPaths([__DIR__ . '/src'])
    ->withCache(__DIR__ . '/var/cache/rector');

PHP-CS-Fixer — run with the shipped config (paths resolve from your project root):

vendor/bin/php-cs-fixer fix --config=vendor/barlito/utils/config/.php-cs-fixer.dist.php

PHPCS (PSR-12):

vendor/bin/phpcs --standard=vendor/barlito/utils/config/phpcs.xml.dist src

PHPMD:

vendor/bin/phpmd src text vendor/barlito/utils/config/phpmd.xml

Development

make deploy        # start the dev container
make phpstan       # static analysis (level 8)
make cs            # coding standards check (php-cs-fixer, @Symfony)
make cs-fix        # apply coding standards
make rector        # rector dry-run
make rector-fix    # apply rector rules
make phpcs         # PSR-12 check (phpcs)
make phpmd         # mess detection (phpmd, isolated via vendor-bin)
make qa            # run the whole QA suite

The same commands are available as composer scripts (composer phpstan, composer cs, composer rector, ...).

barlito/utils 适用场景与选型建议

barlito/utils 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 467 次下载、GitHub Stars 达 0, 最近一次更新时间为 2022 年 05 月 10 日, 在 PHP 生态内属于活跃度较高的组件。

我们在过去多个企业项目中使用过 barlito/utils 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。

围绕 barlito/utils 我们能提供哪些服务?
定制开发 / 二次开发

基于 barlito/utils 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。

BUG 修复 & 性能优化

线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。

项目外包 & 长期维护

承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。

yvsm@zunyunkeji.com QQ:316430983 微信:yvsm316 西安尊云信息科技 · 专注 PHP / Go / 分布式系统研发

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: mit
  • 更新时间: 2022-05-10