Completed
Push — master ( f30158...bfbb50 )
by Sherif
02:18
created
Modules/PushNotificationDevices/Services/PushNotificationDeviceService.php 1 patch
Indentation   +52 added lines, -52 removed lines patch added patch discarded remove patch
@@ -10,63 +10,63 @@
 block discarded – undo
10 10
 
11 11
 class PushNotificationDeviceService extends BaseService
12 12
 {
13
-    /**
14
-     * Init new object.
15
-     *
16
-     * @param   PushNotificationDeviceRepository $repo
17
-     * @return  void
18
-     */
19
-    public function __construct(PushNotificationDeviceRepository $repo)
20
-    {
21
-        parent::__construct($repo);
22
-    }
13
+	/**
14
+	 * Init new object.
15
+	 *
16
+	 * @param   PushNotificationDeviceRepository $repo
17
+	 * @return  void
18
+	 */
19
+	public function __construct(PushNotificationDeviceRepository $repo)
20
+	{
21
+		parent::__construct($repo);
22
+	}
23 23
 
24
-    /**
25
-     * Register the given device to the logged in user.
26
-     *
27
-     * @param  array $data
28
-     * @return void
29
-     */
30
-    public function registerDevice($data)
31
-    {
32
-        $data['access_token'] = \Auth::user()->token();
33
-        $data['user_id']      = \Auth::id();
34
-        $device               = $this->repo->first([
35
-            'and' => [
36
-                'device_token' => $data['device_token'],
37
-                'user_id' => $data['user_id']
38
-                ]
39
-            ]);
24
+	/**
25
+	 * Register the given device to the logged in user.
26
+	 *
27
+	 * @param  array $data
28
+	 * @return void
29
+	 */
30
+	public function registerDevice($data)
31
+	{
32
+		$data['access_token'] = \Auth::user()->token();
33
+		$data['user_id']      = \Auth::id();
34
+		$device               = $this->repo->first([
35
+			'and' => [
36
+				'device_token' => $data['device_token'],
37
+				'user_id' => $data['user_id']
38
+				]
39
+			]);
40 40
 
41
-        if ($device) {
42
-            $data['id'] = $device->id;
43
-        }
41
+		if ($device) {
42
+			$data['id'] = $device->id;
43
+		}
44 44
 
45
-        return $this->repo->save($data);
46
-    }
45
+		return $this->repo->save($data);
46
+	}
47 47
 
48
-    /**
49
-     * Generate the given message data.
50
-     *
51
-     * @param  string $title
52
-     * @param  string $message
53
-     * @param  array  $data
54
-     * @return void
55
-     */
56
-    public function generateMessageData($title, $message, $data = [])
57
-    {
58
-        $optionBuilder       = new OptionsBuilder();
59
-        $notificationBuilder = new PayloadNotificationBuilder($title);
60
-        $dataBuilder         = new PayloadDataBuilder();
48
+	/**
49
+	 * Generate the given message data.
50
+	 *
51
+	 * @param  string $title
52
+	 * @param  string $message
53
+	 * @param  array  $data
54
+	 * @return void
55
+	 */
56
+	public function generateMessageData($title, $message, $data = [])
57
+	{
58
+		$optionBuilder       = new OptionsBuilder();
59
+		$notificationBuilder = new PayloadNotificationBuilder($title);
60
+		$dataBuilder         = new PayloadDataBuilder();
61 61
 
62
-        $optionBuilder->setTimeToLive(60 * 20);
63
-        $notificationBuilder->setBody($message);
64
-        $dataBuilder->addData($data);
62
+		$optionBuilder->setTimeToLive(60 * 20);
63
+		$notificationBuilder->setBody($message);
64
+		$dataBuilder->addData($data);
65 65
 
66
-        $options             = $optionBuilder->build();
67
-        $notification        = $notificationBuilder->build();
68
-        $data                = $dataBuilder->build();
66
+		$options             = $optionBuilder->build();
67
+		$notification        = $notificationBuilder->build();
68
+		$data                = $dataBuilder->build();
69 69
 
70
-        return compact('options', 'notification', 'data');
71
-    }
70
+		return compact('options', 'notification', 'data');
71
+	}
72 72
 }
