cyrulik/simple-calculator 问题修复 & 功能扩展

解决BUG、新增功能、兼容多环境部署,快速响应你的开发需求

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

cyrulik/simple-calculator

最新稳定版本:1.0.0

Composer 安装命令:

composer require cyrulik/simple-calculator

包简介

A simple calculator implementation with basic functionality.

README 文档

README

This is a simple calculator that can perform basic arithmetic operations.

It is written as a reusable package in PHP 8.3 and uses PHPUnit 10 for testing.

Installation

You can install the package via composer:

composer require cyrulik/simple-calculator

Usage

use Cyrulik\SimpleCalculator\Calculator;
use Cyrulik\SimpleCalculator\OperationFactory;

$calculator = new Calculator(new OperationFactory());
$calculator->calculate('addition', 1, 2);

Working with this project

Simple Calculator uses Makefile to run every aspect required for development of this project.

Specific commands and their equivalent composer scripts are listed below. All of them have their equivalent make commands, e.g. composer test can be run with make test.

Installation

To start working with this project, and when changing any of its files later, you can run all major checks with:

make all

Testing

This project uses PHPUnit for testing. You can run tests with:

composer test

Or directly with PHPUnit:

./vendor/bin/phpunit

Coverage

To generate coverage report, you need to have Xdebug installed. You can generate coverage report with:

XDEBUG_MODE=coverage composer test-coverage

Coding Standards

Simple Calculator uses PHP CS Fixer to enforce coding standards. You can fix coding standards with:

composer fix

Or directly with PHP CS Fixer:

./vendor/bin/php-cs-fixer fix

Static Analysis

PHPStan is used for static analysis. You can run static analysis with:

composer analyse

Or directly with PHPStan:

./vendor/bin/phpstan analyse

Infection

Infection is used for mutation testing. You can run mutation testing with:

composer infection

Or directly with Infection:

./vendor/bin/infection

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2025-01-20