Completed
Push — master ( 818991...ace19a )
by Corey
03:14
created
site/controllers/CustomBehaviorController.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -42,7 +42,7 @@  discard block
 block discarded – undo
42 42
 
43 43
   public function actions() {
44 44
     return array_replace_recursive(parent::actions(), [
45
-      'update' => [  // identifier for your editable column action
45
+      'update' => [// identifier for your editable column action
46 46
         'class'           => EditableColumnAction::className(), // action class name
47 47
         'modelClass'      => CustoMBehavior::className(), // the model for the record being edited
48 48
         'scenario'        => CustomBehavior::SCENARIO_DEFAULT, // model scenario assigned before validation & update
@@ -52,7 +52,7 @@  discard block
 block discarded – undo
52 52
         'ajaxOnly'        => true,
53 53
         'findModel'       => function($id, $action) {
54 54
           $model = $this->findModel($id);
55
-          if($model !== null) {
55
+          if ($model !== null) {
56 56
             return $model;
57 57
           }
58 58
           throw new NotFoundHttpException('The specified behavior does not exist.');
@@ -64,13 +64,13 @@  discard block
 block discarded – undo
64 64
   public function actionCreate() {
65 65
     $form = Yii::$container->get(\site\models\CustomBehaviorForm::class, [Yii::$app->user->identity]);
66 66
 
67
-    if($form->load(Yii::$app->request->post()) && $form->validate()) {
67
+    if ($form->load(Yii::$app->request->post()) && $form->validate()) {
68 68
       $form->save();
69 69
       return $this->redirect(['profile/index']);
70 70
     }
71 71
 
72 72
     \Yii::$app->response->format = \yii\web\Response::FORMAT_JSON;
73
-    if($errors = $form->getErrorSummary(true)) {
73
+    if ($errors = $form->getErrorSummary(true)) {
74 74
       return $errors;
75 75
     } else {
76 76
       return ["success" => false, "message" => "Unknown Error"];
@@ -85,7 +85,7 @@  discard block
 block discarded – undo
85 85
 
86 86
   protected function findModel($id) {
87 87
     $model = CustomBehavior::find()->where(['id' => $id, 'user_id' => Yii::$app->user->id])->one();
88
-    if($model !== null) {
88
+    if ($model !== null) {
89 89
       return $model;
90 90
     }
91 91
 
Please login to merge, or discard this patch.