mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2024-11-09 20:52:56 +01:00
Psalm code cleanup
This commit is contained in:
parent
13a00fc897
commit
d762c5e842
@ -28,7 +28,7 @@ class CompanyRepository extends BaseRepository
|
||||
*
|
||||
* @param array $data The data
|
||||
* @param Company $company
|
||||
* @return Client|Company|null Company Object
|
||||
* @return Company|null Company Object
|
||||
*/
|
||||
public function save(array $data, Company $company) : ?Company
|
||||
{
|
||||
|
@ -34,8 +34,8 @@ class DocumentRepository extends BaseRepository
|
||||
|
||||
$document->restore();
|
||||
|
||||
if (class_exists($className)) {
|
||||
event(new $className($document, $document->company, Ninja::eventVars()));
|
||||
}
|
||||
// if (class_exists($className)) {
|
||||
// event(new $className($document, $document->company, Ninja::eventVars()));
|
||||
// }
|
||||
}
|
||||
}
|
||||
|
@ -28,10 +28,10 @@ class ExpenseRepository extends BaseRepository
|
||||
/**
|
||||
* Saves the expense and its contacts.
|
||||
*
|
||||
* @param array $data The data
|
||||
* @param \App\Models\expense $expense The expense
|
||||
* @param array $data The data
|
||||
* @param \App\Models\Expense $expense The expense
|
||||
*
|
||||
* @return expense|null expense Object
|
||||
* @return \App\Models\Expense|Null expense Object
|
||||
*/
|
||||
public function save(array $data, Expense $expense) : ?Expense
|
||||
{
|
||||
@ -50,7 +50,7 @@ class ExpenseRepository extends BaseRepository
|
||||
* Store expenses in bulk.
|
||||
*
|
||||
* @param array $expense
|
||||
* @return expense|null
|
||||
* @return \App\Models\Expense|null
|
||||
*/
|
||||
public function create($expense): ?Expense
|
||||
{
|
||||
|
@ -66,18 +66,16 @@ class InvoiceRepository extends BaseRepository
|
||||
* ie. invoice can be deleted from a business logic perspective.
|
||||
*
|
||||
* @param Invoice $invoice
|
||||
* @return void $invoice
|
||||
* @return Invoice $invoice
|
||||
*/
|
||||
public function delete($invoice)
|
||||
public function delete($invoice) :Invoice
|
||||
{
|
||||
if ($invoice->is_deleted) {
|
||||
return;
|
||||
return $invoice;
|
||||
}
|
||||
|
||||
$invoice->service()->markDeleted()->handleCancellation()->save();
|
||||
|
||||
|
||||
|
||||
$invoice = parent::delete($invoice);
|
||||
|
||||
return $invoice;
|
||||
|
@ -100,7 +100,7 @@ class InvoiceMigrationRepository extends BaseRepository
|
||||
$invitations = collect($data['invitations']);
|
||||
|
||||
/* Get array of Keys which have been removed from the invitations array and soft delete each invitation */
|
||||
$model->invitations->pluck('key')->diff($invitations->pluck('key'))->each(function ($invitation) {
|
||||
$model->invitations->pluck('key')->diff($invitations->pluck('key'))->each(function ($invitation) use($resource){
|
||||
$this->getInvitation($invitation, $resource)->delete();
|
||||
});
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user