Completed
Push — master ( f200ef...bd47c4 )
by
unknown
03:00
created
src/Main.php 4 patches
Doc Comments   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -47,7 +47,7 @@  discard block
 block discarded – undo
47 47
 	/**
48 48
 	 * Setter for $statusCode
49 49
 	 * @param integer $statusCode
50
-	 * @return App\Htpp\Responds\Respond
50
+	 * @return Main
51 51
 	 * @author Shima Payro <[email protected]>
52 52
 	 * @since May 2, 2016 9:47:04 AM
53 53
 	 * @uses
@@ -77,7 +77,7 @@  discard block
 block discarded – undo
77 77
 	/**
78 78
 	 * Setter for $statusText
79 79
 	 * @param String $statusText
80
-	 * @return App\HtppApp\Htpp\Responds\Respond
80
+	 * @return Main
81 81
 	 * @author Shima Payro <[email protected]>
82 82
 	 * @since May 2, 2016 9:48:23 AM
83 83
 	 * @uses
@@ -140,7 +140,7 @@  discard block
 block discarded – undo
140 140
 	 * @author Mehdi Hosseini <[email protected]>
141 141
 	 * @since August 24, 2016
142 142
 	 * @param $errorCode integer
143
-	 * @return instance
143
+	 * @return Main
144 144
 	 */
