Passed
Push — master ( 7a48d2...d0f71f )
by Jakub
12:49
created
tests/HeroesofAbenez/Combat/CombatActions/AttackTest.php 1 patch
Upper-Lower-Casing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -30,7 +30,7 @@
 block discarded – undo
30 30
     private function generateCharacter(int $id): Character
31 31
     {
32 32
         $stats = [
33
-            "id" => $id, "name" => "Player $id", "level" => 1, "initiativeFormula" => "1d2+DEX/4", "strength" => 10,
33
+            "id" => $id, "name" => "player $id", "level" => 1, "initiativeFormula" => "1d2+DEX/4", "strength" => 10,
34 34
             "dexterity" => 10, "constitution" => 10, "intelligence" => 10, "charisma" => 10
35 35
         ];
36 36
         return new Character($stats);
Please login to merge, or discard this patch.
tests/HeroesofAbenez/Combat/StaticSuccessCalculatorTest.php 2 patches
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -33,7 +33,7 @@  discard block
 block discarded – undo
33 33
     {
34 34
         $character1 = $this->generateCharacter(1);
35 35
         $character2 = $this->generateCharacter(2);
36
-        for ($i = 1; $i <= 10; $i++) {
36
+        for($i = 1; $i <= 10; $i++) {
37 37
             Assert::true($this->calculator->hasHit($character1, $character2));
38 38
         }
39 39
     }
@@ -41,7 +41,7 @@  discard block
 block discarded – undo
41 41
     public function testHasHealed(): void
42 42
     {
43 43
         $character1 = $this->generateCharacter(1);
44
-        for ($i = 1; $i <= 10; $i++) {
44
+        for($i = 1; $i <= 10; $i++) {
45 45
             Assert::true($this->calculator->hasHealed($character1));
46 46
         }
47 47
     }
Please login to merge, or discard this patch.
Upper-Lower-Casing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -23,7 +23,7 @@
 block discarded – undo
23 23
     private function generateCharacter(int $id): Character
24 24
     {
25 25
         $stats = [
26
-            "id" => $id, "name" => "Player $id", "level" => 1, "initiativeFormula" => "1d2+DEX/4", "strength" => 10,
26
+            "id" => $id, "name" => "player $id", "level" => 1, "initiativeFormula" => "1d2+DEX/4", "strength" => 10,
27 27
             "dexterity" => 10, "constitution" => 10, "intelligence" => 10, "charisma" => 10
28 28
         ];
29 29
         return new Character($stats);
Please login to merge, or discard this patch.
tests/HeroesofAbenez/Combat/WeaponTest.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -18,12 +18,12 @@
 block discarded – undo
18 18
         $weaponStats = [
19 19
             "id" => 1, "name" => "Weapon", "slot" => Equipment::SLOT_WEAPON, "strength" => 1, "worn" => true,
20 20
         ];
21
-        foreach (Weapon::MELEE_TYPES as $meleeWeapon) {
21
+        foreach(Weapon::MELEE_TYPES as $meleeWeapon) {
22 22
             $weaponStats["type"] = $meleeWeapon;
23 23
             $weapon = new Weapon($weaponStats);
24 24
             Assert::false($weapon->ranged);
25 25
         }
26
-        foreach (Weapon::RANGED_TYPES as $rangedWeapon) {
26
+        foreach(Weapon::RANGED_TYPES as $rangedWeapon) {
27 27
             $weaponStats["type"] = $rangedWeapon;
28 28
             $weapon = new Weapon($weaponStats);
29 29
             Assert::true($weapon->ranged);
Please login to merge, or discard this patch.
tests/HeroesofAbenez/Combat/TextCombatLogRenderTest.php 1 patch
Upper-Lower-Casing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -19,7 +19,7 @@
 block discarded – undo
19 19
     private function generateCharacter(int $id): Character
20 20
     {
21 21
         $stats = [
22
-            "id" => $id, "name" => "Player $id", "level" => 1, "initiativeFormula" => "1d2+DEX/4", "strength" => 10,
22
+            "id" => $id, "name" => "player $id", "level" => 1, "initiativeFormula" => "1d2+DEX/4", "strength" => 10,
23 23
             "dexterity" => 10, "constitution" => 10, "intelligence" => 10, "charisma" => 10
24 24
         ];
25 25
         return new Character($stats);
Please login to merge, or discard this patch.
tests/HeroesofAbenez/Combat/CharacterTest.php 1 patch
Upper-Lower-Casing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -16,7 +16,7 @@
 block discarded – undo
16 16
     private function generateCharacter(int $id): Character
17 17
     {
18 18
         $stats = [
19
-            "id" => $id, "name" => "Player $id", "level" => 1, "initiativeFormula" => "1d2+DEX/4", "strength" => 10,
19
+            "id" => $id, "name" => "player $id", "level" => 1, "initiativeFormula" => "1d2+DEX/4", "strength" => 10,
20 20
             "dexterity" => 10, "constitution" => 10, "intelligence" => 10, "charisma" => 10
21 21
         ];
22 22
         return new Character($stats);
Please login to merge, or discard this patch.
tests/HeroesofAbenez/Combat/CombatLoggerTest.php 2 patches
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -25,7 +25,7 @@  discard block
 block discarded – undo
25 25
         /** @var CombatLogger $logger */
26 26
         $logger = $this->getService(CombatLogger::class);
27 27
         $logger->setTeams(new Team("Team1"), new Team("Team 2"));
28
-        Assert::exception(function () use ($logger) {
28
+        Assert::exception(function() use ($logger) {
29 29
             $logger->setTeams(new Team("Team1"), new Team("Team 2"));
30 30
         }, ImmutableException::class);
31 31
     }
@@ -83,10 +83,10 @@  discard block
 block discarded – undo
83 83
         /** @var CombatLogger $logger */
84 84
         $logger = $this->getService(CombatLogger::class);
85 85
         $logger->round = 1;
86
-        for ($i = 1; $i <= 5; $i++) {
86
+        for($i = 1; $i <= 5; $i++) {
87 87
             $logger->logText("abc");
88 88
         }
89
-        foreach ($logger as $round => $actions) {
89
+        foreach($logger as $round => $actions) {
90 90
             Assert::same(1, $round);
91 91
             Assert::type("array", $actions);
92 92
             Assert::count(5, $actions);
Please login to merge, or discard this patch.
Upper-Lower-Casing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -54,7 +54,7 @@
 block discarded – undo
54 54
     private function generateCharacter(int $id): Character
55 55
     {
56 56
         $stats = [
57
-            "id" => $id, "name" => "Player $id", "level" => 1, "initiativeFormula" => "1d2+DEX/4", "strength" => 10,
57
+            "id" => $id, "name" => "player $id", "level" => 1, "initiativeFormula" => "1d2+DEX/4", "strength" => 10,
58 58
             "dexterity" => 10, "constitution" => 10, "intelligence" => 10, "charisma" => 10
59 59
         ];
60 60
         return new Character($stats);
Please login to merge, or discard this patch.
tests/bootstrap.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -2,7 +2,7 @@
 block discarded – undo
2 2
 declare(strict_types=1);
3 3
 
4 4
 require __DIR__ . "/../vendor/autoload.php";
5
-Testbench\Bootstrap::setup(__DIR__ . '/_temp', function (\Nette\Bootstrap\Configurator $configurator): void {
6
-    $configurator->addStaticParameters(["appDir" => __DIR__,]);
5
+Testbench\Bootstrap::setup(__DIR__ . '/_temp', function(\Nette\Bootstrap\Configurator $configurator): void {
6
+    $configurator->addStaticParameters(["appDir" => __DIR__, ]);
7 7
     $configurator->addConfig(__DIR__ . "/tests.neon");
8 8
 });
Please login to merge, or discard this patch.
src/ICharacterEffectsProvider.php 1 patch
Braces   +1 added lines, -2 removed lines patch added patch discarded remove patch
@@ -8,8 +8,7 @@
 block discarded – undo
8 8
  *
9 9
  * @author Jakub Konečný
10 10
  */
11
-interface ICharacterEffectsProvider
12
-{
11
+interface ICharacterEffectsProvider {
13 12
     /** @return CharacterEffect[] */
14 13
     public function getCombatEffects(): array;
15 14
 }
Please login to merge, or discard this patch.
src/SkillAttack.php 2 patches
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -39,12 +39,12 @@
 block discarded – undo
39 39
     protected function configureOptions(OptionsResolver $resolver): void
40 40
     {
41 41
         parent::configureOptions($resolver);
42
-        $allStats = ["baseDamage", "damageGrowth", "strikes", "hitRate",];
42
+        $allStats = ["baseDamage", "damageGrowth", "strikes", "hitRate", ];
43 43
         $resolver->setRequired($allStats);
44 44
         $resolver->setAllowedTypes("baseDamage", "string");
45 45
         $resolver->setAllowedTypes("damageGrowth", "string");
46 46
         $resolver->setAllowedTypes("strikes", "integer");
47
-        $resolver->setAllowedValues("strikes", function (int $value): bool {
47
+        $resolver->setAllowedValues("strikes", function(int $value): bool {
48 48
             return ($value > 0);
49 49
         });
50 50
         $resolver->setAllowedTypes("hitRate", ["string", "null"]);
Please login to merge, or discard this patch.
Braces   +2 added lines, -4 removed lines patch added patch discarded remove patch
@@ -10,8 +10,7 @@  discard block
 block discarded – undo
10 10
  *
11 11
  * @author Jakub Konečný
12 12
  */
13
-final class SkillAttack extends BaseSkill
14
-{
13
+final class SkillAttack extends BaseSkill {
15 14
     public const TARGET_SINGLE = "single";
16 15
     public const TARGET_ROW = "row";
17 16
     public const TARGET_COLUMN = "column";
@@ -21,8 +20,7 @@  discard block
 block discarded – undo
21 20
     public readonly int $strikes;
22 21
     public readonly ?string $hitRate;
23 22
 
24
-    public function __construct(array $data)
25
-    {
23
+    public function __construct(array $data) {
26 24
         $resolver = new OptionsResolver();
27 25
         $this->configureOptions($resolver);
28 26
         $data = $resolver->resolve($data);
Please login to merge, or discard this patch.