定制 steffospieler/codestats 二次开发

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

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

steffospieler/codestats

最新稳定版本:v1.0.0

Composer 安装命令:

composer require steffospieler/codestats

包简介

A simple api wrapper for Code::Stats with some helper functions.

README 文档

README

Packagist Version Packagist License

A simple API wrapper for the Code::Stats API with helpful utility functions.

Setup

To use the CodeStats wrapper, you'll need to create a client with a descriptive user agent:

use SteffoSpieler\CodeStats\Client;

$client = new Client("Example for PHP Code::Stats API Wrapper");

Examples

Get user information:

use SteffoSpieler\CodeStats\Client;

$client = new Client("Example for PHP Code::Stats API Wrapper");
$user = $client->getUser("username");

Add pulse:

use SteffoSpieler\CodeStats\Client;
use SteffoSpieler\CodeStats\Classes\PulseLanguage;

$client = new Client("Example for PHP Code::Stats API Wrapper");
$user = $client->addPulse(
    "SFMyNTY.OEotWWdnPT0jI01qaz0.X0wVEZquh8Ogau1iTtBihYqqL71FD8N6p5ChQiIpaxQ",
    [
        new PulseLanguage("PHP", 45),
        new PulseLanguage("Markdown", 30),
    ],
    new DateTime()
);

Get level (and more) out of XP:

use SteffoSpieler\CodeStats\XPCalculator;

XPCalculator::getLevel(123456); // 8
XPCalculator::getLevelProgress(123456); // 77
XPCalculator::getNextLevelXp(8); // 129600

Contributing

Contributions are always welcome! Please feel free to submit a Pull Request.

License

This project is licensed under the MIT License - see the LICENSE file for details.

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2025-07-14