core-bundle/src/Command/UserPasswordCommand.php
protected function interact(InputInterface $input, OutputInterface $output): void
    {
        if (null === $input->getArgument('username')) {
            throw new InvalidArgumentException('Please provide the username as argument.');
        }

        if (null !== $input->getOption('password')) {
            return;
        }

        $password = $this->askForPassword('Please enter the new password:', $input, $output);
        $confirm = $this->askForPassword('Please confirm the password:', $input, $output);

        if ($password !== $confirm) {
            throw new RuntimeException('The passwords do not match.');
        }

        $input->setOption('password', $password);
    }
protected function interact(InputInterface $input, OutputInterface $output): void
    {
        if (null === $input->getArgument('username')) {
            throw new InvalidArgumentException('Please provide the username as argument.');
        }

        if (null !== $input->getOption('password')) {
            return;
        }

        $password = $this->askForPassword('Please enter the new password:', $input, $output);
        $confirm = $this->askForPassword('Please confirm the password:', $input, $output);

        if ($password !== $confirm) {
            throw new RuntimeException('The passwords do not match.');
        }

        $input->setOption('password', $password);
    }
protected function interact ( InputInterface $ input , OutputInterface $ output ) : void { if ( null === $ input -> getArgument ( 'username' ) ) { throw new InvalidArgumentException ( 'Please provide the username as argument.' ) ; } if ( null !== $ input -> getOption ( 'password' ) ) { return ; } $ password = $ this -> askForPassword ( 'Please enter the new password:' , $ input , $ output ) ; $ confirm = $ this -> askForPassword ( 'Please confirm the password:' , $ input , $ output ) ; if ( $ password !== $ confirm ) { throw new RuntimeException ( 'The passwords do not match.' ) ; } $ input -> setOption ( 'password' , $ password ) ; }
{@inheritdoc}
{