@@ -13,7 +13,8 @@ discard block |
||
13 | 13 | require(__DIR__ . '/vendor/autoload.php'); |
14 | 14 | } |
15 | 15 | set_include_path(get_include_path() . PATH_SEPARATOR . __DIR__); |
16 | -spl_autoload_register(function ($class) { |
|
16 | +spl_autoload_register(function ($class) |
|
17 | +{ |
|
17 | 18 | |
18 | 19 | // project-specific namespace prefix |
19 | 20 | $prefix = 'Flipside\\'; |
@@ -23,7 +24,8 @@ discard block |
||
23 | 24 | |
24 | 25 | // does the class use the namespace prefix? |
25 | 26 | $len = strlen($prefix); |
26 | - if (strncmp($prefix, $class, $len) !== 0) { |
|
27 | + if (strncmp($prefix, $class, $len) !== 0) |
|
28 | + { |
|
27 | 29 | // no, move to the next registered autoloader |
28 | 30 | return; |
29 | 31 | } |
@@ -37,7 +39,8 @@ discard block |
||
37 | 39 | $file = $base_dir . str_replace('\\', '/', $relative_class) . '.php'; |
38 | 40 | |
39 | 41 | // if the file exists, require it |
40 | - if (file_exists($file)) { |
|
42 | + if (file_exists($file)) |
|
43 | + { |
|
41 | 44 | require $file; |
42 | 45 | } |
43 | 46 | }); |
@@ -152,9 +152,9 @@ |
||
152 | 152 | $case = true; |
153 | 153 | } |
154 | 154 | if($case) |
155 | - { |
|
155 | + { |
|
156 | 156 | if(class_exists('MongoRegex')) |
157 | - { |
|
157 | + { |
|
158 | 158 | return array($field=>array('$regex'=>new \MongoRegex('/'.$this->var2.'/i'))); |
159 | 159 | } |
160 | 160 | else |
@@ -79,11 +79,11 @@ |
||
79 | 79 | { |
80 | 80 | $auth = $request->getHeaderLine('Authorization'); |
81 | 81 | if(empty($auth)) |
82 | - { |
|
82 | + { |
|
83 | 83 | $request = $request->withAttribute('user', $this->getUserFromSession()); |
84 | 84 | } |
85 | 85 | else |
86 | - { |
|
86 | + { |
|
87 | 87 | $request = $request->withAttribute('user', $this->getUserFromHeader($auth)); |
88 | 88 | } |
89 | 89 | $response = $next($request, $response); |
@@ -46,10 +46,13 @@ discard block |
||
46 | 46 | $args = array(); |
47 | 47 | $args['RawMessage'] = array(); |
48 | 48 | $args['RawMessage']['Data'] = $email->getRawMessage(); |
49 | - try { |
|
49 | + try |
|
50 | + { |
|
50 | 51 | $res = $this->ses->sendRawEmail($args); |
51 | 52 | return $res; |
52 | - } catch(\Exception $e) { |
|
53 | + } |
|
54 | + catch(\Exception $e) |
|
55 | + { |
|
53 | 56 | return false; |
54 | 57 | } |
55 | 58 | } |
@@ -66,7 +69,7 @@ discard block |
||
66 | 69 | $args['Message']['Subject']['Data'] = $email->getSubject(); |
67 | 70 | $args['Message']['Body'] = array(); |
68 | 71 | $textBody = $email->getTextBody(); |
69 | - if(strlen($textBody) > 0) |
|
72 | + if(strlen($textBody) > 0) |
|
70 | 73 | { |
71 | 74 | $args['Message']['Body']['Text'] = array(); |
72 | 75 | $args['Message']['Body']['Text']['Data'] = $textBody; |
@@ -74,9 +77,12 @@ discard block |
||
74 | 77 | $args['Message']['Body']['Html'] = array(); |
75 | 78 | $args['Message']['Body']['Html']['Data'] = $email->getHtmlBody(); |
76 | 79 | $args['ReplyToAddresses'] = array($email->getReplyTo()); |
77 | - try { |
|
80 | + try |
|
81 | + { |
|
78 | 82 | return $this->ses->sendEmail($args); |
79 | - } catch(\Exception $e) { |
|
83 | + } |
|
84 | + catch(\Exception $e) |
|
85 | + { |
|
80 | 86 | return false; |
81 | 87 | } |
82 | 88 | } |