Completed
Push — master ( c7d5ad...0208a8 )
by Sherif
02:59
created
src/Modules/Acl/Http/routes.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -15,8 +15,8 @@
 block discarded – undo
15 15
 
16 16
 	$apiVersion = \Request::header('api-version') ?: 1;
17 17
 	Route::controllers([
18
-		'users'       => class_exists('V' . $apiVersion . '\UsersController') ? 'V' . $apiVersion . '\UsersController' : 'V1\UsersController',
19
-		'groups'      => 'V' . $apiVersion . '\GroupsController',
20
-		'permissions' => 'V' . $apiVersion . '\PermissionsController'
18
+		'users'       => class_exists('V'.$apiVersion.'\UsersController') ? 'V'.$apiVersion.'\UsersController' : 'V1\UsersController',
19
+		'groups'      => 'V'.$apiVersion.'\GroupsController',
20
+		'permissions' => 'V'.$apiVersion.'\PermissionsController'
21 21
 		]);
22 22
 });
23 23
\ No newline at end of file
Please login to merge, or discard this patch.
src/Modules/Core/AbstractRepositories/AbstractRepositoryContainer.php 2 patches
Indentation   +29 added lines, -29 removed lines patch added patch discarded remove patch
@@ -4,35 +4,35 @@
 block discarded – undo
4 4
 
5 5
 abstract class AbstractRepositoryContainer implements RepositoryContainerInterface
6 6
 {
7
-    /**
8
-     * Construct the repository class name based on
9
-     * the method name called, search in the 
10
-     * given namespaces for the class and 
11
-     * return an instance.
12
-     * 
13
-     * @param  string $name the called method name
14
-     * @param  array  $arguments the method arguments
15
-     * @return object
16
-     */
7
+	/**
8
+	 * Construct the repository class name based on
9
+	 * the method name called, search in the 
10
+	 * given namespaces for the class and 
11
+	 * return an instance.
12
+	 * 
13
+	 * @param  string $name the called method name
14
+	 * @param  array  $arguments the method arguments
15
+	 * @return object
16
+	 */
17 17
 	public function __call($name, $arguments)
18
-    {
19
-    	foreach ($this->getRepoNameSpace() as $repoNameSpace) 
20
-    	{
21
-            $apiVersion = \Request::header('api-version') ?: 1;
22
-            $class      = rtrim($repoNameSpace, '\\') . '\\V' . $apiVersion .'\\' . ucfirst(str_singular($name)) . 'Repository';
23
-    		if (class_exists($class)) 
24
-    		{
25
-        		return \App::make($class);
26
-    		}
27
-    	}
28
-    }
18
+	{
19
+		foreach ($this->getRepoNameSpace() as $repoNameSpace) 
20
+		{
21
+			$apiVersion = \Request::header('api-version') ?: 1;
22
+			$class      = rtrim($repoNameSpace, '\\') . '\\V' . $apiVersion .'\\' . ucfirst(str_singular($name)) . 'Repository';
23
+			if (class_exists($class)) 
24
+			{
25
+				return \App::make($class);
26
+			}
27
+		}
28
+	}
29 29
 
30
-     /**
31
-     * Abstract methods that return the necessary 
32
-     * information (repositories namespaces)
33
-     * needed to preform the previous actions.
34
-     * 
35
-     * @return array
36
-     */
37
-    abstract protected function getRepoNameSpace();
30
+	 /**
31
+	  * Abstract methods that return the necessary 
32
+	  * information (repositories namespaces)
33
+	  * needed to preform the previous actions.
34
+	  * 
35
+	  * @return array
36
+	  */
37
+	abstract protected function getRepoNameSpace();
38 38
 }
39 39
\ No newline at end of file
Please login to merge, or discard this patch.
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -19,7 +19,7 @@
 block discarded – undo
19 19
     	foreach ($this->getRepoNameSpace() as $repoNameSpace) 
