DesarrollosWeb/documentofacil

View on GitHub
gestoria/Payment.php

Summary

Maintainability
A
0 mins
Test Coverage

Showing 8 of 8 total issues

Avoid using static access to class '\Stripe\PaymentIntent' in method 'create_payment_intent'.
Open

return PaymentIntent::create([
'description' => $info["description"],
'amount' => filter_var($info["amount"], FILTER_SANITIZE_NUMBER_FLOAT),
'currency' => 'eur',
'metadata' => ['integration_check' => 'accept_a_payment'],
Severity: Minor
Found in gestoria/Payment.php by phpmd

Avoid using static access to class '\Stripe\Stripe' in method 'create_payment_intent'.
Open

Stripe::setApiKey(STRIPE_API_SECRET);
Severity: Minor
Found in gestoria/Payment.php by phpmd

syntax error, unexpected '?', expecting function (T_FUNCTION) or const (T_CONST)
Open

private static ?Payment $instance = null;
Severity: Critical
Found in gestoria/Payment.php by phan

Each class must be in a namespace of at least one level (a top-level vendor name)
Open

class Payment
Severity: Minor
Found in gestoria/Payment.php by phpcodesniffer

A file should declare new symbols (classes, functions, constants, etc.) and cause no other side effects, or it should execute logic with side effects, but should not do both. The first symbol is defined on line 10 and the first side effect is on line 7.
Open

<?php
Severity: Minor
Found in gestoria/Payment.php by phpcodesniffer

Method name "Payment::create_payment_intent" is not in camel caps format
Open

public static function create_payment_intent(array $info)
Severity: Minor
Found in gestoria/Payment.php by phpcodesniffer

Expected 1 newline at end of file; 0 found
Open

}
Severity: Minor
Found in gestoria/Payment.php by phpcodesniffer

The method create_payment_intent is not named in camelCase.
Open

public static function create_payment_intent(array $info)
{
Stripe::setApiKey(STRIPE_API_SECRET);
try {
return PaymentIntent::create([
Severity: Minor
Found in gestoria/Payment.php by phpmd

There are no issues that match your filters.

Category
Status