Skip to content

alicaglayan/Calculator

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Calculator – It is a PHP test project.

It is a test project. This project is not maintained.

Installation with Composer

composer install

Requirements

PHP 7.3 or above

A Simple Example

<?php

use App\Calculator;

// Load Composer's autoloader
require __DIR__ . '/vendor/autoload.php';

try {
    // Create an instance
    $calculator = new Calculator();
    
    $add = $calculator->add->calculate(5, 3);
    echo '5 + 3 = '. $add .'\n';

    $divide = $calculator->divide->calculate(5, 3);
    echo '5 / 3 = '. $divide .'\n';

    $multiply = $calculator->multiply->calculate(5, 3);
    echo '5 * 3 = '. $multiply .'\n';

    $subtract = $calculator->subtract->calculate(5, 3);
    echo '5 - 3 = '. $subtract .'\n';
} catch (Throwable $e) {
    echo $e->getMessage();
}

That's it.

Tests

Calculator tests use PHPUnit 7.5

./vendor/bin/phpunit --testdox tests

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages