mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2025-06-01 04:04:47 -04: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 array $data The data
|
||||||
* @param Company $company
|
* @param Company $company
|
||||||
* @return Client|Company|null Company Object
|
* @return Company|null Company Object
|
||||||
*/
|
*/
|
||||||
public function save(array $data, Company $company) : ?Company
|
public function save(array $data, Company $company) : ?Company
|
||||||
{
|
{
|
||||||
|
@ -34,8 +34,8 @@ class DocumentRepository extends BaseRepository
|
|||||||
|
|
||||||
$document->restore();
|
$document->restore();
|
||||||
|
|
||||||
if (class_exists($className)) {
|
// if (class_exists($className)) {
|
||||||
event(new $className($document, $document->company, Ninja::eventVars()));
|
// event(new $className($document, $document->company, Ninja::eventVars()));
|
||||||
}
|
// }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -28,10 +28,10 @@ class ExpenseRepository extends BaseRepository
|
|||||||
/**
|
/**
|
||||||
* Saves the expense and its contacts.
|
* Saves the expense and its contacts.
|
||||||
*
|
*
|
||||||
* @param array $data The data
|
* @param array $data The data
|
||||||
* @param \App\Models\expense $expense The expense
|
* @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
|
public function save(array $data, Expense $expense) : ?Expense
|
||||||
{
|
{
|
||||||
@ -50,7 +50,7 @@ class ExpenseRepository extends BaseRepository
|
|||||||
* Store expenses in bulk.
|
* Store expenses in bulk.
|
||||||
*
|
*
|
||||||
* @param array $expense
|
* @param array $expense
|
||||||
* @return expense|null
|
* @return \App\Models\Expense|null
|
||||||
*/
|
*/
|
||||||
public function create($expense): ?Expense
|
public function create($expense): ?Expense
|
||||||
{
|
{
|
||||||
|
@ -66,18 +66,16 @@ class InvoiceRepository extends BaseRepository
|
|||||||
* ie. invoice can be deleted from a business logic perspective.
|
* ie. invoice can be deleted from a business logic perspective.
|
||||||
*
|
*
|
||||||
* @param Invoice $invoice
|
* @param Invoice $invoice
|
||||||
* @return void $invoice
|
* @return Invoice $invoice
|
||||||
*/
|
*/
|
||||||
public function delete($invoice)
|
public function delete($invoice) :Invoice
|
||||||
{
|
{
|
||||||
if ($invoice->is_deleted) {
|
if ($invoice->is_deleted) {
|
||||||
return;
|
return $invoice;
|
||||||
}
|
}
|
||||||
|
|
||||||
$invoice->service()->markDeleted()->handleCancellation()->save();
|
$invoice->service()->markDeleted()->handleCancellation()->save();
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
$invoice = parent::delete($invoice);
|
$invoice = parent::delete($invoice);
|
||||||
|
|
||||||
return $invoice;
|
return $invoice;
|
||||||
|
@ -100,7 +100,7 @@ class InvoiceMigrationRepository extends BaseRepository
|
|||||||
$invitations = collect($data['invitations']);
|
$invitations = collect($data['invitations']);
|
||||||
|
|
||||||
/* Get array of Keys which have been removed from the invitations array and soft delete each invitation */
|
/* 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();
|
$this->getInvitation($invitation, $resource)->delete();
|
||||||
});
|
});
|
||||||
|
|
||||||
|
@ -66,6 +66,11 @@
|
|||||||
<directory name="app" />
|
<directory name="app" />
|
||||||
</errorLevel>
|
</errorLevel>
|
||||||
</ImplementedReturnTypeMismatch>
|
</ImplementedReturnTypeMismatch>
|
||||||
|
<NoInterfaceProperties>
|
||||||
|
<errorLevel type="suppress">
|
||||||
|
<directory name="app" />
|
||||||
|
</errorLevel>
|
||||||
|
</NoInterfaceProperties>
|
||||||
|
|
||||||
|
|
||||||
</issueHandlers>
|
</issueHandlers>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user