PHP7 compatible function definitions.

This commit is contained in:
James Cole
2016-04-05 22:00:03 +02:00
parent b0b5d90976
commit 37fe2d22b0
56 changed files with 209 additions and 216 deletions

View File

@@ -38,7 +38,7 @@ class ExportJobRepository implements ExportJobRepositoryInterface
/**
* @return bool
*/
public function cleanup()
public function cleanup(): bool
{
$dayAgo = Carbon::create()->subDay();
$set = ExportJob::where('created_at', '<', $dayAgo->format('Y-m-d H:i:s'))
@@ -66,7 +66,7 @@ class ExportJobRepository implements ExportJobRepositoryInterface
/**
* @return ExportJob
*/
public function create()
public function create(): ExportJob
{
$exportJob = new ExportJob;
$exportJob->user()->associate($this->user);
@@ -81,11 +81,14 @@ class ExportJobRepository implements ExportJobRepositoryInterface
}
/**
*
* FIXME this may return null
*
* @param string $key
*
* @return ExportJob|null
*/
public function findByKey(string $key)
public function findByKey(string $key): ExportJob
{
return $this->user->exportJobs()->where('key', $key)->first();
}

View File

@@ -22,18 +22,18 @@ interface ExportJobRepositoryInterface
/**
* @return bool
*/
public function cleanup();
public function cleanup(): bool;
/**
* @return ExportJob
*/
public function create();
public function create(): ExportJob;
/**
* @param string $key
*
* @return ExportJob|null
*/
public function findByKey(string $key);
public function findByKey(string $key): ExportJob;
}