mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2025-06-04 05:44:36 -04:00
Set return type for hashedids
This commit is contained in:
parent
e0e0c238c6
commit
60a8348ac3
@ -11,22 +11,17 @@
|
|||||||
|
|
||||||
namespace App\Services\Quote;
|
namespace App\Services\Quote;
|
||||||
|
|
||||||
use App\Events\Quote\QuoteWasMarkedSent;
|
|
||||||
use App\Models\Quote;
|
|
||||||
use App\Models\Webhook;
|
|
||||||
use App\Utils\Ninja;
|
|
||||||
use Carbon\Carbon;
|
use Carbon\Carbon;
|
||||||
|
use App\Utils\Ninja;
|
||||||
|
use App\Models\Quote;
|
||||||
|
use App\Models\Client;
|
||||||
|
use App\Models\Webhook;
|
||||||
|
use App\Events\Quote\QuoteWasMarkedSent;
|
||||||
|
|
||||||
class MarkSent
|
class MarkSent
|
||||||
{
|
{
|
||||||
private $client;
|
public function __construct(private Client $client, private Quote $quote)
|
||||||
|
|
||||||
private $quote;
|
|
||||||
|
|
||||||
public function __construct($client, $quote)
|
|
||||||
{
|
{
|
||||||
$this->client = $client;
|
|
||||||
$this->quote = $quote;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public function run()
|
public function run()
|
||||||
@ -38,9 +33,9 @@ class MarkSent
|
|||||||
|
|
||||||
$this->quote->markInvitationsSent();
|
$this->quote->markInvitationsSent();
|
||||||
|
|
||||||
if ($this->quote->due_date != '' || $this->quote->client->getSetting('valid_until') == '') {
|
if ($this->quote->due_date != '' || $this->client->getSetting('valid_until') == '') {
|
||||||
} else {
|
} else {
|
||||||
$this->quote->due_date = Carbon::parse($this->quote->date)->addDays($this->quote->client->getSetting('valid_until'));
|
$this->quote->due_date = Carbon::parse($this->quote->date)->addDays($this->client->getSetting('valid_until'));
|
||||||
}
|
}
|
||||||
|
|
||||||
$this->quote
|
$this->quote
|
||||||
|
@ -62,7 +62,7 @@ trait MakesHash
|
|||||||
return $hashids->encode($value);
|
return $hashids->encode($value);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function decodePrimaryKey($value) : string
|
public function decodePrimaryKey($value) : int
|
||||||
{
|
{
|
||||||
try {
|
try {
|
||||||
$hashids = new Hashids(config('ninja.hash_salt'), 10);
|
$hashids = new Hashids(config('ninja.hash_salt'), 10);
|
||||||
@ -71,7 +71,6 @@ trait MakesHash
|
|||||||
|
|
||||||
if (! is_array($decoded_array)) {
|
if (! is_array($decoded_array)) {
|
||||||
throw new \Exception('Invalid Primary Key');
|
throw new \Exception('Invalid Primary Key');
|
||||||
//response()->json(['error'=>'Invalid primary key'], 400);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return $decoded_array[0];
|
return $decoded_array[0];
|
||||||
|
11
phpstan.neon
11
phpstan.neon
@ -1,15 +1,4 @@
|
|||||||
includes:
|
|
||||||
- ./vendor/nunomaduro/larastan/extension.neon
|
|
||||||
- phpstan-baseline.neon
|
|
||||||
parameters:
|
parameters:
|
||||||
treatPhpDocTypesAsCertain: false
|
|
||||||
parallel:
|
|
||||||
jobSize: 10
|
|
||||||
maximumNumberOfProcesses: 1
|
|
||||||
processTimeout: 60.0
|
|
||||||
ignoreErrors:
|
|
||||||
- '#Call to an undefined method .*badMethod\(\)#'
|
|
||||||
- '#Call to an undefined method Illuminate\Database\Eloquent\Builder::exclude#'
|
|
||||||
level: 4
|
level: 4
|
||||||
paths:
|
paths:
|
||||||
- 'app/'
|
- 'app/'
|
||||||
|
Loading…
x
Reference in New Issue
Block a user