Completed
Push — master ( 8817c3...c1b66d )
by Jacob
03:14
created
src/Domain/Stream/YouTube/MysqlYouTubeRepository.php 1 patch
Indentation   +49 added lines, -49 removed lines patch added patch discarded remove patch
@@ -8,73 +8,73 @@
 block discarded – undo
8 8
 class MysqlYouTubeRepository implements YouTubeRepositoryInterface
9 9
 {
10 10
 
11
-    /** @var  ConnectionLocator */
12
-    protected $connections;
11
+	/** @var  ConnectionLocator */
12
+	protected $connections;
13 13
 
14
-    /**
15
-     * @param ConnectonLocator $connections
16
-     */
17
-    public function __construct(ConnectionLocator $connections)
18
-    {
19
-        $this->connections = $connections;
20
-    }
14
+	/**
15
+	 * @param ConnectonLocator $connections
16
+	 */
17
+	public function __construct(ConnectionLocator $connections)
18
+	{
19
+		$this->connections = $connections;
20
+	}
21 21
 
22
-    public function getYouTubes($limit = null, $offset = 0)
23
-    {
24
-        $query = "
22
+	public function getYouTubes($limit = null, $offset = 0)
23
+	{
24
+		$query = "
25 25
             SELECT `id`, `video_id`, `datetime`
26 26
             FROM `jpemeric_stream`.`youtube`
27 27
             ORDER BY `datetime` DESC";
28
-        if (!is_null($limit)) {
29
-            $query .= "
28
+		if (!is_null($limit)) {
29
+			$query .= "
30 30
             LIMIT {$offset}, {$limit}";
31
-        }
31
+		}
32 32
 
33
-        return $this
34
-            ->connections
35
-            ->getRead()
36
-            ->fetchAll($query);
37
-    }
33
+		return $this
34
+			->connections
35
+			->getRead()
36
+			->fetchAll($query);
37
+	}
38 38
 
39
-    /**
40
-     * @param string $title
41
-     *
42
-     * @return array|false
43
-     */
44
-    public function getYouTubeByVideoId($videoId)
45
-    {
46
-        $query = "
39
+	/**
40
+	 * @param string $title
41
+	 *
42
+	 * @return array|false
43
+	 */
44
+	public function getYouTubeByVideoId($videoId)
45
+	{
46
+		$query = "
47 47
             SELECT *
48 48
             FROM `jpemeric_stream`.`youtube`
49 49
             WHERE `video_id` = :video_id
50 50
             LIMIT 1";
51
-        $bindings = [
52
-            'video_id' => $videoId,
53
-        ];
51
+		$bindings = [
52
+			'video_id' => $videoId,
53
+		];
54 54
 
55
-        return $this
56
-            ->connections
57
-            ->getRead()
58
-            ->fetchOne($query, $bindings);
59
-    }
55
+		return $this
56
+			->connections
57
+			->getRead()
58
+			->fetchOne($query, $bindings);
59
+	}
60 60
 
61
-    public function insertVideo($videoId, DateTime $datetime, array $metadata)
62
-    {
63
-        $query = "
61
+	public function insertVideo($videoId, DateTime $datetime, array $metadata)
62
+	{
63
+		$query = "
64 64
             INSERT INTO `jpemeric_stream`.`youtube`
65 65
                 (`video_id`, `datetime`, `metadata`)
66 66
             VALUES
67 67
                 (:video_id, :datetime, :metadata)";
68 68
 
69
-        $bindings = [
70
-            'video_id' => $videoId,
71
-            'datetime' => $datetime->format('Y-m-d H:i:s'),
72
-            'metadata' => json_encode($metadata),
73
-        ];
69
+		$bindings = [
70
+			'video_id' => $videoId,
71
+			'datetime' => $datetime->format('Y-m-d H:i:s'),
72
+			'metadata' => json_encode($metadata),
73
+		];
74 74
 
75
-        return $this
76
-            ->connections
77
-            ->getWrite()
78
-            ->perform($query, $bindings);
79
-    }
75
+		return $this
76
+			->connections
77
+			->getWrite()
78
+			->perform($query, $bindings);
79
+	}
80 80
 }
Please login to merge, or discard this patch.