@@ -515,13 +515,13 @@ |
||
515 | 515 | $allowed = $this->connection->fetchOne($sql, Db::FETCH_NUM, [$roleObj->getId(), $resource, $access, $this->getApp()->getId(), $roleObj->getId()]); |
516 | 516 | |
517 | 517 | if (is_array($allowed)) { |
518 | - return (bool) $allowed[0]; |
|
518 | + return (bool)$allowed[0]; |
|
519 | 519 | } |
520 | 520 | |
521 | 521 | /** |
522 | 522 | * Return the default access action |
523 | 523 | */ |
524 | - return (bool) $this->_defaultAccess; |
|
524 | + return (bool)$this->_defaultAccess; |
|
525 | 525 | } |
526 | 526 | |
527 | 527 | /** |
@@ -1,6 +1,6 @@ |
||
1 | 1 | <?php |
2 | 2 | |
3 | -declare (strict_types = 1); |
|
3 | +declare(strict_types=1); |
|
4 | 4 | |
5 | 5 | namespace Canvas\Exception; |
6 | 6 |
@@ -26,19 +26,19 @@ |
||
26 | 26 | /** |
27 | 27 | * Create a new database record |
28 | 28 | */ |
29 | - self::create((array)$this->entity,(array)$this->user, $this->content, Notifications::APPS, $this->systemModule); |
|
29 | + self::create((array)$this->entity, (array)$this->user, $this->content, Notifications::APPS, $this->systemModule); |
|
30 | 30 | |
31 | 31 | /** |
32 | 32 | * Search for specific email template for System |
33 | 33 | */ |
34 | 34 | $template = EmailTemplates::findFirst([ |
35 | 35 | 'conditions'=>'companies_id in (0,?0) and apps_id in (0,?1) and name = ?2 and users_id in (1,?3) and is_deleted = 0', |
36 | - 'bind'=>[$this->user['default_company'],Di::getDefault()->getConfig()->app->id,'email-apps',$this->user['id']] |
|
36 | + 'bind'=>[$this->user['default_company'], Di::getDefault()->getConfig()->app->id, 'email-apps', $this->user['id']] |
|
37 | 37 | ]); |
38 | 38 | |
39 | 39 | |
40 | 40 | |
41 | - if(!is_object($template)){ |
|
41 | + if (!is_object($template)) { |
|
42 | 42 | Di::getDefault()->getLog()->error(current($template->getMessages())); |
43 | 43 | } |
44 | 44 |
@@ -25,14 +25,14 @@ |
||
25 | 25 | /** |
26 | 26 | * Create a new database record |
27 | 27 | */ |
28 | - self::create((array)$this->entity,(array)$this->user, $this->content, Notifications::SYSTEM, $this->systemModule); |
|
28 | + self::create((array)$this->entity, (array)$this->user, $this->content, Notifications::SYSTEM, $this->systemModule); |
|
29 | 29 | |
30 | 30 | /** |
31 | 31 | * Search for specific email template for System |
32 | 32 | */ |
33 | 33 | $template = EmailTemplates::findFirst([ |
34 | 34 | 'conditions'=>'companies_id in (0,?0) and apps_id in (0,?1) and name = ?2 and users_id in (1,?3) and is_deleted = 0', |
35 | - 'bind'=>[$this->user['default_company'],Di::getDefault()->getConfig()->app->id,'email-system',$this->user['id']] |
|
35 | + 'bind'=>[$this->user['default_company'], Di::getDefault()->getConfig()->app->id, 'email-system', $this->user['id']] |
|
36 | 36 | ]); |
37 | 37 | |
38 | 38 | //Fetch and return specific template for System Email Notifications |
@@ -25,14 +25,14 @@ |
||
25 | 25 | /** |
26 | 26 | * Create a new database record |
27 | 27 | */ |
28 | - self::create((array)$this->entity,(array)$this->user, $this->content, Notifications::USERS, $this->systemModule); |
|
28 | + self::create((array)$this->entity, (array)$this->user, $this->content, Notifications::USERS, $this->systemModule); |
|
29 | 29 | |
30 | 30 | /** |
31 | 31 | * Search for specific email template for System |
32 | 32 | */ |
33 | 33 | $template = EmailTemplates::findFirst([ |
34 | 34 | 'conditions'=>'companies_id in (0,?0) and apps_id in (0,?1) and name = ?2 and users_id in (1,?3) and is_deleted = 0', |
35 | - 'bind'=>[$this->user['default_company'],Di::getDefault()->getConfig()->app->id,'email-users',$this->user['id']] |
|
35 | + 'bind'=>[$this->user['default_company'], Di::getDefault()->getConfig()->app->id, 'email-users', $this->user['id']] |
|
36 | 36 | ]); |
37 | 37 | |
38 | 38 | //Fetch and return specific template for Users Email Notifications |
@@ -22,7 +22,7 @@ discard block |
||
22 | 22 | public function __construct(array $entity, string $content, string $systemModule, array $user) |
23 | 23 | { |
24 | 24 | $this->entity = $entity; |
25 | - $this->content = $content; |
|
25 | + $this->content = $content; |
|
26 | 26 | $this->systemModule = $systemModule; |
27 | 27 | $this->user = $user; |
28 | 28 | } |
@@ -45,12 +45,12 @@ discard block |
||
45 | 45 | public static function apps(string $content, string $systemModule, UsersModel $user = null): void |
46 | 46 | { |
47 | 47 | if (!isset($user)) { |
48 | - $user = Di::getDefault()->getUserData(); |
|
48 | + $user = Di::getDefault()->getUserData(); |
|
49 | 49 | } |
50 | 50 | /** |
51 | 51 | * Create an array of Apps Push Notification |
52 | 52 | */ |
53 | - $notificationArray = array( |
|
53 | + $notificationArray = array( |
|
54 | 54 | 'entity'=> $user->toArray(), |
55 | 55 | 'users_id' => Di::getDefault()->getUserData()->getId(), |
56 | 56 | 'content'=> $content, |
@@ -61,7 +61,7 @@ discard block |
||
61 | 61 | /** |
62 | 62 | * Convert notification to Rabbitmq message |
63 | 63 | */ |
64 | - $msg = new AMQPMessage(json_encode($notificationArray, JSON_UNESCAPED_SLASHES), ['delivery_mode' => 2]); |
|
64 | + $msg = new AMQPMessage(json_encode($notificationArray, JSON_UNESCAPED_SLASHES), ['delivery_mode' => 2]); |
|
65 | 65 | |
66 | 66 | $channel = Di::getDefault()->getQueue()->channel(); |
67 | 67 | |
@@ -78,13 +78,13 @@ discard block |
||
78 | 78 | public static function users(string $content, string $systemModule, UsersModel $user = null): void |
79 | 79 | { |
80 | 80 | if (!isset($user)) { |
81 | - $user = Di::getDefault()->getUserData(); |
|
81 | + $user = Di::getDefault()->getUserData(); |
|
82 | 82 | } |
83 | 83 | |
84 | 84 | /** |
85 | 85 | * Create an array of Apps Push Notification |
86 | 86 | */ |
87 | - $notificationArray = array( |
|
87 | + $notificationArray = array( |
|
88 | 88 | 'entity'=> $user->toArray(), |
89 | 89 | 'users_id' => Di::getDefault()->getUserData()->getId(), |
90 | 90 | 'content'=> $content, |
@@ -96,7 +96,7 @@ discard block |
||
96 | 96 | /** |
97 | 97 | * Convert notification to Rabbitmq message |
98 | 98 | */ |
99 | - $msg = new AMQPMessage(json_encode($notificationArray, JSON_UNESCAPED_SLASHES), ['delivery_mode' => 2]); |
|
99 | + $msg = new AMQPMessage(json_encode($notificationArray, JSON_UNESCAPED_SLASHES), ['delivery_mode' => 2]); |
|
100 | 100 | |
101 | 101 | $channel = Di::getDefault()->getQueue()->channel(); |
102 | 102 | |
@@ -113,13 +113,13 @@ discard block |
||
113 | 113 | public static function system(string $content, string $systemModule, UsersModel $user = null): void |
114 | 114 | { |
115 | 115 | if (!isset($user)) { |
116 | - $user = Di::getDefault()->getUserData(); |
|
116 | + $user = Di::getDefault()->getUserData(); |
|
117 | 117 | } |
118 | 118 | |
119 | 119 | /** |
120 | 120 | * Create an array of Apps Push Notification |
121 | 121 | */ |
122 | - $notificationArray = array( |
|
122 | + $notificationArray = array( |
|
123 | 123 | 'entity'=> $user->toArray(), |
124 | 124 | 'users_id' => Di::getDefault()->getUserData()->getId(), |
125 | 125 | 'content'=> $content, |
@@ -131,7 +131,7 @@ discard block |
||
131 | 131 | /** |
132 | 132 | * Convert notification to Rabbitmq message |
133 | 133 | */ |
134 | - $msg = new AMQPMessage(json_encode($notificationArray, JSON_UNESCAPED_SLASHES), ['delivery_mode' => 2]); |
|
134 | + $msg = new AMQPMessage(json_encode($notificationArray, JSON_UNESCAPED_SLASHES), ['delivery_mode' => 2]); |
|
135 | 135 | |
136 | 136 | $channel = Di::getDefault()->getQueue()->channel(); |
137 | 137 |
@@ -24,7 +24,7 @@ |
||
24 | 24 | /** |
25 | 25 | * Create a new database record |
26 | 26 | */ |
27 | - self::create((array)$this->entity,(array)$this->user, $this->content, Notifications::USERS, $this->systemModule); |
|
27 | + self::create((array)$this->entity, (array)$this->user, $this->content, Notifications::USERS, $this->systemModule); |
|
28 | 28 | |
29 | 29 | return $this->content . " From Apps"; |
30 | 30 | } |
@@ -24,7 +24,7 @@ |
||
24 | 24 | /** |
25 | 25 | * Create a new database record |
26 | 26 | */ |
27 | - self::create((array)$this->entity,(array)$this->user, $this->content, Notifications::USERS, $this->systemModule); |
|
27 | + self::create((array)$this->entity, (array)$this->user, $this->content, Notifications::USERS, $this->systemModule); |
|
28 | 28 | |
29 | 29 | return $this->content . " From System"; |
30 | 30 | } |
@@ -24,7 +24,7 @@ |
||
24 | 24 | /** |
25 | 25 | * Create a new database record |
26 | 26 | */ |
27 | - self::create((array)$this->entity,(array)$this->user, $this->content, Notifications::USERS, $this->systemModule); |
|
27 | + self::create((array)$this->entity, (array)$this->user, $this->content, Notifications::USERS, $this->systemModule); |
|
28 | 28 | |
29 | 29 | return $this->content . " From Users"; |
30 | 30 | } |