Completed
Pull Request — master (#144)
by Kristof
04:46
created
src/StringFilter/TruncateStringFilter.php 2 patches
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -96,18 +96,18 @@  discard block
 block discarded – undo
96 96
             // If the ellipsis is longer or equal to the maximum length, simply truncate the ellipsis so it fits in
97 97
             // the maximum length and return it.
98 98
             if ($suffix->length() >= $maxLength) {
99
-                return (string) $suffix->truncate($maxLength);
99
+                return (string)$suffix->truncate($maxLength);
100 100
             }
101 101
         }
102 102
 
103 103
         $stringy = Stringy::create($string, 'UTF-8');
104 104
 
105 105
         $sentencePattern = '/(.*[.!?])(?:\\s|\\h|$|\\\u00a0).*/su';
106
-        $trunc = (string) $stringy->first($maxLength);
106
+        $trunc = (string)$stringy->first($maxLength);
107 107
         $hasEndingSymbolInRange = preg_match($sentencePattern, $trunc);
108 108
 
109 109
         if ($this->sentenceFriendly && $hasEndingSymbolInRange === 1) {
110
-            $sentenceTruncated = preg_replace($sentencePattern, "$1".$suffix, $trunc);
110
+            $sentenceTruncated = preg_replace($sentencePattern, "$1" . $suffix, $trunc);
111 111
             $truncated = Stringy::create($sentenceTruncated, 'UTF-8');
112 112
         } else if ($wordSafe) {
113 113
             $truncated = $stringy->safeTruncate($maxLength, $suffix);
@@ -122,6 +122,6 @@  discard block
 block discarded – undo
122 122
             $truncated = $truncated->regexReplace($pattern, $suffix);
123 123
         }
124 124
 
125
-        return (string) $truncated;
125
+        return (string)$truncated;
126 126
     }
127 127
 }
Please login to merge, or discard this patch.
Indentation   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -1,7 +1,7 @@
 block discarded – undo
1 1
 <?php
2 2
 /**
3
- * @file
4
- */
3
+     * @file
4
+     */
5 5
 
6 6
 namespace CultuurNet\UDB3\Variations;
7 7
 
Please login to merge, or discard this patch.
src/Translation.php 2 patches
Indentation   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -1,10 +1,10 @@
 block discarded – undo
1 1
 <?php
2 2
 /**
3
- * Created by PhpStorm.
4
- * User: nicolas
5
- * Date: 09/11/15
6
- * Time: 14:31
7
- */
3
+     * Created by PhpStorm.
4
+     * User: nicolas
5
+     * Date: 09/11/15
6
+     * Time: 14:31
7
+     */
8 8
 
9 9
 namespace CultuurNet\UDB3;
10 10
 
Please login to merge, or discard this patch.
Doc Comments   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -36,9 +36,9 @@
 block discarded – undo
36 36
     /**
37 37
      * Translation constructor.
38 38
      * @param Language $language
39
-     * @param String|null $title
40
-     * @param String|null $shortDescription
41
-     * @param String|null $longDescription
39
+     * @param null|string $title
40
+     * @param null|string $shortDescription
41
+     * @param null|string $longDescription
42 42
      */
43 43
     public function __construct(
44 44
         Language $language,
Please login to merge, or discard this patch.
src/TypicalAgeRangeUpdatedTrait.php 1 patch
Indentation   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -33,7 +33,7 @@
 block discarded – undo
33 33
     public function serialize()
34 34
     {
35 35
         return parent::serialize() + array(
36
-          'typicalAgeRange' => $this->typicalAgeRange,
36
+            'typicalAgeRange' => $this->typicalAgeRange,
37 37
         );
38 38
     }
39 39
 }
Please login to merge, or discard this patch.
src/Variations/Command/EditDescriptionJSONDeserializer.php 4 patches
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -96,7 +96,7 @@
 block discarded – undo
96 96
     private function getErrorMessages($validationErrors)
