| @@ -25,6 +25,6 @@ | ||
| 25 | 25 | protected function schedule(Schedule $schedule) | 
| 26 | 26 |      { | 
| 27 | 27 |          $schedule->command('inspire') | 
| 28 | - ->hourly(); | |
| 28 | + ->hourly(); | |
| 29 | 29 | } | 
| 30 | 30 | } | 
| @@ -1,21 +1,21 @@ | ||
| 1 | 1 | <?php | 
| 2 | 2 | /** | 
| 3 | - * Created by PhpStorm. | |
| 4 | - * User: Claudio Cardinale <[email protected]> | |
| 5 | - * Date: 24/11/15 | |
| 6 | - * Time: 21.58 | |
| 7 | - * This program is free software; you can redistribute it and/or | |
| 8 | - * modify it under the terms of the GNU General Public License | |
| 9 | - * as published by the Free Software Foundation; either version 2 | |
| 10 | - * of the License, or (at your option) any later version. | |
| 11 | - * This program is distributed in the hope that it will be useful, | |
| 12 | - * but WITHOUT ANY WARRANTY; without even the implied warranty of | |
| 13 | - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
| 14 | - * GNU General Public License for more details. | |
| 15 | - * You should have received a copy of the GNU General Public License | |
| 16 | - * along with this program; if not, write to the Free Software | |
| 17 | - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. | |
| 18 | - */ | |
| 3 | + * Created by PhpStorm. | |
| 4 | + * User: Claudio Cardinale <[email protected]> | |
| 5 | + * Date: 24/11/15 | |
| 6 | + * Time: 21.58 | |
| 7 | + * This program is free software; you can redistribute it and/or | |
| 8 | + * modify it under the terms of the GNU General Public License | |
| 9 | + * as published by the Free Software Foundation; either version 2 | |
| 10 | + * of the License, or (at your option) any later version. | |
| 11 | + * This program is distributed in the hope that it will be useful, | |
| 12 | + * but WITHOUT ANY WARRANTY; without even the implied warranty of | |
| 13 | + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
| 14 | + * GNU General Public License for more details. | |
| 15 | + * You should have received a copy of the GNU General Public License | |
| 16 | + * along with this program; if not, write to the Free Software | |
| 17 | + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. | |
| 18 | + */ | |
| 19 | 19 | |
| 20 | 20 | namespace plunner; | 
| 21 | 21 | |
| @@ -46,7 +46,7 @@ | ||
| 46 | 46 | * | 
| 47 | 47 | * @var string | 
| 48 | 48 | */ | 
| 49 | - //protected $table = 'employees'; | |
| 49 | + //protected $table = 'employees'; | |
| 50 | 50 | |
| 51 | 51 | /** | 
| 52 | 52 | * The attributes that are mass assignable. | 
| @@ -109,14 +109,16 @@ discard block | ||
| 109 | 109 | public function getEmailForPasswordReset() | 
| 110 | 110 |      { | 
| 111 | 111 | list(, $caller) = debug_backtrace(false); | 
| 112 | - if(isset($caller['class'])) | |
| 113 | -            $caller = explode('\\', $caller['class']); | |
| 114 | - else | |
| 115 | - $caller = ''; | |
| 112 | +        if(isset($caller['class'])) { | |
| 113 | +                    $caller = explode('\\', $caller['class']); | |
| 114 | +        } else { | |
| 115 | + $caller = ''; | |
| 116 | + } | |
| 116 | 117 | |
| 117 | 118 | //check if this function is called by email sender | 
| 118 | -        if ((count($caller) && $caller[count($caller) - 1] == 'PasswordBroker') || (defined('HHVM_VERSION') && $caller == '')) | |
| 119 | - return $this->email; | |
| 119 | +        if ((count($caller) && $caller[count($caller) - 1] == 'PasswordBroker') || (defined('HHVM_VERSION') && $caller == '')) { | |
| 120 | + return $this->email; | |
| 121 | + } | |
| 120 | 122 | //return unique identify for token repository | 
| 121 | 123 | return $this->email . $this->company->id; | 
| 122 | 124 | } | 
| @@ -128,8 +130,9 @@ discard block | ||
| 128 | 130 | public function belongsToGroup(Group $group) | 
| 129 | 131 |      { | 
| 130 | 132 |          $group = $this->groups()->where('id', $group->id)->first(); | 
| 131 | - if(is_object($group) && $group->exists) | |
| 132 | - return true; | |
| 133 | +        if(is_object($group) && $group->exists) { | |
| 134 | + return true; | |
| 135 | + } | |
| 133 | 136 | return false; | 
| 134 | 137 | } | 
| 135 | 138 | |
| @@ -51,8 +51,9 @@ | ||
| 51 | 51 | |
| 52 | 52 | public function getPlannerNameAttribute() | 
| 53 | 53 |      { | 
| 54 | - if(is_object($this->planner) && $this->planner->exists) | |
| 55 | - return $this->planner->name; | |
| 54 | +        if(is_object($this->planner) && $this->planner->exists) { | |
| 55 | + return $this->planner->name; | |
| 56 | + } | |
| 56 | 57 | } | 
| 57 | 58 | |
| 58 | 59 | /** | 
| @@ -71,8 +71,9 @@ | ||
| 71 | 71 | $employee = Employee::findOrFail($employeeId); | 
| 72 | 72 | $this->authorize($employee); | 
| 73 | 73 | $group = Group::findOrFail($groupId); | 
| 74 | - if(!$employee->belongsToGroup($group)) | |
| 75 | - return Response::json(['error' => 'employId <> groupId'],404); | |
| 74 | +        if(!$employee->belongsToGroup($group)) { | |
| 75 | + return Response::json(['error' => 'employId <> groupId'],404); | |
| 76 | + } | |
| 76 | 77 | $employee->groups()->detach($groupId); | 
| 77 | 78 | return $group->employees; | 
| 78 | 79 | } | 
| @@ -53,8 +53,9 @@ discard block | ||
| 53 | 53 | // | 
| 54 | 54 | $company = \Auth::user(); | 
| 55 | 55 | $input = $request->all(); | 
| 56 | - if(isset($input['password'])) | |
| 57 | - $input['password'] = bcrypt($input['password']); | |
| 56 | +        if(isset($input['password'])) { | |
| 57 | + $input['password'] = bcrypt($input['password']); | |
| 58 | + } | |
| 58 | 59 | $employee = $company->employees()->create($input); | 
| 59 | 60 | return $employee; | 
| 60 | 61 | } | 
| @@ -86,8 +87,9 @@ discard block | ||
| 86 | 87 | $employee = Employee::findOrFail($id); | 
| 87 | 88 | $this->authorize($employee); | 
| 88 | 89 | $input = $request->all(); | 
| 89 | - if(isset($input['password'])) | |
| 90 | - $input['password'] = bcrypt($input['password']); | |
| 90 | +        if(isset($input['password'])) { | |
| 91 | + $input['password'] = bcrypt($input['password']); | |
| 92 | + } | |
| 91 | 93 | $employee->update($input); | 
| 92 | 94 | return $employee; | 
| 93 | 95 | } |