Please login to merge, or discard this patch.
src/Modules/Core/Resources/Lang/en/errors.php 1 patch
Indentation   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -2,14 +2,14 @@
 block discarded – undo
2 2
 
3 3
 return [
4 4
     
5
-    /**
6
-     * Here goes your error messages.
7
-     */
8
-    'connectionError'         => 'Connection error',
9
-    'redisNotRunning'         => 'Your redis notification server is\'t running',
10
-    'dbQueryError'            => 'Please check the given inputes',
11
-    'cannotCreateSetting'     => 'Can\'t create setting',
12
-    'cannotUpdateSettingKey'  => 'Can\'t update setting key',
13
-    'notFound'                => 'The requested :replace not found'
5
+	/**
6
+	 * Here goes your error messages.
7
+	 */
8
+	'connectionError'         => 'Connection error',
9
+	'redisNotRunning'         => 'Your redis notification server is\'t running',
10
+	'dbQueryError'            => 'Please check the given inputes',
11
+	'cannotCreateSetting'     => 'Can\'t create setting',
12
+	'cannotUpdateSettingKey'  => 'Can\'t update setting key',
13
+	'notFound'                => 'The requested :replace not found'
14 14
 
15 15
 ];
Please login to merge, or discard this patch.
src/Modules/Core/Resources/Lang/ar/errors.php 1 patch
Indentation   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -2,14 +2,14 @@
 block discarded – undo
2 2
 
3 3
 return [
4 4
     
5
-    /**
6
-     * Here goes your error messages.
7
-     */
8
-    'connectionError'         => 'خطأ في الاتصال',
9
-    'redisNotRunning'         => 'سيرفير الاشعارات لايعمل',
10
-    'dbQueryError'            => 'خطا في البيانات',
11
-    'cannotCreateSetting'     => 'لا يمكن اضافة اعدادات',
12
-    'cannotUpdateSettingKey'  => 'لا يمكن تعديل اعدادات',
13
-    'notFound'                => 'ال :replace المطلوب غير موجود'
5
+	/**
6
+	 * Here goes your error messages.
7
+	 */
8
+	'connectionError'         => 'خطأ في الاتصال',
9
+	'redisNotRunning'         => 'سيرفير الاشعارات لايعمل',
10
+	'dbQueryError'            => 'خطا في البيانات',
11
+	'cannotCreateSetting'     => 'لا يمكن اضافة اعدادات',
12
+	'cannotUpdateSettingKey'  => 'لا يمكن تعديل اعدادات',
13
+	'notFound'                => 'ال :replace المطلوب غير موجود'
14 14
 
15 15
 ];
Please login to merge, or discard this patch.
src/Modules/Core/Facades/Errors.php 1 patch
Indentation   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -4,8 +4,8 @@
 block discarded – undo
4 4
 
5 5
 class Errors extends Facade
6 6
 {
7
-    protected static function getFacadeAccessor()
8
-    {
9
-        return 'Errors';
10
-    }
7
+	protected static function getFacadeAccessor()
8
+	{
9
+		return 'Errors';
10
+	}
11 11
 }
Please login to merge, or discard this patch.
src/Modules/Core/Providers/ModuleServiceProvider.php 2 patches
Indentation   +48 added lines, -48 removed lines patch added patch discarded remove patch
@@ -6,53 +6,53 @@
 block discarded – undo
6 6
 
7 7
 class ModuleServiceProvider extends ServiceProvider
