@@ -86,7 +86,7 @@ |
||
| 86 | 86 | */ |
| 87 | 87 | public static function isResource(string $resourceName) : bool |
| 88 | 88 | { |
| 89 | - return (bool) self::count([ |
|
| 89 | + return (bool)self::count([ |
|
| 90 | 90 | 'conditions' => 'name = ?0 AND apps_id in (?1, ?2)', |
| 91 | 91 | 'bind' => [$resourceName, Di::getDefault()->getApp()->getId(), Apps::CANVAS_DEFAULT_APP_ID] |
| 92 | 92 | ]); |
@@ -152,7 +152,7 @@ |
||
| 152 | 152 | */ |
| 153 | 153 | public function isActive(): bool |
| 154 | 154 | { |
| 155 | - return (bool) $this->is_actived; |
|
| 155 | + return (bool)$this->is_actived; |
|
| 156 | 156 | } |
| 157 | 157 | |
| 158 | 158 | /** |
@@ -389,7 +389,7 @@ discard block |
||
| 389 | 389 | */ |
| 390 | 390 | public function currentCompanyId(): int |
| 391 | 391 | { |
| 392 | - return (int) $this->default_company; |
|
| 392 | + return (int)$this->default_company; |
|
| 393 | 393 | } |
| 394 | 394 | |
| 395 | 395 | /** |
@@ -400,7 +400,7 @@ discard block |
||
| 400 | 400 | */ |
| 401 | 401 | public function currentCompanyBranchId(): int |
| 402 | 402 | { |
| 403 | - return (int) $this->default_company_branch; |
|
| 403 | + return (int)$this->default_company_branch; |
|
| 404 | 404 | } |
| 405 | 405 | |
| 406 | 406 | /** |
@@ -432,13 +432,13 @@ discard block |
||
| 432 | 432 | $company->users_id = $this->getId(); |
| 433 | 433 | |
| 434 | 434 | if (!$company->save()) { |
| 435 | - throw new Exception((string) current($company->getMessages())); |
|
| 435 | + throw new Exception((string)current($company->getMessages())); |
|
| 436 | 436 | } |
| 437 | 437 | |
| 438 | 438 | $this->default_company = $company->getId(); |
| 439 | 439 | |
| 440 | 440 | if (!$this->update()) { |
| 441 | - throw new ServerErrorHttpException((string) current($this->getMessages())); |
|
| 441 | + throw new ServerErrorHttpException((string)current($this->getMessages())); |
|
| 442 | 442 | } |
| 443 | 443 | |
| 444 | 444 | $this->stripe_id = $company->getPaymentGatewayCustomerId(); |
@@ -494,7 +494,7 @@ discard block |
||
| 494 | 494 | */ |
| 495 | 495 | public function getAssociatedApps(): array |
| 496 | 496 | { |
| 497 | - return array_map(function ($apps) { |
|
| 497 | + return array_map(function($apps) { |
|
| 498 | 498 | return $apps['apps_id']; |
| 499 | 499 | }, $this->getApps(['columns' => 'apps_id', 'group' => 'apps_id'])->toArray()); |
| 500 | 500 | } |
@@ -506,7 +506,7 @@ discard block |
||
| 506 | 506 | */ |
| 507 | 507 | public function getAssociatedCompanies(): array |
| 508 | 508 | { |
| 509 | - return array_map(function ($company) { |
|
| 509 | + return array_map(function($company) { |
|
| 510 | 510 | return $company['companies_id']; |
| 511 | 511 | }, $this->getCompanies(['columns' => 'companies_id'])->toArray()); |
| 512 | 512 | } |
@@ -315,12 +315,12 @@ discard block |
||
| 315 | 315 | } |
| 316 | 316 | |
| 317 | 317 | /** |
| 318 | - * Register a company given a user and name. |
|
| 319 | - * |
|
| 320 | - * @param Users $user |
|
| 321 | - * @param string $name |
|
| 322 | - * @return Companies |
|
| 323 | - */ |
|
| 318 | + * Register a company given a user and name. |
|
| 319 | + * |
|
| 320 | + * @param Users $user |
|
| 321 | + * @param string $name |
|
| 322 | + * @return Companies |
|
| 323 | + */ |
|
| 324 | 324 | public static function register(Users $user, string $name): Companies |
| 325 | 325 | { |
| 326 | 326 | $company = new self(); |
@@ -525,10 +525,10 @@ discard block |
||
| 525 | 525 | } |
| 526 | 526 | |
| 527 | 527 | /** |
| 528 | - * Get an array of the associates users for this company. |
|
| 529 | - * |
|
| 530 | - * @return array |
|
| 531 | - */ |
|
| 528 | + * Get an array of the associates users for this company. |
|
| 529 | + * |
|
| 530 | + * @return array |
|
| 531 | + */ |
|
| 532 | 532 | public function getAssociatedUsersByApp(): array |
| 533 | 533 | { |
| 534 | 534 | return array_map(function ($users) { |
@@ -531,7 +531,7 @@ |
||
| 531 | 531 | */ |
| 532 | 532 | public function getAssociatedUsersByApp(): array |
| 533 | 533 | { |
| 534 | - return array_map(function ($users) { |
|
| 534 | + return array_map(function($users) { |
|
| 535 | 535 | return $users['users_id']; |
| 536 | 536 | }, $this->getUsersAssociatedByApps(['columns' => 'users_id'])->toArray()); |
| 537 | 537 | } |
@@ -43,7 +43,7 @@ |
||
| 43 | 43 | $userRole->apps_id = $role->apps_id; |
| 44 | 44 | $userRole->companies_id = $this->currentCompanyId(); |
| 45 | 45 | if (!$userRole->save()) { |
| 46 | - throw new ModelException((string) current($userRole->getMessages())); |
|
| 46 | + throw new ModelException((string)current($userRole->getMessages())); |
|
| 47 | 47 | } |
| 48 | 48 | } |
| 49 | 49 | |
@@ -53,8 +53,8 @@ |
||
| 53 | 53 | $userProfile = current($data); |
| 54 | 54 | |
| 55 | 55 | /** |
| 56 | - * Lets find if user has a linked source by social network id |
|
| 57 | - */ |
|
| 56 | + * Lets find if user has a linked source by social network id |
|
| 57 | + */ |
|
| 58 | 58 | $userLinkedSource = UserLinkedSources::findFirst([ |
| 59 | 59 | 'conditions'=>'source_id = ?0 and source_users_id_text = ?1 and is_deleted = 0', |
| 60 | 60 | 'bind'=>[ |
@@ -55,7 +55,7 @@ discard block |
||
| 55 | 55 | /** |
| 56 | 56 | * Lets find if user has a linked source by social network id |
| 57 | 57 | */ |
| 58 | - $userLinkedSource = UserLinkedSources::findFirst([ |
|
| 58 | + $userLinkedSource = UserLinkedSources::findFirst([ |
|
| 59 | 59 | 'conditions'=>'source_id = ?0 and source_users_id_text = ?1 and is_deleted = 0', |
| 60 | 60 | 'bind'=>[ |
| 61 | 61 | $source->id, |
@@ -90,8 +90,8 @@ discard block |
||
| 90 | 90 | $newUser->signup(); |
| 91 | 91 | |
| 92 | 92 | $newLinkedSource = new UserLinkedSources(); |
| 93 | - $newLinkedSource->users_id = $newUser->id; |
|
| 94 | - $newLinkedSource->source_id = $source->id; |
|
| 93 | + $newLinkedSource->users_id = $newUser->id; |
|
| 94 | + $newLinkedSource->source_id = $source->id; |
|
| 95 | 95 | $newLinkedSource->source_users_id = $userProfile->identifier ? $userProfile->identifier : 'asdakelkmaefa'; |
| 96 | 96 | $newLinkedSource->source_users_id_text = $userProfile->identifier ? $userProfile->identifier : 'asdakelkmaefa'; |
| 97 | 97 | $newLinkedSource->source_username = $userProfile->displayName ? $userProfile->displayName : 'exampleasdadas'; |
@@ -32,9 +32,9 @@ |
||
| 32 | 32 | * @param string $systemModule |
| 33 | 33 | * @return void |
| 34 | 34 | */ |
| 35 | - public static function create(array $entity,array $user, string $content, int $notificationTypeId, string $systemModule): void |
|
| 35 | + public static function create(array $entity, array $user, string $content, int $notificationTypeId, string $systemModule): void |
|
| 36 | 36 | { |
| 37 | - $notification = new Notifications(); |
|
| 37 | + $notification = new Notifications(); |
|
| 38 | 38 | $notification->users_id = $user['id']; |
| 39 | 39 | $notification->companies_id = $user['default_company']; |
| 40 | 40 | $notification->apps_id = Di::getDefault()->getApp()->getId(); |
@@ -33,8 +33,8 @@ |
||
| 33 | 33 | public $bypassRoutes = [ |
| 34 | 34 | '/v1/auth/logout'=> ['PUT'], |
| 35 | 35 | '/v1/auth'=> ['POST'], |
| 36 | - '/v1/companies'=> ['GET','POST'], |
|
| 37 | - '/v1/apps-plans'=> ['PUT','POST'], |
|
| 36 | + '/v1/companies'=> ['GET', 'POST'], |
|
| 37 | + '/v1/apps-plans'=> ['PUT', 'POST'], |
|
| 38 | 38 | ]; |
| 39 | 39 | |
| 40 | 40 | /** |
@@ -15,8 +15,8 @@ |
||
| 15 | 15 | trait RequestJwtTrait |
| 16 | 16 | { |
| 17 | 17 | /** |
| 18 | - * @return string |
|
| 19 | - */ |
|
| 18 | + * @return string |
|
| 19 | + */ |
|
| 20 | 20 | public function getBearerTokenFromHeader(): string |
| 21 | 21 | { |
| 22 | 22 | return str_replace('Bearer ', '', $this->getHeader('Authorization')); |