97 97
     {
98 98
         $errorMessages = array_map(
99
-            function ($error) {
99
+            function($error) {
100 100
                 return $error['message'];
101 101
             },
102 102
             $validationErrors
Please login to merge, or discard this patch.
Indentation   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -1,7 +1,7 @@
 block discarded – undo
1 1
 <?php
2 2
 /**
3
- * @file
4
- */
3
+     * @file
4
+     */
5 5
 
6 6
 namespace CultuurNet\UDB3\Variations;
7 7
 
Please login to merge, or discard this patch.
Unused Use Statements   -1 removed lines patch added patch discarded remove patch
@@ -9,7 +9,6 @@
 block discarded – undo
9 9
 use CultuurNet\UDB3\Variations\Model\Properties\Description;
10 10
 use CultuurNet\UDB3\Variations\Model\Properties\Id;
11 11
 use JsonSchema\Validator;
12
-use ValueObjects\String\String;
13 12
 use stdClass;
14 13
 
15 14
 class EditDescriptionJSONDeserializer extends JSONDeserializer
Please login to merge, or discard this patch.
Doc Comments   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -70,7 +70,7 @@
 block discarded – undo
70 70
     }
71 71
 
72 72
     /**
73
-     * @param mixed $json
73
+     * @param stdClass $json
74 74
      *
75 75
      * @throws ValidationException
76 76
      */
Please login to merge, or discard this patch.
src/Variations/Model/Events/DescriptionEdited.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -39,7 +39,7 @@
 block discarded – undo
39 39
     public function serialize()
40 40
     {
41 41
         return parent::serialize() + array(
42
-            'description' => (string) $this->description,
42
+            'description' => (string)$this->description,
43 43
         );
44 44
     }
45 45
 
Please login to merge, or discard this patch.
src/Variations/ReadModel/JSONLD/Projector.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -62,7 +62,7 @@
 block discarded – undo
62 62
         $variationLD = $variation->getBody();
63 63
         $language = 'nl';
64 64
 
65
-        $variationLD->description->$language = (string) $descriptionEdited->getDescription();
65
+        $variationLD->description->$language = (string)$descriptionEdited->getDescription();
66 66
         $this->repository->save($variation->withBody($variationLD));
67 67
 
68 68
     }
Please login to merge, or discard this patch.
src/Variations/VariationDecoratedEventService.php 1 patch
Indentation   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -1,7 +1,7 @@
 block discarded – undo
1 1
 <?php
2 2
 /**
3
- * @file
4
- */
3
+     * @file
4
+     */
5 5
 
6 6
 namespace CultuurNet\UDB3\Variations;
7 7
 
Please login to merge, or discard this patch.
src/XMLSyntaxException.php 1 patch
Indentation   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -1,10 +1,10 @@
 block discarded – undo
1 1
 <?php
2 2
 /**
3
- * Created by PhpStorm.
4
- * User: nicolas
5
- * Date: 06/10/15
6
- * Time: 10:19
7
- */
3
+     * Created by PhpStorm.
4
+     * User: nicolas
5
+     * Date: 06/10/15
6
+     * Time: 10:19
7
+     */
8 8
 
9 9
 namespace CultuurNet\UDB3;
10 10
 
Please login to merge, or discard this patch.
src/Event/EventEditingServiceInterface.php 3 patches
Doc Comments   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -22,7 +22,7 @@  discard block
 block discarded – undo
22 22
      * @param Title $title
23 23
      * @param EventType $eventType
24 24
      * @param Address $address
25
-     * @param CalendarBase $calendar
25
+     * @param CalendarInterface $calendar
26 26
      * @param Theme|null $theme
27 27
      *
28 28
      * @return string $eventId
@@ -43,7 +43,7 @@  discard block
 block discarded – undo
43 43
      * @param Title $title
44 44
      * @param EventType $eventType
45 45
      * @param Address $address
46
-     * @param CalendarBase $calendar
46
+     * @param CalendarInterface $calendar
47 47
      * @param Theme/null $theme
48 48
      */
49 49
     public function updateMajorInfo($id, Title $title, EventType $eventType, Address $address, CalendarInterface $calendar, $theme = null);
Please login to merge, or discard this patch.
Indentation   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -1,7 +1,7 @@
 block discarded – undo
1 1
 <?php
2 2
 /**
3
- * @file
4
- */
3
+     * @file
4
+     */
5 5
 
6 6
 namespace CultuurNet\UDB3\Variations;
7 7
 
Please login to merge, or discard this patch.
Unused Use Statements   -4 removed lines patch added patch discarded remove patch
@@ -7,12 +7,8 @@
 block discarded – undo
7 7
 
8 8
 use CultuurNet\UDB3\CalendarInterface;
9 9
 use CultuurNet\UDB3\ContactPoint;
10
-use CultuurNet\UDB3\EventNotFoundException;
11
-use CultuurNet\UDB3\Label;
12
-use CultuurNet\UDB3\Language;
13 10
 use CultuurNet\UDB3\Location;
14 11
 use CultuurNet\UDB3\Media\Image;
15
-use CultuurNet\UDB3\Media\MediaObject;
16 12
 use CultuurNet\UDB3\Title;
17 13
 use ValueObjects\String\String;
18 14
 
Please login to merge, or discard this patch.