20 20
     	{
21 21
             $apiVersion = \Request::header('api-version') ?: 1;
22
-            $class      = rtrim($repoNameSpace, '\\') . '\\V' . $apiVersion .'\\' . ucfirst(str_singular($name)) . 'Repository';
22
+            $class      = rtrim($repoNameSpace, '\\').'\\V'.$apiVersion.'\\'.ucfirst(str_singular($name)).'Repository';
23 23
     		if (class_exists($class)) 
24 24
     		{
25 25
         		return \App::make($class);
Please login to merge, or discard this patch.
src/Modules/Core/Http/routes.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -15,6 +15,6 @@
 block discarded – undo
15 15
 	
16 16
 	$apiVersion = \Request::header('api-version') ?: 1;
17 17
 	Route::controllers([
18
-		'settings' => 'V' . $apiVersion . '\SettingsController'
18
+		'settings' => 'V'.$apiVersion.'\SettingsController'
19 19
 		]);
20 20
 });
21 21
\ No newline at end of file
Please login to merge, or discard this patch.
src/Modules/Logging/Http/routes.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -15,6 +15,6 @@
 block discarded – undo
15 15
 	
16 16
 	$apiVersion = \Request::header('api-version') ?: 1;
17 17
 	Route::controllers([
18
-		'logs' => 'V' . $apiVersion . '\LogsController',
18
+		'logs' => 'V'.$apiVersion.'\LogsController',
19 19
 		]);
20 20
 });
21 21
\ No newline at end of file
Please login to merge, or discard this patch.
src/Modules/Reporting/Database/Migrations/2016_01_24_123631_initialize.php 1 patch
Indentation   +61 added lines, -61 removed lines patch added patch discarded remove patch
@@ -12,71 +12,71 @@
 block discarded – undo
12 12
 	 */
13 13
 	public function up()
