Completed
Push — master ( 6555cb...4c1687 )
by Albert
07:43 queued 02:26
created
src/ElimuswiftCoreServiceProvider.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -24,7 +24,7 @@
 block discarded – undo
24 24
 	 */
25 25
 	public function register()
26 26
 	{
27
-		$this->app->singleton('envatoapi', function(){
27
+		$this->app->singleton('envatoapi', function() {
28 28
 			return new EnvatoApi(env('ENVATO_SECRET'));
29 29
 		});
30 30
 
Please login to merge, or discard this patch.
src/Migrations/2017_01_24_010521_create_updates_table.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -13,9 +13,9 @@
 block discarded – undo
13 13
 	 */
14 14
 	public function up()
15 15
 	{
16
-		Schema::create('updates', function (Blueprint $table) {
16
+		Schema::create('updates', function(Blueprint $table) {
17 17
 			$table->increments('id');
18
-			$table->string('version',10);
18
+			$table->string('version', 10);
19 19
 			$table->string('type');
20 20
 			$table->text('description');
21 21
 			$table->integer('downloads');
Please login to merge, or discard this patch.
src/EnvatoApi.php 3 patches
Indentation   +12 added lines, -12 removed lines patch added patch discarded remove patch
@@ -43,18 +43,18 @@  discard block
 block discarded – undo
43 43
 	public function getPurchaseData($code) 
44 44
 	{
45 45
 		$ch_verify = curl_init($this->url.$code);
46
-	    curl_setopt($ch_verify, CURLOPT_HTTPHEADER, $this->headers);
47
-	    curl_setopt($ch_verify, CURLOPT_SSL_VERIFYPEER, false);
48
-	    curl_setopt($ch_verify, CURLOPT_RETURNTRANSFER, 1);
49
-	    curl_setopt($ch_verify, CURLOPT_CONNECTTIMEOUT, 5);
50
-	    curl_setopt($ch_verify, CURLOPT_USERAGENT, 'Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.13) Gecko/20080311 Firefox/2.0.0.13');
46
+		curl_setopt($ch_verify, CURLOPT_HTTPHEADER, $this->headers);
47
+		curl_setopt($ch_verify, CURLOPT_SSL_VERIFYPEER, false);
48
+		curl_setopt($ch_verify, CURLOPT_RETURNTRANSFER, 1);
49
+		curl_setopt($ch_verify, CURLOPT_CONNECTTIMEOUT, 5);
50
+		curl_setopt($ch_verify, CURLOPT_USERAGENT, 'Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.13) Gecko/20080311 Firefox/2.0.0.13');
51 51
 	    
52
-	    $cinit_verify_data = curl_exec($ch_verify);
53
-	    curl_close($ch_verify);
52
+		$cinit_verify_data = curl_exec($ch_verify);
53
+		curl_close($ch_verify);
54 54
 	    
55
-	    if ($cinit_verify_data != "") {
56
-	    	      return json_decode($cinit_verify_data, true);
57
-	    }
55
+		if ($cinit_verify_data != "") {
56
+				  return json_decode($cinit_verify_data, true);
57
+		}
58 58
 
59 59
 	  	return ['error' => 'exception', 'description' => 'A server error was encountered please notify us if you see this']; 
60 60
 		     
@@ -84,8 +84,8 @@  discard block
 block discarded – undo
84 84
 	 **/
85 85
 	protected function buildHeaders()
86 86
 	{
87
-	    $headers = [
88
-	    	'Content-type' => 'application/json',
87
+		$headers = [
88
+			'Content-type' => 'application/json',
89 89
 			'Authorization' =>  'Bearer '.$this->bearer
90 90
 		];
91 91
 		$h = [];
Please login to merge, or discard this patch.
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -66,11 +66,11 @@
 block discarded – undo
66 66
 	 * @return string Array 
67 67
 	 * @param string $code Purchase Code 
68 68
 	 **/
69
-	public function verifyPurchase(string $code ) 
69
+	public function verifyPurchase(string $code) 
70 70
 	{
71 71
 		$purchase = [];
72 72
 		$purchase['response'] = (object) $this->getPurchaseData($code); 
73
-		if($purchase->error)
73
+		if ($purchase->error)
74 74
 			return $purchase['status'] = 'error';
75 75
 		else
76 76
 			return $purchase['status'] = 'success';
Please login to merge, or discard this patch.
Braces   +5 added lines, -4 removed lines patch added patch discarded remove patch
@@ -70,10 +70,11 @@
 block discarded – undo
70 70
 	{
71 71
 		$purchase = [];
72 72
 		$purchase['response'] = (object) $this->getPurchaseData($code); 
73
-		if($purchase->error)
74
-			return $purchase['status'] = 'error';
75
-		else
76
-			return $purchase['status'] = 'success';
73
+		if($purchase->error) {
74
+					return $purchase['status'] = 'error';
75
+		} else {
76
+					return $purchase['status'] = 'success';
77
+		}
77 78
 	}
78 79
 
79 80
 	/**
Please login to merge, or discard this patch.
src/Middlewares/LicenseCheker.php 2 patches
Indentation   +29 added lines, -29 removed lines patch added patch discarded remove patch
@@ -5,38 +5,38 @@
 block discarded – undo
5 5
 
6 6
 class LicenseChecker
7 7
 {
8
-    /**
9
-     * Handle an incoming request.
10
-     *
11
-     * @param  \Illuminate\Http\Request  $request
12
-     * @param  \Closure  $next
13
-     * @return mixed
14
-     */
15
-    public function handle($request, Closure $next, $licenseKey = null)
16
-    {
8
+	/**
9
+	 * Handle an incoming request.
10
+	 *
11
+	 * @param  \Illuminate\Http\Request  $request
12
+	 * @param  \Closure  $next
13
+	 * @return mixed
14
+	 */
15
+	public function handle($request, Closure $next, $licenseKey = null)
16
+	{
17 17
         
18
-    	if ($this->validLicense($licenseKey)) {
19
-        	return $next($request);
20
-    	}
21
-    	else {
22
-    		return response()->json(['UnAuthorized' => 'Invalid Purchase Key'], 403);
23
-    	}
18
+		if ($this->validLicense($licenseKey)) {
19
+			return $next($request);
20
+		}
21
+		else {
22
+			return response()->json(['UnAuthorized' => 'Invalid Purchase Key'], 403);
23
+		}
24 24
 
25
-    }
25
+	}
26 26
 
27
-    /** 
28
-     * Check if license key is valid
29
-     *
30
-     * @return boolean
31
-     **/
32
-    private function validLicense($licenseKey)
33
-    {
27
+	/** 
28
+	 * Check if license key is valid
29
+	 *
30
+	 * @return boolean
31
+	 **/
32
+	private function validLicense($licenseKey)
33
+	{
34 34
 
35
-        $purchase = app()->envatoapi->verifyPurchase($licenseKey);
36
-        if (is_array($purchase) and $purchase['status'] == 'success') {
37
-            return true;
38
-        }
39
-        return false;
35
+		$purchase = app()->envatoapi->verifyPurchase($licenseKey);
36
+		if (is_array($purchase) and $purchase['status'] == 'success') {
37
+			return true;
38
+		}
39
+		return false;
40 40
 
41
-    }
41
+	}
42 42
 }
Please login to merge, or discard this patch.
Braces   +1 added lines, -2 removed lines patch added patch discarded remove patch
@@ -17,8 +17,7 @@
 block discarded – undo
17 17
         
18 18
     	if ($this->validLicense($licenseKey)) {
19 19
         	return $next($request);
20
-    	}
21
-    	else {
20
+    	} else {
22 21
     		return response()->json(['UnAuthorized' => 'Invalid Purchase Key'], 403);
23 22
     	}
24 23
 
Please login to merge, or discard this patch.