8 8
 {
9
-    /**
10
-     * Bootstrap the module services.
11
-     *
12
-     * @return void
13
-     */
14
-    public function boot()
15
-    {
16
-        $this->loadTranslationsFrom(__DIR__.'/../Resources/Lang', 'core');
17
-        $this->loadViewsFrom(__DIR__.'/../Resources/Views', 'core');
18
-
19
-        $this->loadMigrationsFrom(module_path('core', 'Database/Migrations', 'app'));
20
-        $this->loadFactoriesFrom(module_path('core', 'Database/Factories', 'app'));
21
-    }
22
-
23
-    /**
24
-     * Register the module services.
25
-     *
26
-     * @return void
27
-     */
28
-    public function register()
29
-    {
30
-        //Bind Core Facade to the Service Container
31
-        $this->app->singleton('Core', function () {
32
-            return new \App\Modules\Core\Core;
33
-        });
34
-
35
-        //Bind Errors Facade to the Service Container
36
-        $this->app->singleton('Errors', function () {
37
-            return new \App\Modules\Core\Errors\Errors;
38
-        });
39
-
40
-        //Bind CoreConfig Facade to the Service Container
41
-        $this->app->singleton('CoreConfig', function () {
42
-            return new \App\Modules\Core\Utl\CoreConfig;
43
-        });
44
-
45
-        //Bind Media Facade to the Service Container
46
-        $this->app->singleton('Media', function () {
47
-            return new \App\Modules\Core\Utl\Media;
48
-        });
49
-
50
-        //Bind ApiConsumer Facade to the Service Container
51
-        $this->app->singleton('ApiConsumer', function () {
52
-            $app = app();
53
-            return new \App\Modules\Core\Utl\ApiConsumer($app, $app['request'], $app['router']);
54
-        });
9
+	/**
10
+	 * Bootstrap the module services.
11
+	 *
12
+	 * @return void
13
+	 */
14
+	public function boot()
15
+	{
16
+		$this->loadTranslationsFrom(__DIR__.'/../Resources/Lang', 'core');
17
+		$this->loadViewsFrom(__DIR__.'/../Resources/Views', 'core');
18
+
19
+		$this->loadMigrationsFrom(module_path('core', 'Database/Migrations', 'app'));
20
+		$this->loadFactoriesFrom(module_path('core', 'Database/Factories', 'app'));
21
+	}
22
+
23
+	/**
24
+	 * Register the module services.
25
+	 *
26
+	 * @return void
27
+	 */
28
+	public function register()
29
+	{
30
+		//Bind Core Facade to the Service Container
31
+		$this->app->singleton('Core', function () {
32
+			return new \App\Modules\Core\Core;
33
+		});
34
+
35
+		//Bind Errors Facade to the Service Container
36
+		$this->app->singleton('Errors', function () {
37
+			return new \App\Modules\Core\Errors\Errors;
38
+		});
39
+
40
+		//Bind CoreConfig Facade to the Service Container
41
+		$this->app->singleton('CoreConfig', function () {
42
+			return new \App\Modules\Core\Utl\CoreConfig;
43
+		});
44
+
45
+		//Bind Media Facade to the Service Container
46
+		$this->app->singleton('Media', function () {
47
+			return new \App\Modules\Core\Utl\Media;
48
+		});
49
+
50
+		//Bind ApiConsumer Facade to the Service Container
51
+		$this->app->singleton('ApiConsumer', function () {
52
+			$app = app();
53
+			return new \App\Modules\Core\Utl\ApiConsumer($app, $app['request'], $app['router']);
54
+		});
55 55
         
56
-        $this->app->register(RouteServiceProvider::class);
57
-    }
56
+		$this->app->register(RouteServiceProvider::class);
57
+	}
58 58
 }
Please login to merge, or discard this patch.
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -28,27 +28,27 @@
 block discarded – undo
28 28
     public function register()
