Skip to content

Commit

Permalink
Initial commit
Browse files Browse the repository at this point in the history
  • Loading branch information
Vadim Matsotskyi committed Sep 6, 2023
0 parents commit 361ee69
Show file tree
Hide file tree
Showing 6 changed files with 78 additions and 0 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
/vendor
.idea
9 changes: 9 additions & 0 deletions LICENSE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
MIT License

Copyright (c) 2023 SapientPro

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
Vadym Matsotskyi's Calculator

Perform addition, subtraction, multiplication and division using PHP
19 changes: 19 additions & 0 deletions composer.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
{
"name": "vadymtsots/calculator",
"description": "Perform addition, subtraction, multiplication and division using PHP",
"license": "MIT",
"authors": [
{
"name": "Vadym Matsotskyi",
"email": "email@example.com"
}
],
"require": {
"php": "^8.1"
},
"autoload": {
"psr-4": {
"Vadymtsots\\Calculator\\": "src/"
}
}
}
20 changes: 20 additions & 0 deletions composer.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

25 changes: 25 additions & 0 deletions src/Calculator.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
<?php

namespace Vadymtsots\Calculator;
class Calculator
{
public function add(int $a, int $b): int
{
return $a + $b;
}

public function subtract(int $a, int $b): int
{
return $a - $b;
}

public function multiply(int $a, int $b): int
{
return $a * $b;
}

public function divide(int $a, int $b): float
{
return $a / $b;
}
}

0 comments on commit 361ee69

Please sign in to comment.