moe-lk /
bulk-upload
| 1 | <?php |
||
| 2 | |||
| 3 | namespace App\Console\Commands; |
||
| 4 | |||
| 5 | use App\Models\Institution_student; |
||
| 6 | use App\Models\Security_user; |
||
| 7 | use App\Models\Student_guardian; |
||
| 8 | use Illuminate\Console\Command; |
||
| 9 | |||
| 10 | class MapStudentArea extends Command |
||
| 11 | { |
||
| 12 | /** |
||
| 13 | * The name and signature of the console command. |
||
| 14 | * |
||
| 15 | * @var string |
||
| 16 | */ |
||
| 17 | protected $signature = 'update:student_area'; |
||
| 18 | |||
| 19 | /** |
||
| 20 | * The console command description. |
||
| 21 | * |
||
| 22 | * @var string |
||
| 23 | */ |
||
| 24 | protected $description = 'Command description'; |
||
| 25 | |||
| 26 | /** |
||
| 27 | * Create a new command instance. |
||
| 28 | * |
||
| 29 | * @return void |
||
| 30 | */ |
||
| 31 | public function __construct() |
||
| 32 | { |
||
| 33 | $this->output = new \Symfony\Component\Console\Output\ConsoleOutput(); |
||
|
0 ignored issues
–
show
|
|||
| 34 | parent::__construct(); |
||
| 35 | } |
||
| 36 | |||
| 37 | /** |
||
| 38 | * Execute the console command. |
||
| 39 | * |
||
| 40 | * @return mixed |
||
| 41 | */ |
||
| 42 | public function handle() |
||
| 43 | { |
||
| 44 | $students = Security_user::where('is_student',true)->get()->toArray(); |
||
| 45 | array_walk($students,array($this,'process')); |
||
| 46 | } |
||
| 47 | |||
| 48 | public function process($student){ |
||
| 49 | $student['student_id'] = $student['id']; |
||
| 50 | Institution_student::updateStudentArea($student); |
||
| 51 | $this->output->writeln('area updated for student:'. $student['openemis_no']) ; |
||
| 52 | } |
||
| 53 | } |
||
| 54 |
Our type inference engine has found an assignment to a property that is incompatible with the declared type of that property.
Either this assignment is in error or the assigned type should be added to the documentation/type hint for that property..