Could not process "<path>/app/Admin/Payments/Resources/PaymentResource.php" file,
due to:
"Cannot get name on "PhpParser\Node\Expr\MethodCall" node. Use $node->name instead. Called in:
vendor/rector/rector/src/Rector/AbstractRector/NameResolverTrait.php:31".
<?php
namespace App\Admin\Payments\Resources;
use Illuminate\Http\Resources\Json\JsonResource;
/**
* @mixin \App\Domain\Payment\Models\Payment
*/
class PaymentResource extends JsonResource
{
public function toArray($request): array
{
return [
'id' => $this->id,
'checkout_url' => $this->checkout_url,
'status' => $this->status,
'used_provider' => $this->used_provider,
'has_errors' => $this->hasErrors(),
'payment_method' => $this->getPaymentMethod()::getName(),
'payment_method_identifier' => $this->getPaymentMethod()::getId(),
'is_paid' => $this->isPaid(),
'paid_at' => optional($this->paid_at)->format('d/m/Y h:i'),
'is_cancelled' => $this->isCancelled(),
'cancelled_at' => optional($this->canceled_at)->format('d/m/Y h:i'),
'is_failed' => $this->isFailed(),
'failed_at' => optional($this->failed_at)->format('d/m/Y h:i'),
'platform' => $this->platform,
'platform_type' => $this->platform_type,
'payment_url' => $this->getPaymentUrl(),
];
}
}
Current Behaviour
Minimal PHP Code Causing Issue