Completed
Push — master ( 576fe1...180351 )
by Jacob
03:10
created
script/cron/fetch-github-activity.php 1 patch
Indentation   +37 added lines, -37 removed lines patch added patch discarded remove patch
@@ -9,9 +9,9 @@  discard block
 block discarded – undo
9 9
 
10 10
 $client = new Client();
11 11
 $client->authenticate(
12
-    $config->github->client_id,
13
-    $config->github->client_secret,
14
-    Client::AUTH_URL_CLIENT_ID
12
+	$config->github->client_id,
13
+	$config->github->client_secret,
14
+	Client::AUTH_URL_CLIENT_ID
15 15
 );
16 16
 
17 17
 /*********************************************
@@ -24,33 +24,33 @@  discard block
 block discarded – undo
24 24
 $mostRecentChangeDateTime = new DateTime($mostRecentChangeDateTime);
25 25
 
26 26
 $parameters = [
27
-    'sha' => 'master',
28
-    'since' => $mostRecentChangeDateTime->format('c'),
27
+	'sha' => 'master',
28
+	'since' => $mostRecentChangeDateTime->format('c'),
29 29
 ];
30 30
 $commits = $client->api('repo')->commits()->all('jacobemerick', 'web', $parameters);
31 31
 
32 32
 foreach ($commits as $commit) {
33
-    $uniqueChangeCheck = $changelogRepository->getChangeByHash($commit['sha']);
34
-    if ($uniqueChangeCheck !== false) {
35
-        continue;
36
-    }
37
-    $changelogRepository->insertChange(
38
-        $commit['sha'],
39
-        $commit['commit']['message'],
40
-        (new DateTime($commit['commit']['author']['date']))->setTimezone($container['default_timezone']),
41
-        $commit['commit']['author']['name'],
42
-        $commit['html_url']
43
-    );
33
+	$uniqueChangeCheck = $changelogRepository->getChangeByHash($commit['sha']);
34
+	if ($uniqueChangeCheck !== false) {
35
+		continue;
36
+	}
37
+	$changelogRepository->insertChange(
38
+		$commit['sha'],
39
+		$commit['commit']['message'],
40
+		(new DateTime($commit['commit']['author']['date']))->setTimezone($container['default_timezone']),
41
+		$commit['commit']['author']['name'],
42
+		$commit['html_url']
43
+	);
44 44
 }
45 45
 
46 46
 /*********************************************
47 47
  * get activity for jacobemerick
48 48
  *********************************************/
49 49
 $supportedEventTypes = [
50
-    'CreateEvent',
51
-    'ForkEvent',
52
-    'PullRequestEvent',
53
-    'PushEvent',
50
+	'CreateEvent',
51
+	'ForkEvent',
52
+	'PullRequestEvent',
53
+	'PushEvent',
54 54
 ];
55 55
 
56 56
 $githubRepository = new GithubRepository($container['db_connection_locator']);
@@ -61,23 +61,23 @@  discard block
 block discarded – undo
61 61
 
62 62
 $events = $client->api('user')->publicEvents('jacobemerick');
63 63
 foreach ($events as $event) {
64
-    $eventDateTime = new DateTime($event['created_at']);
65
-    if ($eventDateTime <= $mostRecentEventDateTime) {
66
-        break;
67
-    }
64
+	$eventDateTime = new DateTime($event['created_at']);
65
+	if ($eventDateTime <= $mostRecentEventDateTime) {
66
+		break;
67
+	}
68 68
 
69
-    if (!in_array($event['type'], $supportedEventTypes)) {
70
-        continue;
71
-    }
72
-    $uniqueEventCheck = $githubRepository->getEventByEventId($event['id']);
73
-    if ($uniqueEventCheck !== false) {
74
-        continue;
75
-    }
69
+	if (!in_array($event['type'], $supportedEventTypes)) {
70
+		continue;
71
+	}
72
+	$uniqueEventCheck = $githubRepository->getEventByEventId($event['id']);
73
+	if ($uniqueEventCheck !== false) {
74
+		continue;
75
+	}
76 76
 
77
-    $githubRepository->insertEvent(
78
-        $event['id'],
79
-        $event['type'],
80
-        $eventDateTime->setTimezone($container['default_timezone']),
81
-        $event
82
-    );
77
+	$githubRepository->insertEvent(
78
+		$event['id'],
79
+		$event['type'],
80
+		$eventDateTime->setTimezone($container['default_timezone']),
81
+		$event
82
+	);
83 83
 }
Please login to merge, or discard this patch.