29 29
     {
30 30
         //Bind Core Facade to the Service Container
31
-        $this->app->singleton('Core', function () {
31
+        $this->app->singleton('Core', function() {
32 32
             return new \App\Modules\Core\Core;
33 33
         });
34 34
 
35 35
         //Bind Errors Facade to the Service Container
36
-        $this->app->singleton('Errors', function () {
36
+        $this->app->singleton('Errors', function() {
37 37
             return new \App\Modules\Core\Errors\Errors;
38 38
         });
39 39
 
40 40
         //Bind CoreConfig Facade to the Service Container
41
-        $this->app->singleton('CoreConfig', function () {
41
+        $this->app->singleton('CoreConfig', function() {
42 42
             return new \App\Modules\Core\Utl\CoreConfig;
43 43
         });
44 44
 
45 45
         //Bind Media Facade to the Service Container
46
-        $this->app->singleton('Media', function () {
46
+        $this->app->singleton('Media', function() {
47 47
             return new \App\Modules\Core\Utl\Media;
48 48
         });
49 49
 
50 50
         //Bind ApiConsumer Facade to the Service Container
51
-        $this->app->singleton('ApiConsumer', function () {
51
+        $this->app->singleton('ApiConsumer', function() {
52 52
             $app = app();
53 53
             return new \App\Modules\Core\Utl\ApiConsumer($app, $app['request'], $app['router']);
54 54
         });
Please login to merge, or discard this patch.
src/Modules/Core/Errors/CoreErrors.php 1 patch
Indentation   +24 added lines, -24 removed lines patch added patch discarded remove patch
@@ -4,33 +4,33 @@
 block discarded – undo
4 4
 
5 5
 class CoreErrors
6 6
 {
7
-    public function connectionError()
8
-    {
9
-        abort(500, trans('core::errors.connectionError'));
10
-    }
7
+	public function connectionError()
8
+	{
9
+		abort(500, trans('core::errors.connectionError'));
10
+	}
11 11
 
12
-    public function redisNotRunning()
13
-    {
14
-        abort(500, trans('core::errors.redisNotRunning'));
15
-    }
12
+	public function redisNotRunning()
13
+	{
14
+		abort(500, trans('core::errors.redisNotRunning'));
15
+	}
16 16
 
17
-    public function dbQueryError()
18
-    {
19
-        abort(500, trans('core::errors.dbQueryError'));
20
-    }
17
+	public function dbQueryError()
18
+	{
19
+		abort(500, trans('core::errors.dbQueryError'));
20
+	}
21 21
 
22
-    public function cannotCreateSetting()
23
-    {
24
-        abort(400, trans('core::errors.cannotCreateSetting'));
25
-    }
22
+	public function cannotCreateSetting()
23
+	{
24
+		abort(400, trans('core::errors.cannotCreateSetting'));
25
+	}
26 26
 
27
-    public function cannotUpdateSettingKey()
28
-    {
29
-        abort(400, trans('core::errors.cannotUpdateSettingKey'));
30
-    }
27
+	public function cannotUpdateSettingKey()
28
+	{
29
+		abort(400, trans('core::errors.cannotUpdateSettingKey'));
30
+	}
31 31
 
32
-    public function notFound($text)
33
-    {
34
-        abort(404, trans('core::errors.notFound', ['replace' => $text]));
35
-    }
32
+	public function notFound($text)
33
+	{
34
+		abort(404, trans('core::errors.notFound', ['replace' => $text]));
35
+	}
36 36
 }
Please login to merge, or discard this patch.
src/Modules/Core/Errors/Errors.php 3 patches
Indentation   +21 added lines, -21 removed lines patch added patch discarded remove patch
@@ -6,26 +6,26 @@
 block discarded – undo
6 6
 
7 7
 class Errors implements BaseFactoryInterface
8 8
 {
9
-    /**
10
-     * Construct the repository class name based on
11
-     * the method name called, search in the
12
-     * given namespaces for the class and
13
-     * return an instance.
14
-     *
15
-     * @param  string $name the called method name
16
-     * @param  array  $arguments the method arguments
17
-     * @return object
18
-     */
19
-    public function __call($name, $arguments)
20
-    {
21
-        foreach (\Module::all() as $module) {
22
-            $nameSpace = 'App\\Modules\\' . $module['basename'];
23
-            $class = $nameSpace . '\\Errors\\' . $module['basename'] . 'Errors';
9
+	/**
10
+	 * Construct the repository class name based on
11
+	 * the method name called, search in the
12
+	 * given namespaces for the class and
13
+	 * return an instance.
14
+	 *
15
+	 * @param  string $name the called method name
16
+	 * @param  array  $arguments the method arguments
17
+	 * @return object
18
+	 */
19
+	public function __call($name, $arguments)
20
+	{
21
+		foreach (\Module::all() as $module) {
22
+			$nameSpace = 'App\\Modules\\' . $module['basename'];
23
+			$class = $nameSpace . '\\Errors\\' . $module['basename'] . 'Errors';
24 24
 
25
-            if (class_exists($class)) {
26
-                $class = \App::make($class);
27
-                if (method_exists($class, $name)) return call_user_func_array([$class, $name], $arguments);
28
-            }
29
-        }
30
-    }
25
+			if (class_exists($class)) {
26
+				$class = \App::make($class);
27
+				if (method_exists($class, $name)) return call_user_func_array([$class, $name], $arguments);
28
+			}
29
+		}
30
+	}
31 31
 }
Please login to merge, or discard this patch.
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -19,8 +19,8 @@
 block discarded – undo
19 19
     public function __call($name, $arguments)
20 20
     {
21 21
         foreach (\Module::all() as $module) {
22
-            $nameSpace = 'App\\Modules\\' . $module['basename'];
23
-            $class = $nameSpace . '\\Errors\\' . $module['basename'] . 'Errors';
22
+            $nameSpace = 'App\\Modules\\'.$module['basename'];
23
+            $class = $nameSpace.'\\Errors\\'.$module['basename'].'Errors';
24 24
 
25 25
             if (class_exists($class)) {
26 26
                 $class = \App::make($class);
Please login to merge, or discard this patch.
Braces   +3 added lines, -1 removed lines patch added patch discarded remove patch
@@ -24,7 +24,9 @@
 block discarded – undo
24 24
 
25 25
             if (class_exists($class)) {
26 26
                 $class = \App::make($class);
27
-                if (method_exists($class, $name)) return call_user_func_array([$class, $name], $arguments);
27
+                if (method_exists($class, $name)) {
28
+                	return call_user_func_array([$class, $name], $arguments);
29
+                }
28 30
             }
29 31
         }
30 32
     }
Please login to merge, or discard this patch.
src/Modules/Roles/ModelObservers/RoleObserver.php 1 patch
Indentation   +56 added lines, -56 removed lines patch added patch discarded remove patch
@@ -7,69 +7,69 @@
 block discarded – undo
7 7
  */
8 8
 class RoleObserver
9 9
 {
10
-    public function saving($model)
11
-    {
12
-        //
13
-    }
10
+	public function saving($model)
11
+	{
12
+		//
13
+	}
14 14
 
15
-    public function saved($model)
16
-    {
17
-        //
18
-    }
15
+	public function saved($model)
16
+	{
17
+		//
18
+	}
19 19
 
20
-    public function creating($model)
21
-    {
22
-        //
23
-    }
20
+	public function creating($model)
21
+	{
22
+		//
23
+	}
24 24
 
25
-    public function created($model)
26
-    {
27
-        //
28
-    }
25
+	public function created($model)
26
+	{
27
+		//
28
+	}
29 29
 
30
-    /**
31
-     * Prevent updating of the admin role.
32
-     *
33
-     * @param  object $model the model beign updated.
34
-     * @return void
35
-     */
36
-    public function updating($model)
37
-    {
38
-        if ($model->getOriginal('name') == 'Admin') {
39
-            \Errors::noPermissions();
40
-        }
41
-    }
30
+	/**
31
+	 * Prevent updating of the admin role.
32
+	 *
33
+	 * @param  object $model the model beign updated.
34
+	 * @return void
35
+	 */
36
+	public function updating($model)
37
+	{
38
+		if ($model->getOriginal('name') == 'Admin') {
39
+			\Errors::noPermissions();
40
+		}
41
+	}
42 42
 
43
-    public function updated($model)
44
-    {
45
-        //
46
-    }
43
+	public function updated($model)
44
+	{
45
+		//
46
+	}
47 47
 
48
-    /**
49
-     * Prevent deleting the admin role.
50
-     *
51
-     * @param  object $model the delted model.
52
-     * @return void
53
-     */
54
-    public function deleting($model)
55
-    {
56
-        if ($model->getOriginal('name') == 'Admin') {
57
-            \Errors::noPermissions();
58
-        }
59
-    }
48
+	/**
49
+	 * Prevent deleting the admin role.
50
+	 *
51
+	 * @param  object $model the delted model.
52
+	 * @return void
53
+	 */
54
+	public function deleting($model)
55
+	{
56
+		if ($model->getOriginal('name') == 'Admin') {
57
+			\Errors::noPermissions();
58
+		}
59
+	}
60 60
 
61
-    public function deleted($model)
62
-    {
63
-        //
64
-    }
61
+	public function deleted($model)
62
+	{
63
+		//
64
+	}
65 65
 
66
-    public function restoring($model)
67
-    {
68
-        //
69
-    }
66
+	public function restoring($model)
67
+	{
68
+		//
69
+	}
70 70
 
71
-    public function restored($model)
72
-    {
73
-        //
74
-    }
71
+	public function restored($model)
72
+	{
73
+		//
74
+	}
75 75
 }
Please login to merge, or discard this patch.
src/Modules/Users/Resources/Lang/en/errors.php 1 patch
Indentation   +16 added lines, -16 removed lines patch added patch discarded remove patch
@@ -2,21 +2,21 @@
 block discarded – undo
2 2
 
3 3
 return [
4 4
     
5
-    /**
6
-     * Here goes your error messages.
7
-     */
8
-    'unAuthorized'            => 'Please login before any action',
9
-    'invalidRefreshToken'     => 'Invalid refresh token',
10
-    'noPermissions'           => 'No permissions',
11
-    'loginFailed'             => 'Wrong mail or password',
12
-    'noSocialEmail'           => 'Couldn\'t retrieve email',
13
-    'userAlreadyRegistered'   => 'User already registered. Please login using email and password',
14
-    'userIsBlocked'           => 'You have been blocked',
15
-    'invalidResetToken'       => 'Reset password token is invalid',
16
-    'invalidResetPassword'    => 'Reset password is invalid',
17
-    'invalidOldPassword'      => 'Old password is invalid',
18
-    'invalidConfirmationCode' => 'Confirmation link expired or already used',
19
-    'emailNotConfirmed'       => 'Your email isn\'t confirmed',
20
-    'emailAlreadyConfirmed'   => 'Your email is already confirmed'
5
+	/**
6
+	 * Here goes your error messages.
7
+	 */
8
+	'unAuthorized'            => 'Please login before any action',
9
+	'invalidRefreshToken'     => 'Invalid refresh token',
10
+	'noPermissions'           => 'No permissions',
11
+	'loginFailed'             => 'Wrong mail or password',
12
+	'noSocialEmail'           => 'Couldn\'t retrieve email',
13
+	'userAlreadyRegistered'   => 'User already registered. Please login using email and password',
14
+	'userIsBlocked'           => 'You have been blocked',
15
+	'invalidResetToken'       => 'Reset password token is invalid',
16
+	'invalidResetPassword'    => 'Reset password is invalid',
17
+	'invalidOldPassword'      => 'Old password is invalid',
18
+	'invalidConfirmationCode' => 'Confirmation link expired or already used',
19
+	'emailNotConfirmed'       => 'Your email isn\'t confirmed',
20
+	'emailAlreadyConfirmed'   => 'Your email is already confirmed'
21 21
 
22 22
 ];
Please login to merge, or discard this patch.