14 14
 	{
15
-        /**
16
-         * Delete previous permissions.
17
-         */
15
+		/**
16
+		 * Delete previous permissions.
17
+		 */
18 18
 		DB::table('permissions')->whereIn('model', ['reports'])->delete();
19 19
 
20 20
 		/**
21
-         * Insert the permissions related to this module.
22
-         */
23
-        DB::table('permissions')->insert(
24
-        	[
25
-        		/**
26
-        		 * Reporting model permissions.
27
-        		 */
28
-	        	[
29
-	        	'name'       => 'find',
30
-	        	'model'      => 'reports',
31
-	        	'created_at' => \DB::raw('NOW()'),
32
-	        	'updated_at' => \DB::raw('NOW()')
33
-	        	],
34
-	        	[
35
-	        	'name'       => 'search',
36
-	        	'model'      => 'reports',
37
-	        	'created_at' => \DB::raw('NOW()'),
38
-	        	'updated_at' => \DB::raw('NOW()')
39
-	        	],
40
-	        	[
41
-	        	'name'       => 'list',
42
-	        	'model'      => 'reports',
43
-	        	'created_at' => \DB::raw('NOW()'),
44
-	        	'updated_at' => \DB::raw('NOW()')
45
-	        	],
46
-	        	[
47
-	        	'name'       => 'findby',
48
-	        	'model'      => 'reports',
49
-	        	'created_at' => \DB::raw('NOW()'),
50
-	        	'updated_at' => \DB::raw('NOW()')
51
-	        	],
52
-	        	[
53
-	        	'name'       => 'first',
54
-	        	'model'      => 'reports',
55
-	        	'created_at' => \DB::raw('NOW()'),
56
-	        	'updated_at' => \DB::raw('NOW()')
57
-	        	],
58
-	        	[
59
-	        	'name'       => 'paginate',
60
-	        	'model'      => 'reports',
61
-	        	'created_at' => \DB::raw('NOW()'),
62
-	        	'updated_at' => \DB::raw('NOW()')
63
-	        	],
64
-	        	[
65
-	        	'name'       => 'paginateby',
66
-	        	'model'      => 'reports',
67
-	        	'created_at' => \DB::raw('NOW()'),
68
-	        	'updated_at' => \DB::raw('NOW()')
69
-	        	],
70
-	        	[
71
-	        	'name'       => 'admin_count',
72
-	        	'model'      => 'reports',
73
-	        	'created_at' => \DB::raw('NOW()'),
74
-	        	'updated_at' => \DB::raw('NOW()')
75
-	        	]
76
-        	]
77
-        );
21
+		 * Insert the permissions related to this module.
22
+		 */
23
+		DB::table('permissions')->insert(
24
+			[
25
+				/**
26
+				 * Reporting model permissions.
27
+				 */
28
+				[
29
+				'name'       => 'find',
30
+				'model'      => 'reports',
31
+				'created_at' => \DB::raw('NOW()'),
32
+				'updated_at' => \DB::raw('NOW()')
33
+				],
34
+				[
35
+				'name'       => 'search',
36
+				'model'      => 'reports',
37
+				'created_at' => \DB::raw('NOW()'),
38
+				'updated_at' => \DB::raw('NOW()')
39
+				],
40
+				[
41
+				'name'       => 'list',
42
+				'model'      => 'reports',
43
+				'created_at' => \DB::raw('NOW()'),
44
+				'updated_at' => \DB::raw('NOW()')
45
+				],
46
+				[
47
+				'name'       => 'findby',
48
+				'model'      => 'reports',
49
+				'created_at' => \DB::raw('NOW()'),
50
+				'updated_at' => \DB::raw('NOW()')
51
+				],
52
+				[
53
+				'name'       => 'first',
54
+				'model'      => 'reports',
55
+				'created_at' => \DB::raw('NOW()'),
56
+				'updated_at' => \DB::raw('NOW()')
57
+				],
58
+				[
59
+				'name'       => 'paginate',
60
+				'model'      => 'reports',
61
+				'created_at' => \DB::raw('NOW()'),
62
+				'updated_at' => \DB::raw('NOW()')
63
+				],
64
+				[
65
+				'name'       => 'paginateby',
66
+				'model'      => 'reports',
67
+				'created_at' => \DB::raw('NOW()'),
68
+				'updated_at' => \DB::raw('NOW()')
69
+				],
70
+				[
71
+				'name'       => 'admin_count',
72
+				'model'      => 'reports',
73
+				'created_at' => \DB::raw('NOW()'),
74
+				'updated_at' => \DB::raw('NOW()')
75
+				]
76
+			]
77
+		);
78 78
 
79
-        /**
79
+		/**
80 80
 		 * Assign the permissions to the admin group.
81 81
 		 */
82 82
 		$permissionIds = DB::table('permissions')->whereIn('model', ['reports'])->select('id')->lists('id');
Please login to merge, or discard this patch.
src/Modules/Reporting/Repositories/V1/ReportRepository.php 1 patch
Indentation   +35 added lines, -35 removed lines patch added patch discarded remove patch
@@ -11,60 +11,60 @@
 block discarded – undo
11 11
 	 */
12 12
 	protected function getModel()
13 13
 	{
14
-        $apiVersion = \Request::header('api-version') ?: 1;
14
+		$apiVersion = \Request::header('api-version') ?: 1;
15 15
 		return 'App\Modules\Reporting\Report';
16 16
 	}
17 17
 
18 18
 	/**
19
-     * Render the given report db view.
20
-     * 
21
-     * @param  integer $id
22
-     * @param  array   $relations
23
-     * @param  array   $columns
24
-     * @return object
25
-     */
26
-    public function find($id, $relations = [], $columns = array('*'))
27
-    {
19
+	 * Render the given report db view.
20
+	 * 
21
+	 * @param  integer $id
22
+	 * @param  array   $relations
23
+	 * @param  array   $columns
24
+	 * @return object
25
+	 */
26
+	public function find($id, $relations = [], $columns = array('*'))
27
+	{
28 28
 		$report = call_user_func_array("{$this->getModel()}::with", array($relations))->find($id, $columns);
29 29
 
30
-        if ( ! \Core::users()->can($report->view_name, 'reports'))
31
-        {
32
-            $error = $this->errorHandler->noPermissions();
33
-            abort($error['status'], $error['message']);
34
-        }
30
+		if ( ! \Core::users()->can($report->view_name, 'reports'))
31
+		{
32
+			$error = $this->errorHandler->noPermissions();
33
+			abort($error['status'], $error['message']);
34
+		}
35 35
 
36 36
 		if ( ! $report) 
37 37
 		{
38 38
 			$error = $this->errorHandler->notFound('report');
39 39
 			abort($error['status'], $error['message']);
40 40
 		}
41
-        return \DB::table($report->view_name)->get();
42
-    }
41
+		return \DB::table($report->view_name)->get();
42
+	}
43 43
 
44
-    /**
45
-     * Render the given report db view based on the given
46
-     * condition.
47
-     *
48
-     * @param  array   $conditions array of conditions
49
-     * @param  array   $relations
50
-     * @param  array   $colunmns
51
-     * @return object
52
-     */
53
-    public function first($conditions, $relations = [], $columns = array('*'))
54
-    {
44
+	/**
45
+	 * Render the given report db view based on the given
46
+	 * condition.
47
+	 *
48
+	 * @param  array   $conditions array of conditions
49
+	 * @param  array   $relations
50
+	 * @param  array   $colunmns
51
+	 * @return object
52
+	 */
53
+	public function first($conditions, $relations = [], $columns = array('*'))
54
+	{
55 55
 		$conditions = $this->constructConditions($conditions);
56 56
 		$report     = call_user_func_array("{$this->getModel()}::with", array($relations))->whereRaw($conditions['conditionString'], $conditions['conditionValues'])->first($columns);
57 57
         
58
-        if ( ! \Core::users()->can($report->view_name, 'reports'))
59
-        {
60
-            $error = $this->errorHandler->noPermissions();
61
-            abort($error['status'], $error['message']);
62
-        }
58
+		if ( ! \Core::users()->can($report->view_name, 'reports'))
59
+		{
60
+			$error = $this->errorHandler->noPermissions();
61
+			abort($error['status'], $error['message']);
62
+		}
63 63
 		if ( ! $report) 
64 64
 		{
65 65
 			$error = $this->errorHandler->notFound('report');
66 66
 			abort($error['status'], $error['message']);
67 67
 		}
68
-        return \DB::table($report->view_name)->get();  
69
-    }
68
+		return \DB::table($report->view_name)->get();  
69
+	}
70 70
 }
