Passed
Pull Request — master (#41)
by
unknown
03:09 queued 55s
created
src/Event.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -1,6 +1,6 @@  discard block
 block discarded – undo
1 1
 <?php
2 2
 
3
-declare( strict_types = 1 );
3
+declare(strict_types=1);
4 4
 
5 5
 namespace ModernTimeline;
6 6
 
@@ -38,7 +38,7 @@  discard block
 block discarded – undo
38 38
 		return $this->imageUrl;
39 39
 	}
40 40
 
41
-	public function setImageUrl( string $url ): void {
41
+	public function setImageUrl(string $url): void {
42 42
 		$this->imageUrl = $url;
43 43
 	}
44 44
 
Please login to merge, or discard this patch.
src/ResultFacade/ResultFormatRegistrator.php 1 patch
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -1,6 +1,6 @@  discard block
 block discarded – undo
1 1
 <?php
2 2
 
3
-declare( strict_types = 1 );
3
+declare(strict_types=1);
4 4
 
5 5
 namespace ModernTimeline\ResultFacade;
6 6
 
@@ -20,32 +20,32 @@  discard block
 block discarded – undo
20 20
 	 */
21 21
 	private $constructionFunction;
22 22
 
23
-	public function __construct( callable $registry ) {
23
+	public function __construct(callable $registry) {
24 24
 		$this->registry = $registry;
25 25
 	}
26 26
 
27
-	public function withName( string $name ): self {
27
+	public function withName(string $name): self {
28 28
 		$this->name = $name;
29 29
 		return $this;
30 30
 	}
31 31
 
32
-	public function andMessageKey( string $nameMessageKey ): self {
32
+	public function andMessageKey(string $nameMessageKey): self {
33 33
 		$this->nameMessageKey = $nameMessageKey;
34 34
 		return $this;
35 35
 	}
36 36
 
37
-	public function andParameterDefinitions( array $parameterDefinitions ): self {
37
+	public function andParameterDefinitions(array $parameterDefinitions): self {
38 38
 		$this->parameterDefinitions = $parameterDefinitions;
39 39
 		return $this;
40 40
 	}
41 41
 
42
-	public function andPresenterBuilder( callable $constructionFunction ): self {
42
+	public function andPresenterBuilder(callable $constructionFunction): self {
43 43
 		$this->constructionFunction = $constructionFunction;
44 44
 		return $this;
45 45
 	}
46 46
 
47 47
 	public function register(): void {
48
-		call_user_func( $this->registry, $this->newResultFormat() );
48
+		call_user_func($this->registry, $this->newResultFormat());
49 49
 	}
50 50
 
51 51
 	private function newResultFormat(): ResultFormat {
Please login to merge, or discard this patch.
src/ResultFacade/Subject.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -1,6 +1,6 @@  discard block
 block discarded – undo
1 1
 <?php
2 2
 
3
-declare( strict_types = 1 );
3
+declare(strict_types=1);
4 4
 
5 5
 namespace ModernTimeline\ResultFacade;
6 6
 
@@ -21,7 +21,7 @@  discard block
 block discarded – undo
21 21
 		private DIWikiPage $wikiPage,
22 22
 		array $propertyValueCollections
23 23
 	) {
24
-		$this->propertyValueCollections = new PropertyValueCollections( $propertyValueCollections );
24
+		$this->propertyValueCollections = new PropertyValueCollections($propertyValueCollections);
25 25
 	}
26 26
 
27 27
 	public function getWikiPage(): DIWikiPage {
Please login to merge, or discard this patch.
src/ResultFacade/ResultSimplifier.php 1 patch
Spacing   +11 added lines, -11 removed lines patch added patch discarded remove patch
@@ -1,6 +1,6 @@  discard block
 block discarded – undo
1 1
 <?php
2 2
 
3
-declare( strict_types = 1 );
3
+declare(strict_types=1);
4 4
 
5 5
 namespace ModernTimeline\ResultFacade;
6 6
 
@@ -11,14 +11,14 @@  discard block
 block discarded – undo
11 11
 
12 12
 class ResultSimplifier {
13 13
 
14
-	public function newSubjectCollection( QueryResult $result ): SubjectCollection {
14
+	public function newSubjectCollection(QueryResult $result): SubjectCollection {
15 15
 		$subjects = [];
16 16
 
17
-		foreach ( $result->getResults() as $diWikiPage ) {
18
-			$subjects[] = $this->newSubject( $diWikiPage, $result->getPrintRequests(), $result );
17
+		foreach ($result->getResults() as $diWikiPage) {
18
+			$subjects[] = $this->newSubject($diWikiPage, $result->getPrintRequests(), $result);
19 19
 		}
20 20
 
21
-		return SubjectCollection::newFromArray( $subjects );
21
+		return SubjectCollection::newFromArray($subjects);
22 22
 	}
23 23
 
24 24
 	/**
@@ -27,11 +27,11 @@  discard block
 block discarded – undo
27 27
 	 * @param QueryResult $result
28 28
 	 * @return Subject
29 29
 	 */
30
-	private function newSubject( DIWikiPage $resultPage, array $printRequests, QueryResult $result ): Subject {
30
+	private function newSubject(DIWikiPage $resultPage, array $printRequests, QueryResult $result): Subject {
31 31
 		$propertyValueCollections = [];
32 32
 
33
-		foreach ( $printRequests as $printRequest ) {
34
-			$dataItems = $this->newResultArray( $resultPage, $printRequest, $result )->getContent();
33
+		foreach ($printRequests as $printRequest) {
34
+			$dataItems = $this->newResultArray($resultPage, $printRequest, $result)->getContent();
35 35
 
36 36
 			$propertyValueCollections[] = new PropertyValueCollection(
37 37
 				$printRequest,
@@ -39,11 +39,11 @@  discard block
 block discarded – undo
39 39
 			);
40 40
 		}
41 41
 
42
-		return new Subject( $resultPage, $propertyValueCollections );
42
+		return new Subject($resultPage, $propertyValueCollections);
43 43
 	}
44 44
 
45
-	private function newResultArray( DIWikiPage $resultPage, PrintRequest $printRequest, QueryResult $result ): ResultArray {
46
-		return ResultArray::factory( $resultPage, $printRequest, $result );
45
+	private function newResultArray(DIWikiPage $resultPage, PrintRequest $printRequest, QueryResult $result): ResultArray {
46
+		return ResultArray::factory($resultPage, $printRequest, $result);
47 47
 	}
48 48
 
49 49
 }
Please login to merge, or discard this patch.
src/ResultFacade/PropertyValueCollection.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -1,6 +1,6 @@
 block discarded – undo
1 1
 <?php
2 2
 
3
-declare( strict_types = 1 );
3
+declare(strict_types=1);
4 4
 
5 5
 namespace ModernTimeline\ResultFacade;
6 6
 
Please login to merge, or discard this patch.
src/ResultFacade/PropertyValueCollections.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -1,6 +1,6 @@  discard block
 block discarded – undo
1 1
 <?php
2 2
 
3
-declare( strict_types = 1 );
3
+declare(strict_types=1);
4 4
 
5 5
 namespace ModernTimeline\ResultFacade;
6 6
 
@@ -24,7 +24,7 @@  discard block
 block discarded – undo
24 24
 	}
25 25
 
26 26
 	public function getIterator(): Traversable {
27
-		return new \ArrayIterator( $this->propertyValueCollections );
27
+		return new \ArrayIterator($this->propertyValueCollections);
28 28
 	}
29 29
 
30 30
 }
Please login to merge, or discard this patch.
src/ResultFacade/SubjectCollection.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -6,7 +6,7 @@  discard block
 block discarded – undo
6 6
 
7 7
 	private array $pages;
8 8
 
9
-	public function __construct( Subject ...$subjects ) {
9
+	public function __construct(Subject ...$subjects) {
10 10
 		$this->pages = $subjects;
11 11
 	}
12 12
 
@@ -14,7 +14,7 @@  discard block
 block discarded – undo
14 14
 	 * @param Subject[] $subjects
15 15
 	 * @return self
16 16
 	 */
17
-	public static function newFromArray( array $subjects ): self {
17
+	public static function newFromArray(array $subjects): self {
18 18
 		$instance = new self();
19 19
 		$instance->pages = $subjects;
20 20
 		return $instance;
Please login to merge, or discard this patch.
src/ResultFacade/ResultFormat.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -1,6 +1,6 @@  discard block
 block discarded – undo
1 1
 <?php
2 2
 
3
-declare( strict_types = 1 );
3
+declare(strict_types=1);
4 4
 
5 5
 namespace ModernTimeline\ResultFacade;
6 6
 
@@ -33,7 +33,7 @@  discard block
 block discarded – undo
33 33
 	}
34 34
 
35 35
 	public function buildPresenter(): ResultPresenter {
36
-		return call_user_func( $this->constructionFunction );
36
+		return call_user_func($this->constructionFunction);
37 37
 	}
38 38
 
39 39
 }
Please login to merge, or discard this patch.
src/JsonBuilder.php 1 patch
Spacing   +16 added lines, -16 removed lines patch added patch discarded remove patch
@@ -1,6 +1,6 @@  discard block
 block discarded – undo
1 1
 <?php
2 2
 
3
-declare( strict_types = 1 );
3
+declare(strict_types=1);
4 4
 
5 5
 namespace ModernTimeline;
6 6
 
@@ -19,32 +19,32 @@  discard block
 block discarded – undo
19 19
 	 * @param Event[] $events
20 20
 	 * @return array
21 21
 	 */
22
-	public function eventsToTimelineJson( array $events ): array {
22
+	public function eventsToTimelineJson(array $events): array {
23 23
 		$jsonEvents = [];
24 24
 
25
-		foreach ( $events as $event ) {
26
-			if ( $event->getSubject()->getWikiPage()->getTitle() !== null ) {
27
-				$jsonEvents[] = $this->buildEvent( $event );
25
+		foreach ($events as $event) {
26
+			if ($event->getSubject()->getWikiPage()->getTitle() !== null) {
27
+				$jsonEvents[] = $this->buildEvent($event);
28 28
 			}
29 29
 		}
30 30
 
31
-		return [ 'events' => $jsonEvents ];
31
+		return ['events' => $jsonEvents];
32 32
 	}
33 33
 
34
-	public function buildEvent( Event $event ): array {
34
+	public function buildEvent(Event $event): array {
35 35
 		$jsonEvent = [
36 36
 			'text' => [
37
-				'headline' => $this->newHeadline( $event->getSubject()->getWikiPage()->getTitle() ),
38
-				'text' => $this->slidePresenter->getText( $event->getSubject() )
37
+				'headline' => $this->newHeadline($event->getSubject()->getWikiPage()->getTitle()),
38
+				'text' => $this->slidePresenter->getText($event->getSubject())
39 39
 			],
40
-			'start_date' => $this->timeToJson( $event->getStartDate() ),
40
+			'start_date' => $this->timeToJson($event->getStartDate()),
41 41
 		];
42 42
 
43
-		if ( $event->getEndDate() !== null ) {
44
-			$jsonEvent['end_date'] = $this->timeToJson( $event->getEndDate() );
43
+		if ($event->getEndDate() !== null) {
44
+			$jsonEvent['end_date'] = $this->timeToJson($event->getEndDate());
45 45
 		}
46 46
 
47
-		if ( $event->hasImage() ) {
47
+		if ($event->hasImage()) {
48 48
 			$jsonEvent['media'] = [
49 49
 				'url' => $event->getImageUrl(),
50 50
 				'thumbnail' => $event->getImageUrl()
@@ -54,17 +54,17 @@  discard block
 block discarded – undo
54 54
 		return $jsonEvent;
55 55
 	}
56 56
 
57
-	private function newHeadline( \Title $title ): string {
57
+	private function newHeadline(\Title $title): string {
58 58
 		return \Html::element(
59 59
 			'a',
60
-			[ 'href' => $title->getFullURL() ],
60
+			['href' => $title->getFullURL()],
61 61
 			$title->getText()
62 62
 		);
63 63
 
64 64
 //		return DataValueFactory::getInstance()->newDataValueByItem( $subject->getWikiPage() )->getLongHTMLText( smwfGetLinker() );
65 65
 	}
66 66
 
67
-	private function timeToJson( SMWDITime $time ): array {
67
+	private function timeToJson(SMWDITime $time): array {
68 68
 		return [
69 69
 			'year' => $time->getYear(),
70 70
 			'month' => $time->getMonth(),
Please login to merge, or discard this patch.