Completed
Branch v1.x-dev (59bcf7)
by Benjamin
05:08
created
src/DataTransformer/PlayerTeamCollectionTransformer.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -28,7 +28,7 @@
 block discarded – undo
28 28
         foreach ($value->getPlayers() as $player) {
29 29
             $usedNumbers[$player->getNumber()] = $player;
30 30
         }
31
-        for ($i=1; $i<=16; $i++) {
31
+        for ($i = 1; $i <= 16; $i++) {
32 32
             if (!isset($usedNumbers[$i])) {
33 33
                 $value->addPlayer((new Player())->setNumber($i));
34 34
             }
Please login to merge, or discard this patch.
src/Form/Team/TeamType.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -189,7 +189,7 @@
 block discarded – undo
189 189
         foreach ($newPlayerList as $player) {
190 190
             $usedNumbers[$player->getNumber()] = $player;
191 191
         }
192
-        for ($i=1; $i<=16; $i++) {
192
+        for ($i = 1; $i <= 16; $i++) {
193 193
             if (!isset($usedNumbers[$i])) {
194 194
                 $newPlayerList->add((new Player())->setNumber($i));
195 195
             }
Please login to merge, or discard this patch.
src/Helper/FileUploader/AbstractFileUploader.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -29,7 +29,7 @@  discard block
 block discarded – undo
29 29
         try {
30 30
             $filesystem->remove($this->getObjectDirectory() . '/' . $filename);
31 31
         } catch (IOExceptionInterface $exception) {
32
-            echo "An error occurred while creating your directory at ".$exception->getPath();
32
+            echo "An error occurred while creating your directory at " . $exception->getPath();
33 33
         }
34 34
     }
35 35
 
@@ -45,7 +45,7 @@  discard block
 block discarded – undo
45 45
 
46 46
     public function setObjectSubDirectory(string $uploadDirectory): self
47 47
     {
48
-        $this->uploadDirectory = $this->targetDirectory .'/' . $uploadDirectory;
48
+        $this->uploadDirectory = $this->targetDirectory . '/' . $uploadDirectory;
49 49
         return $this;
50 50
     }
51 51
 
@@ -53,11 +53,11 @@  discard block
 block discarded – undo
53 53
      * @param UploadedFile $file
54 54
      * @return File|null
55 55
      */
56
-    public function upload(UploadedFile $file):?File
56
+    public function upload(UploadedFile $file): ?File
57 57
     {
58 58
         $originalFilename = pathinfo($file->getClientOriginalName(), PATHINFO_FILENAME);
59 59
         $safeFilename = $this->slugger->slug($originalFilename);
60
-        $fileName = $safeFilename.'-'.uniqid().'.'.$file->guessExtension();
60
+        $fileName = $safeFilename . '-' . uniqid() . '.' . $file->guessExtension();
61 61
 
62 62
         try {
63 63
             $newFile = $file->move($this->getObjectDirectory(), $fileName);
Please login to merge, or discard this patch.
src/Service/FileTeamUploader.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -29,7 +29,7 @@  discard block
 block discarded – undo
29 29
         return null;
30 30
     }
31 31
 
32
-    public function uploadLogoIfExists(Team $object, $logoFile):?File
32
+    public function uploadLogoIfExists(Team $object, $logoFile): ?File
33 33
     {
34 34
         if ($logoFile) {
35 35
             $this->setObjectSubDirectory($object->getId());
@@ -44,7 +44,7 @@  discard block
 block discarded – undo
44 44
         }
45 45
         return null;
46 46
     }
47
-    public function uploadCoverIfExists(Team $object, $coverFile):?File
47
+    public function uploadCoverIfExists(Team $object, $coverFile): ?File
48 48
     {
49 49
         if ($coverFile) {
50 50
             $this->setObjectSubDirectory($object->getId());
Please login to merge, or discard this patch.
src/Helper/ImageHelper.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -32,8 +32,8 @@  discard block
 block discarded – undo
32 32
         $this->ruleHelper = $ruleHelper;
33 33
         $this->publicDirectory = $kernetProjectDir;
34 34
         $this->cacheDirectory = $cacheDirectory;
35
-        $this->ruleCacheDirectory = $this->cacheDirectory . self::RULE_PATH ;
36
-        $this->teamCacheDirectory = $this->cacheDirectory . self::TEAM_PATH ;
35
+        $this->ruleCacheDirectory = $this->cacheDirectory . self::RULE_PATH;
36
+        $this->teamCacheDirectory = $this->cacheDirectory . self::TEAM_PATH;
37 37
         $this->filesystem = new Filesystem();
38 38
         $this->fileTeamUploader = $fileTeamUploader;
39 39
     }
@@ -107,7 +107,7 @@  discard block
 block discarded – undo
107 107
         if (!$this->filesystem->exists($path)) {
108 108
             $img = $this->imageManager->make($file);
109 109
             $this->filesystem->mkdir($newCacheDirectory);
110
-            $img->resize($width, $height, function ($constraint) {
110
+            $img->resize($width, $height, function($constraint) {
111 111
                 $constraint->aspectRatio();
112 112
             });
113 113
             $img->save($path);
Please login to merge, or discard this patch.
src/Controller/TeamController.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -87,7 +87,7 @@
 block discarded – undo
87 87
         $pdf->setOption('disable-javascript', true);
88 88
         $pdf->setOption('title', $team->getName());
89 89
 
90
-        $fileName =  urlencode($team->getName()) . '.pdf';
90
+        $fileName = urlencode($team->getName()) . '.pdf';
91 91
 
92 92
         return new PdfResponse($pdf->getOutputFromHtml($html), $fileName, null, ResponseHeaderBag::DISPOSITION_INLINE);
93 93
     }
Please login to merge, or discard this patch.
src/DependencyInjection/ObblmCoreExtension.php 1 patch
Spacing   +2 added lines, -4 removed lines patch added patch discarded remove patch
@@ -52,14 +52,12 @@
 block discarded – undo
52 52
     {
53 53
         // Upload
54 54
         $uploadDirectory = (!isset($config['obblm.upload_directory'])) ?
55
-            $uploadDirectory = $container->getParameter('kernel.project_dir') . '/public/obblm/uploads' :
56
-            $config['obblm.upload_directory'];
55
+            $uploadDirectory = $container->getParameter('kernel.project_dir') . '/public/obblm/uploads' : $config['obblm.upload_directory'];
57 56
         $container->setParameter('obblm.config.directory.upload', $uploadDirectory);
58 57
 
59 58
         // Image resize cache
60 59
         $uploadDirectory = (!isset($config['obblm.public_cache_directory'])) ?
61
-            $uploadDirectory = $container->getParameter('kernel.project_dir') . '/public/obblm/cache' :
62
-            $config['obblm.public_cache_directory'];
60
+            $uploadDirectory = $container->getParameter('kernel.project_dir') . '/public/obblm/cache' : $config['obblm.public_cache_directory'];
63 61
         $container->setParameter('obblm.config.directory.public.cache', $uploadDirectory);
64 62
     }
65 63
 
Please login to merge, or discard this patch.
src/Helper/Rule/Traits/AbstractPlayerRuleTrait.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -87,7 +87,7 @@  discard block
 block discarded – undo
87 87
      * @return object|null
88 88
      * @throws \Exception
89 89
      */
90
-    public function getInjury($key):?object
90
+    public function getInjury($key): ?object
91 91
     {
92 92
         if (!$this->getInjuries()->containsKey($key)) {
93 93
             throw new NotFoundKeyException($key, 'getInjuries', self::class);
@@ -103,7 +103,7 @@  discard block
 block discarded – undo
103 103
      * @param PlayerVersion $version
104 104
      * @return string|null
105 105
      */
106
-    public function getSppLevel(PlayerVersion $version):?string
106
+    public function getSppLevel(PlayerVersion $version): ?string
107 107
     {
108 108
         if ($version->getSpp() && $version->getSpp() > 0) {
109 109
             if ($this->getSppLevels()->containsKey($version->getSpp())) {
@@ -115,7 +115,7 @@  discard block
 block discarded – undo
115 115
         return $this->getSppLevels()->first();
116 116
     }
117 117
 
118
-    public function getContextForRoll(array $roll):?array
118
+    public function getContextForRoll(array $roll): ?array
119 119
     {
120 120
         $context = null;
121 121
         if (isset($roll['d6_1']) && isset($roll['d6_2'])) {
@@ -139,7 +139,7 @@  discard block
 block discarded – undo
139 139
         return $context;
140 140
     }
141 141
 
142
-    public function getAvailableSkills(?PlayerVersion $version, $context = ['single', 'double']):?ArrayCollection
142
+    public function getAvailableSkills(?PlayerVersion $version, $context = ['single', 'double']): ?ArrayCollection
143 143
     {
144 144
         $criteria = Criteria::create();
145 145
         if ($version) {
Please login to merge, or discard this patch.
src/Helper/Rule/CanHaveRuleInterface.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -6,5 +6,5 @@
 block discarded – undo
6 6
 
7 7
 interface CanHaveRuleInterface
8 8
 {
9
-    public function getRule():?Rule;
9
+    public function getRule(): ?Rule;
10 10
 }
Please login to merge, or discard this patch.