vineet / mathmatical-operation
此包最新版本(dev-main)没有可用的许可信息。
vineet/mathmatical-operation
dev-main
2023-01-17 06:00 UTC
Requires
- guzzlehttp/guzzle: ^7.5
Requires (Dev)
- phpunit/phpunit: ^9
This package is auto-updated.
Last update: 2024-09-17 09:48:46 UTC
README
安装
步骤 1: 在根目录创建 composer.json 文件并定义
{
"minimum-stability": "dev"
}
步骤 2: 通过 Composer 命令行
$ composer require vineet/mathmatical-operation
如何使用此包
步骤 1: 使用这种方式访问此包类
$class = new \Vineet\MathmaticalOperation\Calculation()
步骤 2: 访问以下方法(加,减,乘,除)
$result=$class->add($val1,$val2);
步骤 3: 创建自己的文件以测试包,使用以下代码进行访问
require_once 'vendor/autoload.php';
$class = new \Vineet\MathmaticalOperation\Calculation();
$result=$class->add(10,20);
echo $result;
步骤 4: 函数定义如下
function add($a,$b){
return $a+$b;
}
function subtract($a,$b){
return $a+$b;
}
function multiply($a,$b){
return $a+$b;
}
function division($a,$b){
return $a/$b;
}
步骤 5: 使用以下命令检查您的测试用例
* .\vendor\bin\phpunit tests