Completed
Push — master ( d1f682...d4e8e7 )
by Nate
07:17 queued 05:30
created
src/services/Organization.php 3 patches
Doc Comments   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -847,7 +847,7 @@
 block discarded – undo
847 847
 
848 848
     /**
849 849
      * @param OrganizationElement $element
850
-     * @param $newOwnerId
850
+     * @param integer $newOwnerId
851 851
      * @return bool
852 852
      * @throws \Exception
853 853
      * @throws \yii\db\Exception
Please login to merge, or discard this patch.
Unused Use Statements   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -10,17 +10,17 @@
 block discarded – undo
10 10
 
11 11
 use Craft;
12 12
 use craft\db\Query;
13
+use craft\elements\User as UserElement;
13 14
 use craft\elements\db\ElementQueryInterface;
14 15
 use craft\elements\db\UserQuery;
15
-use craft\elements\User as UserElement;
16 16
 use craft\helpers\DateTimeHelper;
17 17
 use craft\models\FieldLayout as FieldLayoutModel;
18 18
 use craft\records\Element as ElementRecord;
19
-use flipbox\organization\elements\db\Organization as OrganizationQuery;
19
+use flipbox\organization\Organization as OrganizationPlugin;
20 20
 use flipbox\organization\elements\Organization as OrganizationElement;
21
+use flipbox\organization\elements\db\Organization as OrganizationQuery;
21 22
 use flipbox\organization\events\ChangeOwner as ChangeOwnerEvent;
22 23
 use flipbox\organization\events\ChangeStatus as ChangeStatusEvent;
23
-use flipbox\organization\Organization as OrganizationPlugin;
24 24
 use flipbox\organization\records\Organization as OrganizationRecord;
25 25
 use flipbox\spark\helpers\ArrayHelper;
26 26
 use flipbox\spark\helpers\RecordHelper;
Please login to merge, or discard this patch.
Spacing   +3 added lines, -5 removed lines patch added patch discarded remove patch
@@ -171,10 +171,8 @@  discard block
 block discarded – undo
171 171
             // Quick logic to determine the status
172 172
             if (empty($existingStatus)) {
173 173
                 $existingStatus = (!empty($query['archived']) ?
174
-                    OrganizationElement::STATUS_ARCHIVED :
175
-                    ($query['enabled'] ?
176
-                        OrganizationElement::STATUS_ENABLED :
177
-                        OrganizationElement::STATUS_DISABLED
174
+                    OrganizationElement::STATUS_ARCHIVED : ($query['enabled'] ?
175
+                        OrganizationElement::STATUS_ENABLED : OrganizationElement::STATUS_DISABLED
178 176
                     )
179 177
                 );
180 178
             }
@@ -449,7 +447,7 @@  discard block
 block discarded – undo
449 447
         $organization->slug = $request->getBodyParam('slug', $organization->slug);
450 448
 
451 449
         // Enabled
452
-        $organization->enabledForSite = (bool)$request->getBodyParam(
450
+        $organization->enabledForSite = (bool) $request->getBodyParam(
453 451
             'enabledForSite',
454 452
             $organization->enabledForSite
455 453
         );
Please login to merge, or discard this patch.
src/services/User.php 1 patch
Unused Use Statements   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -12,11 +12,11 @@
 block discarded – undo
12 12
 use craft\db\Query;
13 13
 use craft\elements\User as UserElement;
14 14
 use craft\helpers\ArrayHelper;
15
-use flipbox\organization\elements\db\User as UserQuery;
15
+use flipbox\organization\Organization as OrganizationPlugin;
16 16
 use flipbox\organization\elements\Organization as OrganizationElement;
17
+use flipbox\organization\elements\db\User as UserQuery;
17 18
 use flipbox\organization\events\ManageOrganizationUser;
18 19
 use flipbox\organization\helpers\Query as QueryHelper;
19
-use flipbox\organization\Organization as OrganizationPlugin;
20 20
 use flipbox\organization\records\User as OrganizationUserRecord;
21 21
 use flipbox\spark\helpers\RecordHelper;
22 22
 use yii\base\Component;
Please login to merge, or discard this patch.
src/validators/User.php 1 patch
Unused Use Statements   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -9,8 +9,8 @@
 block discarded – undo
9 9
 namespace flipbox\organization\validators;
10 10
 
11 11
 use Craft;
12
-use craft\elements\db\UserQuery;
13 12
 use craft\elements\User as UserElement;
13
+use craft\elements\db\UserQuery;
14 14
 use craft\helpers\Json;
15 15
 use yii\validators\Validator;
16 16
 
Please login to merge, or discard this patch.
src/web/twig/variables/Organization.php 1 patch
Unused Use Statements   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -9,9 +9,9 @@
 block discarded – undo
9 9
 namespace flipbox\organization\web\twig\variables;
10 10
 
11 11
 use craft\elements\User;
12
-use flipbox\organization\elements\db\Organization as OrganizationQuery;
13
-use flipbox\organization\elements\Organization as OrganizationElement;
14 12
 use flipbox\organization\Organization as OrganizationPlugin;
13
+use flipbox\organization\elements\Organization as OrganizationElement;
14
+use flipbox\organization\elements\db\Organization as OrganizationQuery;
15 15
 use yii\di\ServiceLocator;
16 16
 
17 17
 /**
Please login to merge, or discard this patch.
src/web/twig/variables/User.php 1 patch
Unused Use Statements   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -8,8 +8,8 @@
 block discarded – undo
8 8
 
9 9
 namespace flipbox\organization\web\twig\variables;
10 10
 
11
-use flipbox\organization\elements\Organization;
12 11
 use flipbox\organization\Organization as OrganizationPlugin;
12
+use flipbox\organization\elements\Organization;
13 13
 
14 14
 /**
15 15
  * @author Flipbox Factory <[email protected]>
Please login to merge, or discard this patch.
src/controllers/UserIndexesController.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -80,7 +80,7 @@  discard block
 block discarded – undo
80 80
         Event::on(
81 81
             User::class,
82 82
             User::EVENT_REGISTER_ACTIONS,
83
-            function (RegisterElementActionsEvent $event) {
83
+            function(RegisterElementActionsEvent $event) {
84 84
                 if ($event->source == '*') {
85 85
                     $event->actions = [
86 86
                         [
@@ -99,7 +99,7 @@  discard block
 block discarded – undo
99 99
         Event::on(
100 100
             User::class,
101 101
             User::EVENT_REGISTER_SOURCES,
102
-            function (RegisterElementSourcesEvent $event) {
102
+            function(RegisterElementSourcesEvent $event) {
103 103
                 if ($event->context == 'index') {
104 104
                     $event->sources = [
105 105
                         [
Please login to merge, or discard this patch.
src/Organization.php 2 patches
Unused Use Statements   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -16,8 +16,8 @@
 block discarded – undo
16 16
 use craft\models\FieldLayout as FieldLayoutModel;
17 17
 use craft\services\Elements;
18 18
 use craft\services\Fields;
19
-use craft\web\twig\variables\CraftVariable;
20 19
 use craft\web\UrlManager;
20
+use craft\web\twig\variables\CraftVariable;
21 21
 use flipbox\organization\controllers\OrganizationController;
22 22
 use flipbox\organization\elements\Organization as OrganizationElement;
23 23
 use flipbox\organization\fields\Organization as OrganizationField;
Please login to merge, or discard this patch.
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -61,7 +61,7 @@  discard block
 block discarded – undo
61 61
         Event::on(
62 62
             Fields::class,
63 63
             Fields::EVENT_REGISTER_FIELD_TYPES,
64
-            function (RegisterComponentTypesEvent $event) {
64
+            function(RegisterComponentTypesEvent $event) {
65 65
                 $event->types[] = OrganizationField::class;
66 66
                 $event->types[] = UserField::class;
67 67
             }
@@ -71,7 +71,7 @@  discard block
 block discarded – undo
71 71
         Event::on(
72 72
             Elements::class,
73 73
             Elements::EVENT_REGISTER_ELEMENT_TYPES,
74
-            function (RegisterComponentTypesEvent $event) {
74
+            function(RegisterComponentTypesEvent $event) {
75 75
                 $event->types[] = OrganizationElement::class;
76 76
             }
77 77
         );
@@ -87,7 +87,7 @@  discard block
 block discarded – undo
87 87
         Event::on(
88 88
             CraftVariable::class,
89 89
             CraftVariable::EVENT_INIT,
90
-            function (Event $event) {
90
+            function(Event $event) {
91 91
                 /** @var CraftVariable $variable */
92 92
                 $variable = $event->sender;
93 93
                 $variable->set('organization', OrganizationVariable::class);
Please login to merge, or discard this patch.