定制 haspadar/php-skeleton 二次开发

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

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

haspadar/php-skeleton

Composer 安装命令:

composer require haspadar/php-skeleton

包简介

Reusable template for PHP libraries: Composer, CI, static analysis — all synced via one script

README 文档

README

PHP Version Code Style Psalm

ℹ️ About

Skeleton is a template for EO-style PHP libraries.
It provides a ready-to-use boilerplate with the same checks and structure
that will be reused across many future EO projects.

It comes with:

  • consistent README header and footer sections;
  • predefined CI pipeline (phpstan, psalm, rector, php-cs-fixer, infection, phpunit);
  • examples of decomposition into small, final, immutable classes;
  • sample I/O wrappers, tasks, and fakes for tests.

Usage

The entrypoint is bin/skeleton.php.

It works in two modes:

  1. Copy-as-is – copies template files into your target directory.
  2. Section replacement – replaces README sections with your project-specific values.

Arguments:

  • --vendor=VendorName
  • --repo=repo-name
  • --namespace=MyNamespace

Defaults are guessed from your current Git repo.

php bin/skeleton.php --vendor=haspadar --repo=php-skeleton --namespace=PhpSkeleton

Skeleton CLI Demo

This will generate a README and boilerplate code with the provided values.

🧠 Philosophy

  • ❌ No null, static, or shared state in the public API
  • ✅ One object = one responsibility
  • ✅ Final classes, immutability by default
  • ✅ Composition over inheritance
  • ✅ Behavior and data live together

Inspired by Elegant Objects and cactoos.

🧪 Quality & CI

Every push and pull request is checked via GitHub Actions:

  • ✅ Static analysis with PHPStan (level 9) and Psalm (level 8)
  • ✅ Type coverage report via Shepherd
  • ✅ Code style check with PHP-CS-Fixer (only changed files)
  • ✅ Unit tests with PHPUnit
  • ✅ Code coverage via Codecov
  • ✅ Mutation testing with Infection
  • ✅ Composer validation, platform checks, security audit
  • ✅ Automatic refactoring via Rector

📥 Installation

composer require haspadar/php-skeleton

Requires PHP 8.4

📄 License

MIT

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2025-08-16