@@ -48,7 +48,7 @@ discard block |
||
| 48 | 48 | const TEMPLATE_UPSERT = self::TEMPLATE_BASE . DIRECTORY_SEPARATOR . 'upsert'; |
| 49 | 49 | |
| 50 | 50 | /** |
| 51 | - * @return string |
|
| 51 | + * @return Response |
|
| 52 | 52 | */ |
| 53 | 53 | public function actionIndex() |
| 54 | 54 | { |
@@ -73,7 +73,7 @@ discard block |
||
| 73 | 73 | /** |
| 74 | 74 | * @param null $identifier |
| 75 | 75 | * @param Organization|null $organization |
| 76 | - * @return string |
|
| 76 | + * @return Response |
|
| 77 | 77 | */ |
| 78 | 78 | public function actionUpsert($identifier = null, Organization $organization = null) |
| 79 | 79 | { |
@@ -20,7 +20,6 @@ |
||
| 20 | 20 | use flipbox\organization\events\RegisterOrganizationActions; |
| 21 | 21 | use flipbox\organization\helpers\User as UserHelper; |
| 22 | 22 | use flipbox\organization\models\Type; |
| 23 | -use flipbox\organization\Plugin; |
|
| 24 | 23 | use flipbox\organization\Plugin as OrganizationPlugin; |
| 25 | 24 | use flipbox\organization\web\assets\element\Element; |
| 26 | 25 | use flipbox\spark\helpers\SiteHelper; |
@@ -109,7 +109,7 @@ discard block |
||
| 109 | 109 | } |
| 110 | 110 | |
| 111 | 111 | /** |
| 112 | - * @return array |
|
| 112 | + * @return string[] |
|
| 113 | 113 | */ |
| 114 | 114 | public function attributes() |
| 115 | 115 | { |
@@ -1482,7 +1482,7 @@ discard block |
||
| 1482 | 1482 | } |
| 1483 | 1483 | |
| 1484 | 1484 | /** |
| 1485 | - * @param string|User $user |
|
| 1485 | + * @param User $user |
|
| 1486 | 1486 | * @return bool |
| 1487 | 1487 | */ |
| 1488 | 1488 | public function isOwner($user = 'CURRENT_USER') |
@@ -27,7 +27,6 @@ |
||
| 27 | 27 | use flipbox\organization\elements\db\Organization as OrganizationQuery; |
| 28 | 28 | use flipbox\organization\helpers\User as UserHelper; |
| 29 | 29 | use flipbox\organization\models\Type as TypeModel; |
| 30 | -use flipbox\organization\Plugin; |
|
| 31 | 30 | use flipbox\organization\Plugin as OrganizationPlugin; |
| 32 | 31 | use flipbox\organization\records\Organization as OrganizationRecord; |
| 33 | 32 | use flipbox\organization\records\User as OrganizationUsersRecord; |
@@ -27,7 +27,7 @@ |
||
| 27 | 27 | * Standard param parsing. |
| 28 | 28 | * |
| 29 | 29 | * @param $value |
| 30 | - * @param $join |
|
| 30 | + * @param string $join |
|
| 31 | 31 | * @return bool |
| 32 | 32 | */ |
| 33 | 33 | public static function parseBaseParam(&$value, &$join) |
@@ -91,7 +91,7 @@ |
||
| 91 | 91 | } |
| 92 | 92 | } |
| 93 | 93 | |
| 94 | - $transaction = RecordHelper::beginTransaction();; |
|
| 94 | + $transaction = RecordHelper::beginTransaction(); ; |
|
| 95 | 95 | |
| 96 | 96 | try { |
| 97 | 97 | |
@@ -155,10 +155,8 @@ discard block |
||
| 155 | 155 | if (empty($existingStatus)) { |
| 156 | 156 | |
| 157 | 157 | $existingStatus = (!empty($query['archived']) ? |
| 158 | - Element::STATUS_ARCHIVED : |
|
| 159 | - ($query['enabled'] ? |
|
| 160 | - Element::STATUS_ENABLED : |
|
| 161 | - ELEMENT::STATUS_DISABLED |
|
| 158 | + Element::STATUS_ARCHIVED : ($query['enabled'] ? |
|
| 159 | + Element::STATUS_ENABLED : ELEMENT::STATUS_DISABLED |
|
| 162 | 160 | ) |
| 163 | 161 | ); |
| 164 | 162 | |
@@ -433,7 +431,7 @@ discard block |
||
| 433 | 431 | $organization->slug = $request->getBodyParam('slug', $organization->slug); |
| 434 | 432 | $organization->dateJoined = (($dateJoined = $request->getBodyParam('dateJoined')) !== false ? (DateTimeHelper::toDateTime($dateJoined) ?: null) : $organization->dateJoined); |
| 435 | 433 | $organization->status = $request->getBodyParam('status', $organization->getStatus()); |
| 436 | - $organization->enabledForSite = (bool)$request->getBodyParam('enabledForSite', $organization->enabledForSite); |
|
| 434 | + $organization->enabledForSite = (bool) $request->getBodyParam('enabledForSite', $organization->enabledForSite); |
|
| 437 | 435 | $organization->title = $request->getBodyParam('title', $organization->title); |
| 438 | 436 | |
| 439 | 437 | // Active Type |
@@ -76,7 +76,7 @@ |
||
| 76 | 76 | Event::on( |
| 77 | 77 | Elements::className(), |
| 78 | 78 | Elements::EVENT_REGISTER_ELEMENT_TYPES, |
| 79 | - function (RegisterComponentTypesEvent $event) { |
|
| 79 | + function(RegisterComponentTypesEvent $event) { |
|
| 80 | 80 | $event->types[] = Organization::class; |
| 81 | 81 | } |
| 82 | 82 | ); |
@@ -25,7 +25,7 @@ discard block |
||
| 25 | 25 | Event::on( |
| 26 | 26 | User::className(), |
| 27 | 27 | User::EVENT_REGISTER_ACTIONS, |
| 28 | - function (RegisterElementActionsEvent $event) { |
|
| 28 | + function(RegisterElementActionsEvent $event) { |
|
| 29 | 29 | if ($event->source == '*') { |
| 30 | 30 | $event->actions = [ |
| 31 | 31 | [ |
@@ -44,7 +44,7 @@ discard block |
||
| 44 | 44 | Event::on( |
| 45 | 45 | User::className(), |
| 46 | 46 | User::EVENT_REGISTER_SOURCES, |
| 47 | - function (RegisterElementSourcesEvent $event) { |
|
| 47 | + function(RegisterElementSourcesEvent $event) { |
|
| 48 | 48 | if ($event->context == 'index') { |
| 49 | 49 | $event->sources = [ |
| 50 | 50 | [ |