for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
namespace RichardStyles\EloquentEncryption\Console\Commands;
use Illuminate\Console\Command;
use RichardStyles\EloquentEncryption\EloquentEncryptionFacade;
class GenerateRsaKeys extends Command
{
/**
* The name and signature of the console command.
*
* @var string
*/
protected $signature = 'encrypt:generate';
* The console command description.
protected $description = 'This generates the application level RSA keys ' .
'which are used to encrypt the application data at rest';
* Create a new command instance.
* @return void
@return
Adding a @return annotation to a constructor is not recommended, since a constructor does not have a meaningful return value.
Please refer to the PHP core documentation on constructors.
public function __construct()
parent::__construct();
}
* Execute the console command.
* @return mixed
public function handle()
// check for existing keys - do not overwrite
if(EloquentEncryptionFacade::exists()){
$this->warn('Application RSA keys are already set');
$this->warn('**********************************************************************');
$this->warn('* If you reset your keys you will lose access to any encrypted data. *');
if ($this->confirm('Do you wish to reset your encryption keys?') === false) {
$this->info('RSA Keys have not been overwritten');
return;
$this->info('Creating RSA Keys for Application');
EloquentEncryptionFacade::makeEncryptionKeys();
makeEncryptionKeys()
RichardStyles\EloquentEn...loquentEncryptionFacade
encrypt()
This check marks calls to methods that do not seem to exist on an object.
This is most likely the result of a method being renamed without all references to it being renamed likewise.
Adding a
@return
annotation to a constructor is not recommended, since a constructor does not have a meaningful return value.Please refer to the PHP core documentation on constructors.