Psalm code cleanup

This commit is contained in:
David Bomba 2020-11-04 00:34:24 +11:00
parent 13a00fc897
commit d762c5e842
6 changed files with 17 additions and 14 deletions

View File

@ -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
{ {

View File

@ -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()));
} // }
} }
} }

View File

@ -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
{ {

View File

@ -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;

View File

@ -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();
}); });

View File

@ -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>