updatePasswordPolicy   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 42
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
eloc 11
c 0
b 0
f 0
dl 0
loc 42
rs 10
wmc 2

2 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 4 1
A handle() 0 10 1
1
<?php
2
3
namespace App\Console\Commands;
4
5
use App\Models\Security_user;
6
use Illuminate\Console\Command;
7
use Illuminate\Support\Facades\DB;
8
9
class updatePasswordPolicy extends Command
10
{
11
    /**
12
     * The name and signature of the console command.
13
     *
14
     * @var string
15
     */
16
    protected $signature = 'password:update';
17
18
    /**
19
     * The console command description.
20
     *
21
     * @var string
22
     */
23
    protected $description = 'Update password policy';
24
25
    /**
26
     * Create a new command instance.
27
     *
28
     * @return void
29
     */
30
    public function __construct()
31
    {
32
        parent::__construct();
33
        $this->security_users = new Security_user();
0 ignored issues
show
Bug Best Practice introduced by
The property security_users does not exist. Although not strictly required by PHP, it is generally a best practice to declare properties explicitly.
Loading history...
34
    }
35
36
    /**
37
     * Execute the console command.
38
     *
39
     * @return mixed
40
     */
41
    public function handle()
42
    {
43
        $output = new \Symfony\Component\Console\Output\ConsoleOutput();
44
        $output->writeln('##############################################------Updating file records------###########################################');
45
46
        DB::table('security_users')
47
            ->where('is_student', '=', '0')
48
            ->update(['security_timeout' => '2019-12-01']);
49
50
        $output->writeln('################################################------Records Updated------###############################################');
51
    }
52
}
53