Skip to content
This repository was archived by the owner on Nov 13, 2018. It is now read-only.

Commit 17c049d

Browse files
authored
Apply fixes from StyleCI (#1)
Tried out StyleCI
1 parent 5974380 commit 17c049d

File tree

4 files changed

+18
-24
lines changed

4 files changed

+18
-24
lines changed

app/Classes/Calculator.php

Lines changed: 10 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -3,23 +3,21 @@
33
namespace Projects\Ankur;
44

55
/**
6-
* Class Calculator
7-
* @package Projects\Ankur
6+
* Class Calculator.
87
*/
98
class Calculator
109
{
11-
12-
1310
public function __construct()
1411
{
1512
// do something
1613
}
1714

1815
/**
19-
* Add two numbers
16+
* Add two numbers.
2017
*
2118
* @param $x
2219
* @param $y
20+
*
2321
* @return mixed
2422
*/
2523
public function addTwo($x, $y)
@@ -28,25 +26,25 @@ public function addTwo($x, $y)
2826
}
2927

3028
/**
31-
* Multiply two numbers
29+
* Multiply two numbers.
3230
*
3331
* @param $x
3432
* @param $y
35-
* @return mixed
3633
*
34+
* @return mixed
3735
*/
3836
public function multiplyTwo($x, $y)
3937
{
4038
return $x * $y;
4139
}
4240

4341
/**
44-
* Subtract two numbers
42+
* Subtract two numbers.
4543
*
4644
* @param $x
4745
* @param $y
48-
* @return mixed
4946
*
47+
* @return mixed
5048
*/
5149
public function subtractTwo($x, $y)
5250
{
@@ -55,15 +53,15 @@ public function subtractTwo($x, $y)
5553

5654
/**
5755
* Divide two numbers
58-
* //todo Handle divide by zero
56+
* //todo Handle divide by zero.
5957
*
6058
* @param $x
6159
* @param $y
60+
*
6261
* @return float
6362
*/
6463
public function divideTwo($x, $y)
6564
{
6665
return $x / $y;
6766
}
68-
69-
}
67+
}

public/index.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,14 +7,14 @@
77
<body>
88
<?php
99

10-
require('../vendor/autoload.php');
10+
require '../vendor/autoload.php';
1111

1212
use Projects\Ankur\Calculator;
1313

1414
$obj = new Calculator();
1515

1616
echo $obj->addTwo(2, 3);
17-
echo "<br>";
17+
echo '<br>';
1818
echo $obj->multiplyTwo(2, 3);
1919

2020
?>

tests/CalculatorTest.php

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -6,40 +6,36 @@
66
use Projects\Ankur as App;
77

88
/**
9-
* Class CalculatorTest
10-
* @package Tests
9+
* Class CalculatorTest.
1110
*/
1211
class CalculatorTest extends TestCase
1312
{
14-
15-
1613
private function getInstance()
1714
{
1815
return new App\Calculator();
1916
}
2017

2118
public function testAdd()
2219
{
23-
fwrite(STDOUT, __METHOD__ . "\n");
20+
fwrite(STDOUT, __METHOD__."\n");
2421
$obj = $this->getInstance();
2522
$value = $obj->addTwo(2, 3);
2623
$this->assertEquals($value, 5);
2724
}
2825

2926
public function testMultiply()
3027
{
31-
fwrite(STDOUT, __METHOD__ . "\n");
28+
fwrite(STDOUT, __METHOD__."\n");
3229
$obj = $this->getInstance();
3330
$value = $obj->multiplyTwo(2, 3);
3431
$this->assertEquals($value, 6);
3532
}
3633

3734
public function testSubtract()
3835
{
39-
fwrite(STDOUT, __METHOD__ . "\n");
36+
fwrite(STDOUT, __METHOD__."\n");
4037
$obj = $this->getInstance();
4138
$value = $obj->subtractTwo(4, 2);
4239
$this->assertEquals($value, 2);
4340
}
44-
45-
}
41+
}

tests/bootstrap.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
<?php
22

3-
require 'vendor/autoload.php';
3+
require 'vendor/autoload.php';

0 commit comments

Comments
 (0)