Please login to merge, or discard this patch.
src/Modules/Reporting/Http/routes.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -15,6 +15,6 @@
 block discarded – undo
15 15
 	
16 16
 	$apiVersion = \Request::header('api-version') ?: 1;
17 17
 	Route::controllers([
18
-		'reports' => 'V' . $apiVersion . '\ReportingController',
18
+		'reports' => 'V'.$apiVersion.'\ReportingController',
19 19
 		]);
20 20
 });
21 21
\ No newline at end of file
Please login to merge, or discard this patch.
src/Modules/Notifications/Repositories/V1/NotificationRepository.php 1 patch
Indentation   +19 added lines, -19 removed lines patch added patch discarded remove patch
@@ -11,28 +11,28 @@
 block discarded – undo
11 11
 	 */
12 12
 	protected function getModel()
13 13
 	{
14
-        $apiVersion = \Request::header('api-version') ?: 1;
14
+		$apiVersion = \Request::header('api-version') ?: 1;
15 15
 		return 'App\Modules\Notifications\Notification';
16 16
 	}
17 17
 
18 18
 	/**
19
-     * Set the notification notified to true.
20
-     * 
21
-     * @param  integer  $id
22
-     * @return object
23
-     */
24
-    public function notified($id)
25
-    {
26
-        return $this->save(['id' => $id, 'notified' => 1]);
27
-    }
19
+	 * Set the notification notified to true.
20
+	 * 
21
+	 * @param  integer  $id
22
+	 * @return object
23
+	 */
24
+	public function notified($id)
25
+	{
26
+		return $this->save(['id' => $id, 'notified' => 1]);
27
+	}
28 28
 
29
-    /**
30
-     * Set the notification notified to all.
31
-     * 
32
-     * @return void
33
-     */
34
-    public function notifyAll()
35
-    {
36
-        \Core::notifications()->update(false, ['notified' => 1], 'notified');
37
-    }
29
+	/**
30
+	 * Set the notification notified to all.
31
+	 * 
32
+	 * @return void
33
+	 */
34
+	public function notifyAll()
35
+	{
36
+		\Core::notifications()->update(false, ['notified' => 1], 'notified');
37
+	}
38 38
 }
Please login to merge, or discard this patch.
src/Modules/Notifications/Http/routes.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -15,6 +15,6 @@
 block discarded – undo
15 15
 	
16 16
 	$apiVersion = \Request::header('api-version') ?: 1;
17 17
 	Route::controllers([
18
-		'notifications' => 'V' . $apiVersion . '\NotificationsController',
18
+		'notifications' => 'V'.$apiVersion.'\NotificationsController',
19 19
 		]);
20 20
 });
21 21
\ No newline at end of file
Please login to merge, or discard this patch.