145 145
 	public function setErrorCode( $errorCode ) {
146 146
 
Please login to merge, or discard this patch.
Indentation   +170 added lines, -170 removed lines patch added patch discarded remove patch
@@ -6,198 +6,198 @@
 block discarded – undo
6 6
 
7 7
 class Main {
8 8
 
9
-	/**
10
-	 * Http status code
11
-	 * @var integer
12
-	 */
13
-	protected $statusCode = 200;
14
-
15
-	/**
16
-	 * Status text
17
-	 * @var string
18
-	 */
19
-	protected $statusText = 'success';
20
-
21
-	/**
22
-	 * Error code, message and text-key
23
-	 * @var array
24
-	 */
25
-	protected $error;
26
-
27
-	/**
28
-	 * Error code
29
-	 * @var integer
30
-	 */
31
-	 protected $errorCode;
32
-
33
-
34
-	/**
35
-	 * Getter for $statusCode
36
-	 * @author Shima Payro <[email protected]>
37
-	 * @since May 2, 2016 9:46:27 AM
38
-	 * @uses
39
-	 * @see
40
-	 */
41
-	public function getStatusCode() {
42
-
43
-		return $this->statusCode;
44
-
45
-	}
46
-
47
-	/**
48
-	 * Setter for $statusCode
49
-	 * @param integer $statusCode
50
-	 * @return App\Htpp\Responds\Respond
51
-	 * @author Shima Payro <[email protected]>
52
-	 * @since May 2, 2016 9:47:04 AM
53
-	 * @uses
54
-	 * @see
55
-	 */
56
-	public function setStatusCode( $statusCode ) {
57
-
58
-		$this->statusCode = $statusCode;
59
-
60
-		return $this;
61
-
62
-	}
63
-
64
-	/**
65
-	 * Getter for $statusText
66
-	 * @author Shima Payro <[email protected]>
67
-	 * @since May 2, 2016 9:47:36 AM
68
-	 * @uses
69
-	 * @see
70
-	 */
71
-	public function getStatusText() {
72
-
73
-		return $this->statusText;
74
-
75
-	}
76
-
77
-	/**
78
-	 * Setter for $statusText
79
-	 * @param String $statusText
80
-	 * @return App\HtppApp\Htpp\Responds\Respond
81
-	 * @author Shima Payro <[email protected]>
82
-	 * @since May 2, 2016 9:48:23 AM
83
-	 * @uses
84
-	 * @see
85
-	 */
86
-	public function setStatusText( $statusText ) {
87
-
88
-		$this->statusText = $statusText;
89
-
90
-		return $this;
91
-
92
-	}
93
-
94
-	/**
95
-	 * Response
96
-	 * @param json $data
97
-	 * @return jsom
98
-	 * @author Shima Payro <[email protected]>
99
-	 * @since May 2, 2016 9:48:45 AM
100
-	 * @uses
101
-	 * @see
102
-	 */
103
-	public function respond( $data ) {
104
-
105
-		return response()->json( $data, $this->getStatusCode() );
106
-
107
-	}
108
-
109
-	/**
110
-	 * Response which conteins just a message
111
-	 * @param string $message
112
-	 * @author Shima Payro <[email protected]>
113
-	 * @since May 2, 2016 9:49:21 AM
114
-	 * @return json
115
-	 * @uses
116
-	 * @see
117
-	 */
118
-	public function respondWithMessage( $message = NULL ) {
119
-
120
-		$res[ 'status' ] = $this->getStatusText();
121
-
122
-		//if it's about failure
123
-		if ( $this->getErrorCode() ) {
124
-
125
-			$res[ 'error' ] = $this->getErrorCode();
126
-			$res[ 'message' ] = $this->getErrorMessage();
9
+ /**
10
+  * Http status code
11
+  * @var integer
12
+  */
13
+ protected $statusCode = 200;
14
+
15
+ /**
16
+  * Status text
17
+  * @var string
18
+  */
19
+ protected $statusText = 'success';
20
+
21
+ /**
22
+  * Error code, message and text-key
23
+  * @var array
24
+  */
25
+ protected $error;
26
+
27
+ /**
28
+  * Error code
29
+  * @var integer
30
+  */
31
+  protected $errorCode;
32
+
33
+
34
+ /**
35
+  * Getter for $statusCode
36
+  * @author Shima Payro <[email protected]>
37
+  * @since May 2, 2016 9:46:27 AM
38
+  * @uses
39
+  * @see
40
+  */
41
+ public function getStatusCode() {
42
+
43
+  return $this->statusCode;
44
+
45
+ }
46
+
47
+ /**
48
+  * Setter for $statusCode
49
+  * @param integer $statusCode
50
+  * @return App\Htpp\Responds\Respond
51
+  * @author Shima Payro <[email protected]>
52
+  * @since May 2, 2016 9:47:04 AM
53
+  * @uses
54
+  * @see
55
+  */
56
+ public function setStatusCode( $statusCode ) {
57
+
58
+  $this->statusCode = $statusCode;
59
+
60
+  return $this;
61
+
62
+ }
63
+
64
+ /**
65
+  * Getter for $statusText
66
+  * @author Shima Payro <[email protected]>
67
+  * @since May 2, 2016 9:47:36 AM
68
+  * @uses
69
+  * @see
70
+  */
71
+ public function getStatusText() {
72
+
73
+  return $this->statusText;
74
+
75
+ }
76
+
77
+ /**
78
+  * Setter for $statusText
79
+  * @param String $statusText
80
+  * @return App\HtppApp\Htpp\Responds\Respond
81
+  * @author Shima Payro <[email protected]>
82
+  * @since May 2, 2016 9:48:23 AM
83
+  * @uses
84
+  * @see
85
+  */
86
+ public function setStatusText( $statusText ) {
87
+
88
+  $this->statusText = $statusText;
89
+
90
+  return $this;
91
+
92
+ }
93
+
94
+ /**
95
+  * Response
96
+  * @param json $data
97
+  * @return jsom
98
+  * @author Shima Payro <[email protected]>
99
+  * @since May 2, 2016 9:48:45 AM
100
+  * @uses
101
+  * @see
102
+  */
103
+ public function respond( $data ) {
104
+
105
+  return response()->json( $data, $this->getStatusCode() );
106
+
107
+ }
108
+
109
+ /**
110
+  * Response which conteins just a message
111
+  * @param string $message
112
+  * @author Shima Payro <[email protected]>
113
+  * @since May 2, 2016 9:49:21 AM
114
+  * @return json
115
+  * @uses
116
+  * @see
117
+  */
118
+ public function respondWithMessage( $message = NULL ) {
119
+
120
+  $res[ 'status' ] = $this->getStatusText();
121
+
122
+  //if it's about failure
123
+  if ( $this->getErrorCode() ) {
124
+
125
+   $res[ 'error' ] = $this->getErrorCode();
126
+   $res[ 'message' ] = $this->getErrorMessage();
127 127
 			
128
-		} else {
128
+  } else {
129 129
 
130
-			$res[ 'message' ] = $message;
130
+   $res[ 'message' ] = $message;
131 131
 
132
-		}
132
+  }
133 133
 
134
-		return $this->respond( $res );
134
+  return $this->respond( $res );
135 135
 
136
-	}
136
+ }
137 137
 
138
-	/**
139
-	 * Set error code in our result
140
-	 * @author Mehdi Hosseini <[email protected]>
141
-	 * @since August 24, 2016
142
-	 * @param $errorCode integer
143
-	 * @return instance
144
-	 */
145
-	public function setErrorCode( $errorCode ) {
138
+ /**
139
+  * Set error code in our result
140
+  * @author Mehdi Hosseini <[email protected]>
141
+  * @since August 24, 2016
142
+  * @param $errorCode integer
143
+  * @return instance
144
+  */
145
+ public function setErrorCode( $errorCode ) {
146 146
 
147
-		$this->error = config( 'errors.' . $errorCode );
147
+  $this->error = config( 'errors.' . $errorCode );
148 148
 
149
-		$this->errorCode = $errorCode;
149
+  $this->errorCode = $errorCode;
150 150
 
151
-		return $this;
151
+  return $this;
152 152
 
153
-	}
153
+ }
154 154
 
155
-	/**
156
-	 * Return Error code
157
-	 * @author Mehdi Hosseini <[email protected]>
158
-	 * @since August 24, 2016
159
-	 * @return integer
160
-	 */
161
-	public function getErrorCode() {
155
+ /**
156
+  * Return Error code
157
+  * @author Mehdi Hosseini <[email protected]>
158
+  * @since August 24, 2016
159
+  * @return integer
160
+  */
161
+ public function getErrorCode() {
162 162
 
163
-		return $this->errorCode;
163
+  return $this->errorCode;
164 164
 
165
-	}
165
+ }
166 166
 
167
-	/**
168
-	 * Get error message
169
-	 * @author Mehdi Hosseini <[email protected]>
170
-	 * @since August 24, 2016
171
-	 * @return string
172
-	 */
173
-	public function getErrorMessage() {
167
+ /**
168
+  * Get error message
169
+  * @author Mehdi Hosseini <[email protected]>
170
+  * @since August 24, 2016
171
+  * @return string
172
+  */
173
+ public function getErrorMessage() {
174 174
 
175
-		return $this->error['message'];
175
+  return $this->error['message'];
176 176
 
177
-	}
177
+ }
178 178
 
179 179
 
180
-	/**
181
-	 * Response which contains status and data
182
-	 * @param json $data
183
-	 * @author Shima Payro <[email protected]>
184
-	 * @since May 2, 2016 9:50:19 AM
185
-	 * @return json
186
-	 * @uses
187
-	 * @see
188
-	 */
189
-	 public function respondWithResult( $data = NULL ) {
180
+ /**
181
+  * Response which contains status and data
182
+  * @param json $data
183
+  * @author Shima Payro <[email protected]>
184
+  * @since May 2, 2016 9:50:19 AM
185
+  * @return json
186
+  * @uses
187
+  * @see
188
+  */
189
+  public function respondWithResult( $data = NULL ) {
190 190
 
191
-		$res[ 'status' ] = $this->getStatusText();
191
+  $res[ 'status' ] = $this->getStatusText();
192 192
 
193
-		//if it's about laravel validation error
194
-		if ( $this->getErrorCode() && $this->getStatusCode() == 420 )
195
-			$res[ 'error' ] = $this->getErrorCode();
193
+  //if it's about laravel validation error
194
+  if ( $this->getErrorCode() && $this->getStatusCode() == 420 )
195
+   $res[ 'error' ] = $this->getErrorCode();
196 196
 
197
-		$res[ 'result' ] = $data;
197
+  $res[ 'result' ] = $data;
198 198
 
199
-		return $this->respond( $res );
199
+  return $this->respond( $res );
200 200
 
201
-	}
201
+ }
202 202
 
203 203
 }
Please login to merge, or discard this patch.
Spacing   +13 added lines, -13 removed lines patch added patch discarded remove patch
@@ -53,7 +53,7 @@  discard block
 block discarded – undo
53 53
 	 * @uses
54 54
 	 * @see
55 55
 	 */
56
-	public function setStatusCode( $statusCode ) {
56
+	public function setStatusCode($statusCode) {
57 57
 
58 58
 		$this->statusCode = $statusCode;
59 59
 
@@ -83,7 +83,7 @@  discard block
 block discarded – undo
83 83
 	 * @uses
84 84
 	 * @see
85 85
 	 */
86
-	public function setStatusText( $statusText ) {
86
+	public function setStatusText($statusText) {
87 87
 
88 88
 		$this->statusText = $statusText;
89 89
 
@@ -100,9 +100,9 @@  discard block
 block discarded – undo
100 100
 	 * @uses
101 101
 	 * @see
102 102
 	 */
103
-	public function respond( $data ) {
103
+	public function respond($data) {
104 104
 
105
-		return response()->json( $data, $this->getStatusCode() );
105
+		return response()->json($data, $this->getStatusCode());
106 106
 
107 107
 	}
108 108
 
@@ -115,12 +115,12 @@  discard block
 block discarded – undo
115 115
 	 * @uses
116 116
 	 * @see
117 117
 	 */
118
-	public function respondWithMessage( $message = NULL ) {
118
+	public function respondWithMessage($message = NULL) {
119 119
 
120 120
 		$res[ 'status' ] = $this->getStatusText();
121 121
 
122 122
 		//if it's about failure
123
-		if ( $this->getErrorCode() ) {
123
+		if ($this->getErrorCode()) {
124 124
 
125 125
 			$res[ 'error' ] = $this->getErrorCode();
126 126
 			$res[ 'message' ] = $this->getErrorMessage();
@@ -131,7 +131,7 @@  discard block
 block discarded – undo
131 131
 
132 132
 		}
133 133
 
134
-		return $this->respond( $res );
134
+		return $this->respond($res);
135 135
 
136 136
 	}
137 137
 
@@ -142,9 +142,9 @@  discard block
 block discarded – undo
142 142
 	 * @param $errorCode integer
143 143
 	 * @return instance
144 144
 	 */
145
-	public function setErrorCode( $errorCode ) {
145
+	public function setErrorCode($errorCode) {
146 146
 
147
-		$this->error = config( 'errors.' . $errorCode );
147
+		$this->error = config('errors.'.$errorCode);
148 148
 
149 149
 		$this->errorCode = $errorCode;
150 150
 
@@ -172,7 +172,7 @@  discard block
 block discarded – undo
172 172
 	 */
173 173
 	public function getErrorMessage() {
174 174
 
175
-		return $this->error['message'];
175
+		return $this->error[ 'message' ];
176 176
 
177 177
 	}
178 178
 
@@ -186,17 +186,17 @@  discard block
 block discarded – undo
186 186
 	 * @uses
187 187
 	 * @see
188 188
 	 */
189
-	 public function respondWithResult( $data = NULL ) {
189
+	 public function respondWithResult($data = NULL) {
190 190
 
191 191
 		$res[ 'status' ] = $this->getStatusText();
192 192
 
193 193
 		//if it's about laravel validation error
194
-		if ( $this->getErrorCode() && $this->getStatusCode() == 420 )
194
+		if ($this->getErrorCode() && $this->getStatusCode() == 420)
195 195
 			$res[ 'error' ] = $this->getErrorCode();
196 196
 
197 197
 		$res[ 'result' ] = $data;
198 198
 
199
-		return $this->respond( $res );
199
+		return $this->respond($res);
200 200
 
201 201
 	}
202 202
 
Please login to merge, or discard this patch.
Braces   +3 added lines, -2 removed lines patch added patch discarded remove patch
@@ -191,8 +191,9 @@
 block discarded – undo
191 191
 		$res[ 'status' ] = $this->getStatusText();
192 192
 
193 193
 		//if it's about laravel validation error
194
-		if ( $this->getErrorCode() && $this->getStatusCode() == 420 )
195
-			$res[ 'error' ] = $this->getErrorCode();
194
+		if ( $this->getErrorCode() && $this->getStatusCode() == 420 ) {
195
+					$res[ 'error' ] = $this->getErrorCode();
196
+		}
196 197
 
197 198
 		$res[ 'result' ] = $data;
198 199
 
Please login to merge, or discard this patch.
src/Messages.php 3 patches
Doc Comments   -8 removed lines patch added patch discarded remove patch
@@ -72,7 +72,6 @@  discard block
 block discarded – undo
72 72
 	/**
73 73
 	 * Delete action is faild
74 74
 	 * @author Shima Payro <[email protected]>
75
-	 * @param String $message
76 75
 	 * @since May 2, 2016 9:53:53 AM
77 76
 	 * @uses
78 77
 	 * @see
@@ -89,7 +88,6 @@  discard block
 block discarded – undo
89 88
 	/**
90 89
 	 * Update action is succeed
91 90
 	 * @author Shima Payro <[email protected]>
92
-	 * @param String $message
93 91
 	 * @since May 2, 2016 9:54:09 AM
94 92
 	 * @uses
95 93
 	 * @see
@@ -106,7 +104,6 @@  discard block
 block discarded – undo
106 104
 	/**
107 105
 	 * Insert action is faild
108 106
 	 * @author Shima Payro <[email protected]>
109
-	 * @param String $message
110 107
 	 * @since May 2, 2016 9:54:27 AM
111 108
 	 * @uses
112 109
 	 * @see
@@ -123,7 +120,6 @@  discard block
 block discarded – undo
123 120
 	/**
124 121
 	 * Database connection is refused
125 122
 	 * @author Shima Payro <[email protected]>
126
-	 * @param String $message
127 123
 	 * @since May 2, 2016 9:54:45 AM
128 124
 	 * @uses
129 125
 	 * @see
@@ -140,7 +136,6 @@  discard block
 block discarded – undo
140 136
 	/**
141 137
 	 * page requested is not found
142 138
 	 * @author Shima Payro <[email protected]>
143
-	 * @param String $message
144 139
 	 * @since May 2, 2016 9:55:20 AM
145 140
 	 * @uses
146 141
 	 * @see
@@ -157,7 +152,6 @@  discard block
 block discarded – undo
157 152
 	/**
158 153
 	 * Wrong parameters are entered
159 154
 	 * @author Shima Payro <[email protected]>
160
-	 * @param String $message
161 155
 	 * @since May 2, 2016 9:55:20 AM
162 156
 	 * @uses
163 157
 	 * @see
@@ -174,7 +168,6 @@  discard block
 block discarded – undo
174 168
 	/**
175 169
 	 * Method is not allowed
176 170
 	 * @author Shima Payro <[email protected]>
177
-	 * @param String $message
178 171
 	 * @since May 2, 2016 9:55:20 AM
179 172
 	 * @uses
180 173
 	 * @see
@@ -208,7 +201,6 @@  discard block
 block discarded – undo
208 201
 	/**
209 202
 	 * The request field is not found
210 203
 	 * @author Shima Payro <[email protected]>
211
-	 * @param String $message
212 204
 	 * @since May 2, 2016 9:55:20 AM
213 205
 	 * @uses
214 206
 	 * @see
Please login to merge, or discard this patch.
Indentation   +247 added lines, -247 removed lines patch added patch discarded remove patch
@@ -5,253 +5,253 @@
 block discarded – undo
5 5
 class Messages extends Main
6 6
 {
7 7
 
8
-	/**
9
-	 * Request succeeded and contains json result
10
-	 * @param array $data
11
-	 * @author Shima Payro <[email protected]>
12
-	 * @since May 2, 2016 9:50:51 AM
13
-	 * @uses
14
-	 * @see
15
-	 */
16
-	public function succeed( $data ) {
17
-
18
-		return $this->setStatusCode( 200 )
19
-					->setStatusText( 'success' )
20
-					->respondWithResult( $data );
21
-
22
-	}
23
-
24
-	/**
25
-	 * Delete action is succeed
26
-	 * @author Shima Payro <[email protected]>
27
-	 * @param String $message
28
-	 * @since May 2, 2016 9:52:05 AM
29
-	 * @uses
30
-	 * @see
31
-	 */
32
-	public function deleteSucceeded( $message = 'The requested parameter is deleted successfully!' ) {
33
-
34
-		return $this->setStatusCode( 200 )
35
-					->setStatusText( 'success' )
36
-					->respondWithMessage( $message );
37
-
38
-	}
39
-
40
-	/**
41
-	 * Update action is succeed
42
-	 * @author Shima Payro <[email protected]>
43
-	 * @param String $message
44
-	 * @since May 2, 2016 9:52:52 AM
45
-	 * @uses
46
-	 * @see
47
-	 */
48
-	public function updateSucceeded( $message = 'The requested parameter is updated successfully!' ) {
49
-
50
-		return $this->setStatusCode( 200 )
51
-					->setStatusText( 'success' )
52
-					->respondWithMessage( $message );
53
-
54
-	}
55
-
56
-	/**
57
-	 * Insert action is succeed
58
-	 * @author Shima Payro <[email protected]>
59
-	 * @param String $message
60
-	 * @since May 2, 2016 9:53:26 AM
61
-	 * @uses
62
-	 * @see
63
-	 */
64
-	public function insertSucceeded( $message = 'The requested parameter is Added successfully!' ) {
65
-
66
-		return $this->setStatusCode( 200 )
67
-					->setStatusText( 'success' )
68
-					->respondWithMessage( $message );
69
-
70
-	}
71
-
72
-	/**
73
-	 * Delete action is faild
74
-	 * @author Shima Payro <[email protected]>
75
-	 * @param String $message
76
-	 * @since May 2, 2016 9:53:53 AM
77
-	 * @uses
78
-	 * @see
79
-	 */
80
-	public function deleteFaild() {
81
-
82
-		return $this->setStatusCode( 447 )
83
-					->setStatusText( 'fail' )
84
-					->setErrorCode( 5447 )
85
-					->respondWithMessage();
86
-
87
-	}
88
-
89
-	/**
90
-	 * Update action is succeed
91
-	 * @author Shima Payro <[email protected]>
92
-	 * @param String $message
93
-	 * @since May 2, 2016 9:54:09 AM
94
-	 * @uses
95
-	 * @see
96
-	 */
97
-	public function updateFaild() {
98
-
99
-		return $this->setStatusCode( 449 )
100
-					->setStatusText( 'fail' )
101
-					->setErrorCode( 5449 )
102
-					->respondWithMessage();
103
-
104
-	}
105
-
106
-	/**
107
-	 * Insert action is faild
108
-	 * @author Shima Payro <[email protected]>
109
-	 * @param String $message
110
-	 * @since May 2, 2016 9:54:27 AM
111
-	 * @uses
112
-	 * @see
113
-	 */
114
-	public function insertFaild() {
115
-
116
-		return $this->setStatusCode( 448 )
117
-					->setStatusText( 'fail' )
118
-					->setErrorCode( 5448 )
119
-					->respondWithMessage();
120
-
121
-	}
122
-
123
-	/**
124
-	 * Database connection is refused
125
-	 * @author Shima Payro <[email protected]>
126
-	 * @param String $message
127
-	 * @since May 2, 2016 9:54:45 AM
128
-	 * @uses
129
-	 * @see
130
-	 */
131
-	public function connectionRefused() {
132
-
133
-		return $this->setStatusCode( 445 )
134
-					->setStatusText( 'fail' )
135
-					->setErrorCode( 5445 )
136
-					->respondWithMessage();
137
-
138
-	}
139
-
140
-	/**
141
-	 * page requested is not found
142
-	 * @author Shima Payro <[email protected]>
143
-	 * @param String $message
144
-	 * @since May 2, 2016 9:55:20 AM
145
-	 * @uses
146
-	 * @see
147
-	 */
148
-	public function notFound() {
149
-
150
-		return $this->setStatusCode( 404 )
151
-					->setStatusText( 'fail' )
152
-					->setErrorCode( 5404 )
153
-					->respondWithMessage();
154
-
155
-	}
156
-
157
-	/**
158
-	 * Wrong parameters are entered
159
-	 * @author Shima Payro <[email protected]>
160
-	 * @param String $message
161
-	 * @since May 2, 2016 9:55:20 AM
162
-	 * @uses
163
-	 * @see
164
-	 */
165
-	public function wrongParameters() {
166
-
167
-		return $this->setStatusCode( 406 )
168
-					->setStatusText( 'fail' )
169
-					->setErrorCode( 5406 )
170
-					->respondWithMessage();
171
-
172
-	}
173
-
174
-	/**
175
-	 * Method is not allowed
176
-	 * @author Shima Payro <[email protected]>
177
-	 * @param String $message
178
-	 * @since May 2, 2016 9:55:20 AM
179
-	 * @uses
180
-	 * @see
181
-	 */
182
-	public function methodNotAllowed() {
183
-
184
-		return $this->setStatusCode( 405 )
185
-					->setStatusText( 'fail' )
186
-					->setErrorCode( 5405 )
187
-					->respondWithMessage();
188
-
189
-	}
190
-
191
-	/**
192
-	 * There ara validation errors
193
-	 * @author Shima Payro <[email protected]>
194
-	 * @param Array $data
195
-	 * @since May 2, 2016 9:55:20 AM
196
-	 * @uses
197
-	 * @see
198
-	 */
199
-	public function validationErrors( $data ) {
200
-
201
-		return $this->setStatusCode( 420 )
202
-					->setStatusText( 'fail' )
203
-					->setErrorCode( 5420 )
204
-					->respondWithResult( $data );
205
-
206
-	}
207
-
208
-	/**
209
-	 * The request field is not found
210
-	 * @author Shima Payro <[email protected]>
211
-	 * @param String $message
212
-	 * @since May 2, 2016 9:55:20 AM
213
-	 * @uses
214
-	 * @see
215
-	 */
216
-	public function requestFieldNotFound() {
217
-
218
-		return $this->setStatusCode( 446 )
219
-					->setStatusText( 'fail' )
220
-					->setErrorCode( 1001 )
221
-					->respondWithMessage();
222
-
223
-	}
224
-
225
-	/**
226
-	 * The request field is doublicated
227
-	 * @author Mehdi Hosseini <[email protected]>
228
-	 * @since August 24, 2016
229
-	 * @return json
230
-	 */
231
-	public function requestFieldDuplicated() {
232
-
233
-	  return $this->setStatusCode( 400 )
234
-					->setStatusText( 'fail' )
235
-					->SetErrorCode(1004)
236
-					->respondWithMessage();
237
-
238
-	}
239
-
240
-	/**
241
-	 * Custom error message according to error config file
242
-	 * @author Mehdi Hosseini <[email protected]>
243
-	 * @since August 24, 2016
244
-	 * @param $code integer
245
-	 * @return json
246
-	 */
247
-	public function error( $code ) {
248
-
249
-	  return $this->SetStatusCode( 400 )
250
-					->setStatusText( 'fail' )
251
-					->setErrorCode( $code )
252
-					->respondWithMessage();
253
-
254
-	}
8
+ /**
9
+  * Request succeeded and contains json result
10
+  * @param array $data
11
+  * @author Shima Payro <[email protected]>
12
+  * @since May 2, 2016 9:50:51 AM
13
+  * @uses
14
+  * @see
15
+  */
16
+ public function succeed( $data ) {
17
+
18
+  return $this->setStatusCode( 200 )
19
+     ->setStatusText( 'success' )
20
+     ->respondWithResult( $data );
21
+
22
+ }
23
+
24
+ /**
25
+  * Delete action is succeed
26
+  * @author Shima Payro <[email protected]>
27
+  * @param String $message
28
+  * @since May 2, 2016 9:52:05 AM
29
+  * @uses
30
+  * @see
31
+  */
32
+ public function deleteSucceeded( $message = 'The requested parameter is deleted successfully!' ) {
33
+
34
+  return $this->setStatusCode( 200 )
35
+     ->setStatusText( 'success' )
36
+     ->respondWithMessage( $message );
37
+
38
+ }
39
+
40
+ /**
41
+  * Update action is succeed
42
+  * @author Shima Payro <[email protected]>
43
+  * @param String $message
44
+  * @since May 2, 2016 9:52:52 AM
45
+  * @uses
46
+  * @see
47
+  */
48
+ public function updateSucceeded( $message = 'The requested parameter is updated successfully!' ) {
49
+
50
+  return $this->setStatusCode( 200 )
51
+     ->setStatusText( 'success' )
52
+     ->respondWithMessage( $message );
53
+
54
+ }
55
+
56
+ /**
57
+  * Insert action is succeed
58
+  * @author Shima Payro <[email protected]>
59
+  * @param String $message
60
+  * @since May 2, 2016 9:53:26 AM
61
+  * @uses
62
+  * @see
63
+  */
64
+ public function insertSucceeded( $message = 'The requested parameter is Added successfully!' ) {
65
+
66
+  return $this->setStatusCode( 200 )
67
+     ->setStatusText( 'success' )
68
+     ->respondWithMessage( $message );
69
+
70
+ }
71
+
72
+ /**
73
+  * Delete action is faild
74
+  * @author Shima Payro <[email protected]>
75
+  * @param String $message
76
+  * @since May 2, 2016 9:53:53 AM
77
+  * @uses
78
+  * @see
79
+  */
80
+ public function deleteFaild() {
81
+
82
+  return $this->setStatusCode( 447 )
83
+     ->setStatusText( 'fail' )
84
+     ->setErrorCode( 5447 )
85
+     ->respondWithMessage();
86
+
87
+ }
88
+
89
+ /**
90
+  * Update action is succeed
91
+  * @author Shima Payro <[email protected]>
92
+  * @param String $message
93
+  * @since May 2, 2016 9:54:09 AM
94
+  * @uses
95
+  * @see
96
+  */
97
+ public function updateFaild() {
98
+
99
+  return $this->setStatusCode( 449 )
100
+     ->setStatusText( 'fail' )
101
+     ->setErrorCode( 5449 )
102
+     ->respondWithMessage();
103
+
104
+ }
105
+
106
+ /**
107
+  * Insert action is faild
108
+  * @author Shima Payro <[email protected]>
109
+  * @param String $message
110
+  * @since May 2, 2016 9:54:27 AM
111
+  * @uses
112
+  * @see
113
+  */
114
+ public function insertFaild() {
115
+
116
+  return $this->setStatusCode( 448 )
117
+     ->setStatusText( 'fail' )
118
+     ->setErrorCode( 5448 )
119
+     ->respondWithMessage();
120
+
121
+ }
122
+
123
+ /**
124
+  * Database connection is refused
125
+  * @author Shima Payro <[email protected]>
126
+  * @param String $message
127
+  * @since May 2, 2016 9:54:45 AM
128
+  * @uses
129
+  * @see
130
+  */
131
+ public function connectionRefused() {
132
+
133
+  return $this->setStatusCode( 445 )
134
+     ->setStatusText( 'fail' )
135
+     ->setErrorCode( 5445 )
136
+     ->respondWithMessage();
137
+
138
+ }
139
+
140
+ /**
141
+  * page requested is not found
142
+  * @author Shima Payro <[email protected]>
143
+  * @param String $message
144
+  * @since May 2, 2016 9:55:20 AM
145
+  * @uses
146
+  * @see
147
+  */
148
+ public function notFound() {
149
+
150
+  return $this->setStatusCode( 404 )
151
+     ->setStatusText( 'fail' )
152
+     ->setErrorCode( 5404 )
153
+     ->respondWithMessage();
154
+
155
+ }
156
+
157
+ /**
158
+  * Wrong parameters are entered
159
+  * @author Shima Payro <[email protected]>
160
+  * @param String $message
161
+  * @since May 2, 2016 9:55:20 AM
162
+  * @uses
163
+  * @see
164
+  */
165
+ public function wrongParameters() {
166
+
167
+  return $this->setStatusCode( 406 )
168
+     ->setStatusText( 'fail' )
169
+     ->setErrorCode( 5406 )
170
+     ->respondWithMessage();
171
+
172
+ }
173
+
174
+ /**
175
+  * Method is not allowed
176
+  * @author Shima Payro <[email protected]>
177
+  * @param String $message
178
+  * @since May 2, 2016 9:55:20 AM
179
+  * @uses
180
+  * @see
181
+  */
182
+ public function methodNotAllowed() {
183
+
184
+  return $this->setStatusCode( 405 )
185
+     ->setStatusText( 'fail' )
186
+     ->setErrorCode( 5405 )
187
+     ->respondWithMessage();
188
+
189
+ }
190
+
191
+ /**
192
+  * There ara validation errors
193
+  * @author Shima Payro <[email protected]>
194
+  * @param Array $data
195
+  * @since May 2, 2016 9:55:20 AM
196
+  * @uses
197
+  * @see
198
+  */
199
+ public function validationErrors( $data ) {
200
+
201
+  return $this->setStatusCode( 420 )
202
+     ->setStatusText( 'fail' )
203
+     ->setErrorCode( 5420 )
204
+     ->respondWithResult( $data );
205
+
206
+ }
207
+
208
+ /**
209
+  * The request field is not found
210
+  * @author Shima Payro <[email protected]>
211
+  * @param String $message
212
+  * @since May 2, 2016 9:55:20 AM
213
+  * @uses
214
+  * @see
215
+  */
216
+ public function requestFieldNotFound() {
217
+
218
+  return $this->setStatusCode( 446 )
219
+     ->setStatusText( 'fail' )
220
+     ->setErrorCode( 1001 )
221
+     ->respondWithMessage();
222
+
223
+ }
224
+
225
+ /**
226
+  * The request field is doublicated
227
+  * @author Mehdi Hosseini <[email protected]>
228
+  * @since August 24, 2016
229
+  * @return json
230
+  */
231
+ public function requestFieldDuplicated() {
232
+
233
+   return $this->setStatusCode( 400 )
234
+     ->setStatusText( 'fail' )
235
+     ->SetErrorCode(1004)
236
+     ->respondWithMessage();
237
+
238
+ }
239
+
240
+ /**
241
+  * Custom error message according to error config file
242
+  * @author Mehdi Hosseini <[email protected]>
243
+  * @since August 24, 2016
244
+  * @param $code integer
245
+  * @return json
246
+  */
247
+ public function error( $code ) {
248
+
249
+   return $this->SetStatusCode( 400 )
250
+     ->setStatusText( 'fail' )
251
+     ->setErrorCode( $code )
252
+     ->respondWithMessage();
253
+
254
+ }
255 255
 
256 256
 
257 257
 }
Please login to merge, or discard this patch.
Spacing   +51 added lines, -51 removed lines patch added patch discarded remove patch
@@ -13,11 +13,11 @@  discard block
 block discarded – undo
13 13
 	 * @uses
14 14
 	 * @see
15 15
 	 */
16
-	public function succeed( $data ) {
16
+	public function succeed($data) {
17 17
 
18
-		return $this->setStatusCode( 200 )
19
-					->setStatusText( 'success' )
20
-					->respondWithResult( $data );
18
+		return $this->setStatusCode(200)
19
+					->setStatusText('success')
20
+					->respondWithResult($data);
21 21
 
22 22
 	}
23 23
 
@@ -29,11 +29,11 @@  discard block
 block discarded – undo
29 29
 	 * @uses
30 30
 	 * @see
31 31
 	 */
32
-	public function deleteSucceeded( $message = 'The requested parameter is deleted successfully!' ) {
32
+	public function deleteSucceeded($message = 'The requested parameter is deleted successfully!') {
33 33
 
34
-		return $this->setStatusCode( 200 )
35
-					->setStatusText( 'success' )
36
-					->respondWithMessage( $message );
34
+		return $this->setStatusCode(200)
35
+					->setStatusText('success')
36
+					->respondWithMessage($message);
37 37
 
38 38
 	}
39 39
 
@@ -45,11 +45,11 @@  discard block
 block discarded – undo
45 45
 	 * @uses
46 46
 	 * @see
47 47
 	 */
48
-	public function updateSucceeded( $message = 'The requested parameter is updated successfully!' ) {
48
+	public function updateSucceeded($message = 'The requested parameter is updated successfully!') {
49 49
 
50
-		return $this->setStatusCode( 200 )
51
-					->setStatusText( 'success' )
52
-					->respondWithMessage( $message );
50
+		return $this->setStatusCode(200)
51
+					->setStatusText('success')
52
+					->respondWithMessage($message);
53 53
 
54 54
 	}
55 55
 
@@ -61,11 +61,11 @@  discard block
 block discarded – undo
61 61
 	 * @uses
62 62
 	 * @see
63 63
 	 */
64
-	public function insertSucceeded( $message = 'The requested parameter is Added successfully!' ) {
64
+	public function insertSucceeded($message = 'The requested parameter is Added successfully!') {
65 65
 
66
-		return $this->setStatusCode( 200 )
67
-					->setStatusText( 'success' )
68
-					->respondWithMessage( $message );
66
+		return $this->setStatusCode(200)
67
+					->setStatusText('success')
68
+					->respondWithMessage($message);
69 69
 
70 70
 	}
71 71
 
@@ -79,9 +79,9 @@  discard block
 block discarded – undo
79 79
 	 */
80 80
 	public function deleteFaild() {
81 81
 
82
-		return $this->setStatusCode( 447 )
83
-					->setStatusText( 'fail' )
84
-					->setErrorCode( 5447 )
82
+		return $this->setStatusCode(447)
83
+					->setStatusText('fail')
84
+					->setErrorCode(5447)
85 85
 					->respondWithMessage();
86 86
 
87 87
 	}
@@ -96,9 +96,9 @@  discard block
 block discarded – undo
96 96
 	 */
97 97
 	public function updateFaild() {
98 98
 
99
-		return $this->setStatusCode( 449 )
100
-					->setStatusText( 'fail' )
101
-					->setErrorCode( 5449 )
99
+		return $this->setStatusCode(449)
100
+					->setStatusText('fail')
101
+					->setErrorCode(5449)
102 102
 					->respondWithMessage();
103 103
 
104 104
 	}
@@ -113,9 +113,9 @@  discard block
 block discarded – undo
113 113
 	 */
114 114
 	public function insertFaild() {
115 115
 
116
-		return $this->setStatusCode( 448 )
117
-					->setStatusText( 'fail' )
118
-					->setErrorCode( 5448 )
116
+		return $this->setStatusCode(448)
117
+					->setStatusText('fail')
118
+					->setErrorCode(5448)
119 119
 					->respondWithMessage();
120 120
 
121 121
 	}
@@ -130,9 +130,9 @@  discard block
 block discarded – undo
130 130
 	 */
131 131
 	public function connectionRefused() {
132 132
 
133
-		return $this->setStatusCode( 445 )
134
-					->setStatusText( 'fail' )
135
-					->setErrorCode( 5445 )
133
+		return $this->setStatusCode(445)
134
+					->setStatusText('fail')
135
+					->setErrorCode(5445)
136 136
 					->respondWithMessage();
137 137
 
138 138
 	}
@@ -147,9 +147,9 @@  discard block
 block discarded – undo
147 147
 	 */
148 148
 	public function notFound() {
149 149
 
150
-		return $this->setStatusCode( 404 )
151
-					->setStatusText( 'fail' )
152
-					->setErrorCode( 5404 )
150
+		return $this->setStatusCode(404)
151
+					->setStatusText('fail')
152
+					->setErrorCode(5404)
153 153
 					->respondWithMessage();
154 154
 
155 155
 	}
@@ -164,9 +164,9 @@  discard block
 block discarded – undo
164 164
 	 */
165 165
 	public function wrongParameters() {
166 166
 
167
-		return $this->setStatusCode( 406 )
168
-					->setStatusText( 'fail' )
169
-					->setErrorCode( 5406 )
167
+		return $this->setStatusCode(406)
168
+					->setStatusText('fail')
169
+					->setErrorCode(5406)
170 170
 					->respondWithMessage();
171 171
 
172 172
 	}
@@ -181,9 +181,9 @@  discard block
 block discarded – undo
181 181
 	 */
182 182
 	public function methodNotAllowed() {
183 183
 
184
-		return $this->setStatusCode( 405 )
185
-					->setStatusText( 'fail' )
186
-					->setErrorCode( 5405 )
184
+		return $this->setStatusCode(405)
185
+					->setStatusText('fail')
186
+					->setErrorCode(5405)
187 187
 					->respondWithMessage();
188 188
 
189 189
 	}
@@ -196,12 +196,12 @@  discard block
 block discarded – undo
196 196
 	 * @uses
197 197
 	 * @see
198 198
 	 */
199
-	public function validationErrors( $data ) {
199
+	public function validationErrors($data) {
200 200
 
201
-		return $this->setStatusCode( 420 )
202
-					->setStatusText( 'fail' )
203
-					->setErrorCode( 5420 )
204
-					->respondWithResult( $data );
201
+		return $this->setStatusCode(420)
202
+					->setStatusText('fail')
203
+					->setErrorCode(5420)
204
+					->respondWithResult($data);
205 205
 
206 206
 	}
207 207
 
@@ -215,9 +215,9 @@  discard block
 block discarded – undo
215 215
 	 */
216 216
 	public function requestFieldNotFound() {
217 217
 
218
-		return $this->setStatusCode( 446 )
219
-					->setStatusText( 'fail' )
220
-					->setErrorCode( 1001 )
218
+		return $this->setStatusCode(446)
219
+					->setStatusText('fail')
220
+					->setErrorCode(1001)
221 221
 					->respondWithMessage();
222 222
 
223 223
 	}
@@ -230,8 +230,8 @@  discard block
 block discarded – undo
230 230
 	 */
231 231
 	public function requestFieldDuplicated() {
232 232
 
233
-	  return $this->setStatusCode( 400 )
234
-					->setStatusText( 'fail' )
233
+	  return $this->setStatusCode(400)
234
+					->setStatusText('fail')
235 235
 					->SetErrorCode(1004)
236 236
 					->respondWithMessage();
237 237
 
@@ -244,11 +244,11 @@  discard block
 block discarded – undo
244 244
 	 * @param $code integer
245 245
 	 * @return json
246 246
 	 */
247
-	public function error( $code ) {
247
+	public function error($code) {
248 248
 
249
-	  return $this->SetStatusCode( 400 )
250
-					->setStatusText( 'fail' )
251
-					->setErrorCode( $code )
249
+	  return $this->SetStatusCode(400)
250
+					->setStatusText('fail')
251
+					->setErrorCode($code)
252 252
 					->respondWithMessage();
253 253
 
254 254
 	}
Please login to merge, or discard this patch.
src/config/errors.php 1 patch
Indentation   +165 added lines, -165 removed lines patch added patch discarded remove patch
@@ -2,170 +2,170 @@
 block discarded – undo
2 2
 
3 3
 return [
4 4
 
5
-	1001 => [
6
-		'message' => 'Oops... Requested field is not found!',
7
-		'type' => 'error'
8
-	],
9
-
10
-	1002 => [
11
-		'message' => 'Oops... Requested User does not exists!',
12
-		'type' => 'error'
13
-	],
14
-
15
-	1003 => [
16
-		'message' => 'Oops... Client type is not entered!',
17
-		'type' => 'error'
18
-	],
19
-
20
-	1004 => [
21
-		'message' => 'Failed because of duplicate',
22
-		'type' => 'error'
23
-	],
24
-
25
-	1005 => [
26
-		'message' => 'Failed because of dablicated user role',
27
-		'type' => 'error'
28
-	],
29
-
30
-	3001 => [
31
-		'message' => 'You are not logged on',
32
-		'type' => 'error',
33
-		'cat' => 'auth',
34
-		'short' => 'not-logged-on'
35
-	],
36
-
37
-	3002 => [
38
-		'message' => 'Application token did not generated successfully',
39
-		'type' => 'error',
40
-		'cat' => 'auth'
41
-	],
42
-
43
-	3003 =>[
44
-		'message' => 'User token did not generated successfully',
45
-		'type' => 'error',
46
-		'cat' => 'auth'
47
-	],
48
-
49
-	3004 => [
50
-		'message' => 'Request token have no agency access',
51
-		'type' => 'error',
52
-		'cat' => 'auth'
53
-	],
54
-
55
-	3005 => [
56
-		'message' => 'Request token did not contains user information',
57
-		'type' => 'error',
58
-		'cat' => 'auth'
59
-	],
60
-
61
-	3006 => [
62
-		'message' => 'Did not set request token',
63
-		'type' => 'error',
64
-		'cat' => 'auth'
65
-	],
66
-
67
-	3007 => [
68
-		'message' => 'can not decode the token',
69
-		'type' => 'error',
70
-		'cat' => 'auth'
71
-	],
72
-
73
-	3008 => [
74
-		'message' => 'can not generate token for authentication',
75
-		'type' => 'error',
76
-		'cat' => 'auth'
77
-	],
78
-
79
-	3009 => [
80
-		'message' => 'can not create token',
81
-		'type' => 'error',
82
-		'cat' => 'auth'
83
-	],
84
-
85
-	3010 => [
86
-		'message' => 'Token expired!',
87
-		'type' => 'error',
88
-		'cat' => 'auth'
89
-	],
90
-
91
-	3011 => [
92
-		'message' => 'Token is invalid!',
93
-		'type' => 'error',
94
-		'cat' => 'auth'
95
-	],
96
-
97
-	3012 => [
98
-		'message' => 'Token Blacklisted',
99
-		'type' => 'error',
100
-		'cat' => 'auth'
101
-	],
102
-
103
-	3013 => [
104
-		'message' => 'Payload invalid!',
105
-		'type' => 'error',
106
-		'cat' => 'auth'
107
-	],
108
-
109
-	3014 => [
110
-		'message' => 'Claim Invalid',
111
-		'type' => 'error',
112
-		'cat' => 'auth'
113
-	],
114
-
115
-	3015 => [
116
-		'message' => 'An error occurred on token validation',
117
-		'type' => 'error',
118
-		'cat' => 'auth'
119
-	],
120
-
121
-	5401 => [
122
-		'message' => 'Authentication unauthorized...',
123
-		'type' => 'error'
124
-	],
125
-
126
-	5404 => [
127
-		'message' => 'Oops... The requested page not found!',
128
-		'type' => 'error'
129
-	],
130
-
131
-	5405 => [
132
-		'message' => 'Oops... The method you requested is not allowed!',
133
-		'type' => 'error'
134
-	],
135
-
136
-	5406 => [
137
-		'message' => 'Oops... The parameters you entered are wrong!',
138
-		'type' => 'error'
139
-	],
140
-
141
-	5420 => [
142
-		'message' => 'Validation Error',
143
-		'type' => 'error'
144
-	],
145
-
146
-	5422 => [
147
-		'message' => 'Token is not valid',
148
-		'type' => 'error'
149
-	],
150
-
151
-	5445 => [
152
-		'message' => 'Oops... Database connection refused',
153
-		'type' => 'error'
154
-	],
155
-
156
-	5448 => [
157
-		'message' => 'Oops... Insert action was not successfully executed',
158
-		'type' => 'error'
159
-	],
160
-
161
-	5447 => [
162
-		'message' => 'Oops... Delete action was not successfully executed',
163
-		'type' => 'error'
164
-	],
165
-
166
-	5449 => [
167
-		'message' => 'Oops... Update action was not successfully executed',
168
-		'type' => 'error'
169
-	]
5
+ 1001 => [
6
+  'message' => 'Oops... Requested field is not found!',
7
+  'type' => 'error'
8
+ ],
9
+
10
+ 1002 => [
11
+  'message' => 'Oops... Requested User does not exists!',
12
+  'type' => 'error'
13
+ ],
14
+
15
+ 1003 => [
16
+  'message' => 'Oops... Client type is not entered!',
17
+  'type' => 'error'
18
+ ],
19
+
20
+ 1004 => [
21
+  'message' => 'Failed because of duplicate',
22
+  'type' => 'error'
23
+ ],
24
+
25
+ 1005 => [
26
+  'message' => 'Failed because of dablicated user role',
27
+  'type' => 'error'
28
+ ],
29
+
30
+ 3001 => [
31
+  'message' => 'You are not logged on',
32
+  'type' => 'error',
33
+  'cat' => 'auth',
34
+  'short' => 'not-logged-on'
35
+ ],
36
+
37
+ 3002 => [
38
+  'message' => 'Application token did not generated successfully',
39
+  'type' => 'error',
40
+  'cat' => 'auth'
41
+ ],
42
+
43
+ 3003 =>[
44
+  'message' => 'User token did not generated successfully',
45
+  'type' => 'error',
46
+  'cat' => 'auth'
47
+ ],
48
+
49
+ 3004 => [
50
+  'message' => 'Request token have no agency access',
51
+  'type' => 'error',
52
+  'cat' => 'auth'
53
+ ],
54
+
55
+ 3005 => [
56
+  'message' => 'Request token did not contains user information',
57
+  'type' => 'error',
58
+  'cat' => 'auth'
59
+ ],
60
+
61
+ 3006 => [
62
+  'message' => 'Did not set request token',
63
+  'type' => 'error',
64
+  'cat' => 'auth'
65
+ ],
66
+
67
+ 3007 => [
68
+  'message' => 'can not decode the token',
69
+  'type' => 'error',
70
+  'cat' => 'auth'
71
+ ],
72
+
73
+ 3008 => [
74
+  'message' => 'can not generate token for authentication',
75
+  'type' => 'error',
76
+  'cat' => 'auth'
77
+ ],
78
+
79
+ 3009 => [
80
+  'message' => 'can not create token',
81
+  'type' => 'error',
82
+  'cat' => 'auth'
83
+ ],
84
+
85
+ 3010 => [
86
+  'message' => 'Token expired!',
87
+  'type' => 'error',
88
+  'cat' => 'auth'
89
+ ],
90
+
91
+ 3011 => [
92
+  'message' => 'Token is invalid!',
93
+  'type' => 'error',
94
+  'cat' => 'auth'
95
+ ],
96
+
97
+ 3012 => [
98
+  'message' => 'Token Blacklisted',
99
+  'type' => 'error',
100
+  'cat' => 'auth'
101
+ ],
102
+
103
+ 3013 => [
104
+  'message' => 'Payload invalid!',
105
+  'type' => 'error',
106
+  'cat' => 'auth'
107
+ ],
108
+
109
+ 3014 => [
110
+  'message' => 'Claim Invalid',
111
+  'type' => 'error',
112
+  'cat' => 'auth'
113
+ ],
114
+
115
+ 3015 => [
116
+  'message' => 'An error occurred on token validation',
117
+  'type' => 'error',
118
+  'cat' => 'auth'
119
+ ],
120
+
121
+ 5401 => [
122
+  'message' => 'Authentication unauthorized...',
123
+  'type' => 'error'
124
+ ],
125
+
126
+ 5404 => [
127
+  'message' => 'Oops... The requested page not found!',
128
+  'type' => 'error'
129
+ ],
130
+
131
+ 5405 => [
132
+  'message' => 'Oops... The method you requested is not allowed!',
133
+  'type' => 'error'
134
+ ],
135
+
136
+ 5406 => [
137
+  'message' => 'Oops... The parameters you entered are wrong!',
138
+  'type' => 'error'
139
+ ],
140
+
141
+ 5420 => [
142
+  'message' => 'Validation Error',
143
+  'type' => 'error'
144
+ ],
145
+
146
+ 5422 => [
147
+  'message' => 'Token is not valid',
148
+  'type' => 'error'
149
+ ],
150
+
151
+ 5445 => [
152
+  'message' => 'Oops... Database connection refused',
153
+  'type' => 'error'
154
+ ],
155
+
156
+ 5448 => [
157
+  'message' => 'Oops... Insert action was not successfully executed',
158
+  'type' => 'error'
159
+ ],
160
+
161
+ 5447 => [
162
+  'message' => 'Oops... Delete action was not successfully executed',
163
+  'type' => 'error'
164
+ ],
165
+
166
+ 5449 => [
167
+  'message' => 'Oops... Update action was not successfully executed',
168
+  'type' => 'error'
169
+ ]
170 170
 
171 171
 ];
Please login to merge, or discard this patch.
src/RespondServiceProvider.php 2 patches
Indentation   +26 added lines, -26 removed lines patch added patch discarded remove patch
@@ -6,42 +6,42 @@
 block discarded – undo
6 6
 
7 7
 class RespondServiceProvider extends ServiceProvider
8 8
 {
9
-	/**
10
-	* Perform post-registration booting of services.
11
-	*
12
-	* @return void
13
-	*/
14
-	public function boot()
15
-	{
9
+ /**
10
+  * Perform post-registration booting of services.
11
+  *
12
+  * @return void
13
+  */
14
+ public function boot()
15
+ {
16 16
 
17
-		$this->publishes([
18
-			__DIR__.'/config/errors.php' => config_path('errors.php'),
19
-		]);
17
+  $this->publishes([
18
+   __DIR__.'/config/errors.php' => config_path('errors.php'),
19
+  ]);
20 20
 
21
-	}
21
+ }
22 22
 
23 23
 
24
-	/**
25
-	* Register any package services.
26
-	*
27
-	* @return void
28
-	*/
29
-	public function register()
30
-	{
24
+ /**
25
+  * Register any package services.
26
+  *
27
+  * @return void
28
+  */
29
+ public function register()
30
+ {
31 31
 
32
-		$this->registerMessages();
32
+  $this->registerMessages();
33 33
 
34
-	}
34
+ }
35 35
 
36
-	private function registerMessages()
37
-	{
36
+ private function registerMessages()
37
+ {
38 38
 
39
-		$this->app->bind( 'Anetwork\Respond\Messages', function() {
39
+  $this->app->bind( 'Anetwork\Respond\Messages', function() {
40 40
 
41
-			return new Messages();
41
+   return new Messages();
42 42
 
43
-		});
43
+  });
44 44
 
45
-	}
45
+ }
46 46
 
47 47
 }
Please login to merge, or discard this patch.
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -36,7 +36,7 @@
 block discarded – undo
36 36
 	private function registerMessages()
37 37
 	{
38 38
 
39
-		$this->app->bind( 'Anetwork\Respond\Messages', function() {
39
+		$this->app->bind('Anetwork\Respond\Messages', function() {
40 40
 
41 41
 			return new Messages();
42 42
 
Please login to merge, or discard this patch.