for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
namespace App\Jobs;
use Auth;
use File;
use Illuminate\Bus\Queueable;
use Illuminate\Contracts\Queue\ShouldQueue;
use Illuminate\Foundation\Bus\Dispatchable;
use Illuminate\Http\Request;
use Illuminate\Queue\InteractsWithQueue;
use Illuminate\Queue\SerializesModels;
use ModularSoftware\LaravelGedcom\Utils\GedcomGenerator;
class ExportGedCom implements ShouldQueue
{
use Dispatchable, InteractsWithQueue, Queueable, SerializesModels;
Illuminate\Queue\SerializesModels
App\Jobs\ExportGedCom
$id
$relations
$class
$keyBy
protected $family_id;
/**
* Create a new job instance.
*
* @return void
*/
public function __construct($family_id, Request $request)
$request
If this is a false-positive, you can also ignore this issue in your code via the ignore-unused annotation
ignore-unused
public function __construct($family_id, /** @scrutinizer ignore-unused */ Request $request)
This check looks for parameters that have been defined for a function or method, but which are not used in the method body.
//
$this->family_id = $family_id;
}
* Execute the job.
public function handle()
$headers = [
$headers
'Content-type' => 'text/txt',
];
$p_id = 0;
$f_id = $this->family_id;
$up_nest = 3;
$down_nest = 3;
$writer = new GedcomGenerator($p_id, $f_id, $up_nest, $down_nest);
$content = $writer->getGedcomPerson();
// $user_id = Auth::user()->id;
$ts = microtime(true);
$file = env('APP_NAME').date('_Ymd_').$ts.'.GED';
$destinationPath = public_path().'/upload/';
if (! is_dir($destinationPath)) {
mkdir($destinationPath, 0777, true);
File::put($destinationPath.$file, $content);
return 0;
return 0
integer
void