Passed
Branch master (dc5c24)
by Zlatin
02:26
created
src/Form/DataTransformer/MediaTransformer.php 2 patches
Doc Comments   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -52,7 +52,7 @@
 block discarded – undo
52 52
      * 
53 53
      * @param Media|null $value
54 54
      * 
55
-     * @return integer
55
+     * @return Media|null
56 56
      */
57 57
     public function transform($value)
58 58
     {
Please login to merge, or discard this patch.
Braces   +2 added lines, -4 removed lines patch added patch discarded remove patch
@@ -71,11 +71,9 @@
 block discarded – undo
71 71
     {
72 72
         if (null === $value) {
73 73
             return null;
74
-        }
75
-        else if ($value->getBinary()) {
74
+        } else if ($value->getBinary()) {
76 75
             return $this->provider->save($value->getBinary(), $value);
77
-        }
78
-        else if ($value->getId()) {
76
+        } else if ($value->getId()) {
79 77
             return $value;
80 78
         }
81 79
         
Please login to merge, or discard this patch.
src/Provider/ImageProvider.php 2 patches
Doc Comments   -1 removed lines patch added patch discarded remove patch
@@ -98,7 +98,6 @@
 block discarded – undo
98 98
     /**
99 99
      * 
100 100
      * @param Media $media
101
-     * @param boolean $keep
102 101
      * 
103 102
      * @return Media
104 103
      */
Please login to merge, or discard this patch.
Indentation   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -9,7 +9,7 @@  discard block
 block discarded – undo
9 9
 class ImageProvider
10 10
 {
11 11
 
12
-	/**
12
+    /**
13 13
      *
14 14
      * @var \Silex\Application
15 15
      */
@@ -71,8 +71,8 @@  discard block
 block discarded – undo
71 71
         if (!$media instanceof Media) {
72 72
             $media = new Media();
73 73
         } else {
74
-			$media->setBinary(null);
75
-		}
74
+            $media->setBinary(null);
75
+        }
76 76
 
77 77
         $meta = $this->getMetaData($file);
78 78
         $name = $this->guestName() . "." . $file->guessClientExtension();
Please login to merge, or discard this patch.
src/MediaServiceProvider.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -16,7 +16,7 @@
 block discarded – undo
16 16
     public function register(Application $app)
17 17
     {
18 18
 
19
-        $app['form.types'] = $app->share($app->extend('form.types', function ($types) use ($app) {
19
+        $app['form.types'] = $app->share($app->extend('form.types', function($types) use ($app) {
20 20
                     $types[] = new Form\Type\MediaType($app);
21 21
                     return $types;
22 22
                 }));
Please login to merge, or discard this patch.
src/Entity/Media.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -71,7 +71,7 @@
 block discarded – undo
71 71
      */
72 72
     public function __toString()
73 73
     {
74
-        return $this->getName() ? : "";
74
+        return $this->getName() ?: "";
75 75
     }
76 76
     
77 77
     /**
Please login to merge, or discard this patch.
src/Twig/MediaExtension.php 2 patches
Indentation   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -5,13 +5,13 @@
 block discarded – undo
5 5
 class MediaExtension extends \Twig_Extension
6 6
 {
7 7
     
8
-	/**
8
+    /**
9 9
      *
10 10
      * @var \Silex\Application
11 11
      */
12 12
     private $app;
13 13
 	
14
-	/**
14
+    /**
15 15
      * 
16 16
      * @param \Silex\Application $app
17 17
      */
Please login to merge, or discard this patch.
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -29,7 +29,7 @@
 block discarded – undo
29 29
     
30 30
     public function media(\Media\Entity\Media $media)
31 31
     {
32
-        $url = "uploads/" . intval($media->getId()/1000) . "/" . $media->getName();
32
+        $url = "uploads/" . intval($media->getId() / 1000) . "/" . $media->getName();
33 33
         $base = $this->app['request']->getBasePath();
34 34
         return sprintf("%s/%s", $base, $url);
35 35
     }
Please login to merge, or discard this patch.