File Webhooks.php
has 362 lines of code (exceeds 250 allowed). Consider refactoring. Open
<?php
namespace VindiPaymentGateways;
use WC_Subscriptions_Manager;
The class VindiWebhooks has an overall complexity of 74 which is very high. The configured complexity threshold is 50. Open
class VindiWebhooks
{
/**
* @var VindiSettings
*/
- Exclude checks
VindiWebhooks
has 26 functions (exceeds 20 allowed). Consider refactoring. Open
class VindiWebhooks
{
/**
* @var VindiSettings
*/
Method bill_paid
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
private function bill_paid($data)
{
try {
if (empty($data->bill->subscription)) {
$order = $this->find_order_by_id($data->bill->code);
Function bill_paid
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
private function bill_paid($data)
{
try {
if (empty($data->bill->subscription)) {
$order = $this->find_order_by_id($data->bill->code);
- Read upRead up
Cognitive Complexity
Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.
A method's cognitive complexity is based on a few simple rules:
- Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
- Code is considered more complex for each "break in the linear flow of the code"
- Code is considered more complex when "flow breaking structures are nested"
Further reading
Avoid using undefined variables such as '$subscriptionn_id' which will lead to PHP notices. Open
throw new Exception(sprintf(__('Pedido da assinatura #%s para o ciclo #%s não encontrado!', VINDI), $subscriptionn_id, $cycle), 2);
- Read upRead up
- Exclude checks
UndefinedVariable
Since: 2.8.0
Detects when a variable is used that has not been defined before.
Example
class Foo
{
private function bar()
{
// $message is undefined
echo $message;
}
}
Source https://phpmd.org/rules/cleancode.html#undefinedvariable
The method bill_paid uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them. Open
} else {
$vindi_subscription_id = $data->bill->subscription->id;
$cycle = $data->bill->period->cycle;
$order = $this->find_order_by_subscription_and_cycle($vindi_subscription_id, $cycle);
}
- Read upRead up
- Exclude checks
ElseExpression
Since: 1.4.0
An if expression with an else branch is basically not necessary. You can rewrite the conditions in a way that the else clause is not necessary and the code becomes simpler to read. To achieve this, use early return statements, though you may need to split the code it several smaller methods. For very simple assignments you could also use the ternary operations.
Example
class Foo
{
public function bar($flag)
{
if ($flag) {
// one branch
} else {
// another branch
}
}
}
Source https://phpmd.org/rules/cleancode.html#elseexpression
Avoid using static access to class '\WC_Subscriptions_Manager' in method 'subscription_renew'. Open
WC_Subscriptions_Manager::prepare_renewal($subscription->id);
- Read upRead up
- Exclude checks
StaticAccess
Since: 1.4.0
Static access causes unexchangeable dependencies to other classes and leads to hard to test code. Avoid using static access at all costs and instead inject dependencies through the constructor. The only case when static access is acceptable is when used for factory methods.
Example
class Foo
{
public function bar()
{
Bar::baz();
}
}
Source https://phpmd.org/rules/cleancode.html#staticaccess
The method bill_canceled uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them. Open
} else {
$vindi_subscription_id = $data->bill->subscription->id;
$cycle = $data->bill->period->cycle;
$order = $this->find_order_by_subscription_and_cycle($vindi_subscription_id, $cycle);
}
- Read upRead up
- Exclude checks
ElseExpression
Since: 1.4.0
An if expression with an else branch is basically not necessary. You can rewrite the conditions in a way that the else clause is not necessary and the code becomes simpler to read. To achieve this, use early return statements, though you may need to split the code it several smaller methods. For very simple assignments you could also use the ternary operations.
Example
class Foo
{
public function bar($flag)
{
if ($flag) {
// one branch
} else {
// another branch
}
}
}
Source https://phpmd.org/rules/cleancode.html#elseexpression
Avoid unused parameters such as '$data'. Open
private function test($data)
- Read upRead up
- Exclude checks
UnusedFormalParameter
Since: 0.2
Avoid passing parameters to methods or constructors and then not using those parameters.
Example
class Foo
{
private function bar($howdy)
{
// $howdy is not used
}
}
Source https://phpmd.org/rules/unusedcode.html#unusedformalparameter
The method handle() contains an exit expression. Open
die('invalid access token');
- Read upRead up
- Exclude checks
ExitExpression
Since: 0.2
An exit-expression within regular code is untestable and therefore it should be avoided. Consider to move the exit-expression into some kind of startup script where an error/exception code is returned to the calling environment.
Example
class Foo {
public function bar($param) {
if ($param === 42) {
exit(23);
}
}
}
Source https://phpmd.org/rules/design.html#exitexpression
The method handle() contains an exit expression. Open
die($e->getMessage());
- Read upRead up
- Exclude checks
ExitExpression
Since: 0.2
An exit-expression within regular code is untestable and therefore it should be avoided. Consider to move the exit-expression into some kind of startup script where an error/exception code is returned to the calling environment.
Example
class Foo {
public function bar($param) {
if ($param === 42) {
exit(23);
}
}
}
Source https://phpmd.org/rules/design.html#exitexpression
Avoid unused local variables such as '$subscriptionn_id'. Open
throw new Exception(sprintf(__('Pedido da assinatura #%s para o ciclo #%s não encontrado!', VINDI), $subscriptionn_id, $cycle), 2);
- Read upRead up
- Exclude checks
UnusedLocalVariable
Since: 0.2
Detects when a local variable is declared and/or assigned, but not used.
Example
class Foo {
public function doSomething()
{
$i = 5; // Unused
}
}
Source https://phpmd.org/rules/unusedcode.html#unusedlocalvariable
Avoid variables with short names like $id. Configured minimum length is 3. Open
private function find_order_by_id($id)
- Read upRead up
- Exclude checks
ShortVariable
Since: 0.2
Detects when a field, local, or parameter has a very short name.
Example
class Something {
private $q = 15; // VIOLATION - Field
public static function main( array $as ) { // VIOLATION - Formal
$r = 20 + $this->q; // VIOLATION - Local
for (int $i = 0; $i < 10; $i++) { // Not a Violation (inside FOR)
$r += $this->q;
}
}
}
Source https://phpmd.org/rules/naming.html#shortvariable
The property $vindi_settings is not named in camelCase. Open
class VindiWebhooks
{
/**
* @var VindiSettings
*/
- Read upRead up
- Exclude checks
CamelCasePropertyName
Since: 0.2
It is considered best practice to use the camelCase notation to name attributes.
Example
class ClassName {
protected $property_name;
}
Source
Avoid variables with short names like $id. Configured minimum length is 3. Open
private function find_bill_by_charge_id($id)
- Read upRead up
- Exclude checks
ShortVariable
Since: 0.2
Detects when a field, local, or parameter has a very short name.
Example
class Something {
private $q = 15; // VIOLATION - Field
public static function main( array $as ) { // VIOLATION - Formal
$r = 20 + $this->q; // VIOLATION - Local
for (int $i = 0; $i < 10; $i++) { // Not a Violation (inside FOR)
$r += $this->q;
}
}
}
Source https://phpmd.org/rules/naming.html#shortvariable
Opening brace indented incorrectly; expected 4 spaces, found 2 Open
{
- Exclude checks
Opening brace indented incorrectly; expected 4 spaces, found 2 Open
{
- Exclude checks
Opening brace indented incorrectly; expected 4 spaces, found 2 Open
{
- Exclude checks
Blank line found at start of control structure Open
if ($vindi_subscription && isset($vindi_subscription['next_billing_at'])) {
- Exclude checks
Opening brace indented incorrectly; expected 4 spaces, found 2 Open
{
- Exclude checks
Inline control structures are not allowed Open
if (null == $body || empty($body->event))
- Exclude checks
Inline control structures are not allowed Open
if (false === $query->have_posts())
- Exclude checks
Line exceeds 120 characters; contains 138 characters Open
throw new Exception(sprintf(__('Pedido da assinatura #%s para o ciclo #%s não encontrado!', VINDI), $subscriptionn_id, $cycle), 2);
- Exclude checks
Inline control structures are not allowed Open
if (empty($subscription))
- Exclude checks
Inline control structures are not allowed Open
if ('open' !== $issue_status)
- Exclude checks
Inline control structures are not allowed Open
if ('charge' !== $item_type)
- Exclude checks
Inline control structures are not allowed Open
if (false === $query->have_posts())
- Exclude checks
Inline control structures are not allowed Open
if ('charge_underpay' !== $issue_type)
- Exclude checks
Inline control structures are not allowed Open
if (empty($order))
- Exclude checks
Inline control structures are not allowed Open
if (empty($charge))
- Exclude checks
Line indented incorrectly; expected 4 spaces, found 2 Open
}
- Exclude checks
Line indented incorrectly; expected 8 spaces, found 4 Open
if (method_exists($this, $type)) {
- Exclude checks
Line indented incorrectly; expected 4 spaces, found 2 Open
}
- Exclude checks
Line indented incorrectly; expected at least 8 spaces, found 4 Open
$this->vindi_settings->logger->log(sprintf(__('Evento do webhook ignorado pelo plugin: ', VINDI), $type));
- Exclude checks
Line indented incorrectly; expected at least 8 spaces, found 6 Open
throw new Exception(__('Falha ao interpretar JSON do webhook: Evento do Webhook não encontrado!', VINDI));
- Exclude checks
Line indented incorrectly; expected 4 spaces, found 2 Open
private function process_event($body)
- Exclude checks
Line indented incorrectly; expected at least 8 spaces, found 4 Open
if (null == $body || empty($body->event))
- Exclude checks
Line indented incorrectly; expected at least 12 spaces, found 6 Open
return $this->{$type}($data);
- Exclude checks
Line indented incorrectly; expected 4 spaces, found 2 Open
}
- Exclude checks
Line indented incorrectly; expected at least 4 spaces, found 2 Open
{
- Exclude checks
Line indented incorrectly; expected 4 spaces, found 2 Open
private $vindi_settings;
- Exclude checks
Line indented incorrectly; expected at least 12 spaces, found 6 Open
$this->vindi_settings->logger->log(sprintf(__('Novo Evento processado: %s', VINDI), $type));
- Exclude checks
Line indented incorrectly; expected at least 8 spaces, found 6 Open
$this->routes = $vindi_settings->routes;
- Exclude checks
Line indented incorrectly; expected at least 4 spaces, found 2 Open
{
- Exclude checks
Line indented incorrectly; expected at least 8 spaces, found 4 Open
return $token === $this->vindi_settings->get_token();
- Exclude checks
Line indented incorrectly; expected at least 8 spaces, found 4 Open
$type = $body->event->type;
- Exclude checks
Line indented incorrectly; expected 8 spaces, found 4 Open
}
- Exclude checks
Line indented incorrectly; expected 4 spaces, found 2 Open
private function validate_access_token($token)
- Exclude checks
Line indented incorrectly; expected at least 4 spaces, found 2 Open
{
- Exclude checks
Line indented incorrectly; expected at least 8 spaces, found 4 Open
$data = $body->event->data;
- Exclude checks
Line indented incorrectly; expected at least 8 spaces, found 4 Open
$this->vindi_settings->logger->log(__('Evento de teste do webhook.', VINDI));
- Exclude checks
Line indented incorrectly; expected 4 spaces, found 2 Open
private $routes;
- Exclude checks
Line indented incorrectly; expected 4 spaces, found 2 Open
private function test($data)
- Exclude checks
Line indented incorrectly; expected at least 8 spaces, found 6 Open
$this->vindi_settings = $vindi_settings;
- Exclude checks
Line indented incorrectly; expected at least 4 spaces, found 2 Open
{
- Exclude checks
Line indented incorrectly; expected at least 8 spaces, found 4 Open
));
- Exclude checks
Line indented incorrectly; expected at least 8 spaces, found 6 Open
'post_type' => 'shop_order',
- Exclude checks
Line indented incorrectly; expected 12 spaces, found 6 Open
if (empty($data->bill->subscription)) {
- Exclude checks
Line indented incorrectly; expected at least 8 spaces, found 6 Open
$order->id,
- Exclude checks
Line indented incorrectly; expected at least 4 spaces, found 2 Open
{
- Exclude checks
Line indented incorrectly; expected at least 8 spaces, found 4 Open
return wc_get_order($query->post->ID);
- Exclude checks
Line indented incorrectly; expected at least 12 spaces, found 6 Open
$subscription->update_dates(array('next_payment' => $next_payment));
- Exclude checks
Line indented incorrectly; expected 8 spaces, found 4 Open
}
- Exclude checks
Line indented incorrectly; expected 4 spaces, found 2 Open
}
- Exclude checks
Multi-line function call not indented correctly; expected 10 spaces but found 8 Open
__('Já existe o ciclo %s para a assinatura #%s pedido #%s!', VINDI),
- Exclude checks
Line indented incorrectly; expected at least 8 spaces, found 4 Open
$issue_status = $data->issue->status;
- Exclude checks
Line indented incorrectly; expected at least 8 spaces, found 4 Open
);
- Exclude checks
Line indented incorrectly; expected at least 8 spaces, found 4 Open
return wc_get_order($query->post->ID);
- Exclude checks
Line indented incorrectly; expected at least 8 spaces, found 6 Open
array(
- Exclude checks
Line indented incorrectly; expected at least 8 spaces, found 4 Open
return date('Y-m-d H:i:s', strtotime($date));
- Exclude checks
Line indented incorrectly; expected at least 8 spaces, found 4 Open
$order = $this->find_order_by_id($order_id);
- Exclude checks
Line indented incorrectly; expected at least 8 spaces, found 4 Open
$this->vindi_settings->logger->log('Novo Período criado: Pedido #'.$order->id);
- Exclude checks
Line indented incorrectly; expected at least 16 spaces, found 8 Open
$vindi_subscription_id = $data->bill->subscription->id;
- Exclude checks
Line indented incorrectly; expected at least 16 spaces, found 8 Open
$cycle = $data->bill->period->cycle;
- Exclude checks
Line indented incorrectly; expected at least 8 spaces, found 6 Open
throw new Exception(sprintf(__('Pendência criada com o status "%s" não processada!', VINDI), $issue_status));
- Exclude checks
Line indented incorrectly; expected at least 8 spaces, found 6 Open
throw new Exception(sprintf(__('Pendência criada com o item do tipo "%s" não processada!', VINDI), $item_type));
- Exclude checks
Line indented incorrectly; expected at least 8 spaces, found 4 Open
$item_id = (int) $data->issue->item_id;
- Exclude checks
Line indented incorrectly; expected at least 8 spaces, found 4 Open
$order = $this->find_order_by_bill_id($bill->id);
- Exclude checks
Line indented incorrectly; expected 8 spaces, found 6 Open
}
- Exclude checks
Line indented incorrectly; expected at least 8 spaces, found 4 Open
if (empty($order))
- Exclude checks
Line indented incorrectly; expected at least 8 spaces, found 6 Open
'meta_query' => $metas,
- Exclude checks
Line indented incorrectly; expected 8 spaces, found 4 Open
if ($vindi_subscription && isset($vindi_subscription['next_billing_at'])) {
- Exclude checks
Line indented incorrectly; expected at least 12 spaces, found 6 Open
$subscription = $this->find_subscription_by_id($data->bill->subscription->code);
- Exclude checks
Line indented incorrectly; expected at least 8 spaces, found 6 Open
__('Divergencia de valores do Pedido #%s: Valor Esperado R$ %s, Valor Pago R$ %s.', VINDI),
- Exclude checks
Line indented incorrectly; expected at least 8 spaces, found 4 Open
$subscription = wcs_get_subscription(end($sanitized_id));
- Exclude checks
Line indented incorrectly; expected at least 4 spaces, found 2 Open
{
- Exclude checks
Line indented incorrectly; expected at least 8 spaces, found 4 Open
$args = array(
- Exclude checks
Line indented incorrectly; expected at least 8 spaces, found 6 Open
'meta_key' => 'vindi_bill_id',
- Exclude checks
Line indented incorrectly; expected at least 8 spaces, found 4 Open
$query = $this->query_order_by_metas(array(
- Exclude checks
Line indented incorrectly; expected at least 8 spaces, found 4 Open
return $query->have_posts();
- Exclude checks
Line indented incorrectly; expected at least 8 spaces, found 6 Open
'post_status' => 'any',
- Exclude checks
Line indented incorrectly; expected at least 12 spaces, found 8 Open
$renew_infos['vindi_subscription_id'],
- Exclude checks
Line indented incorrectly; expected at least 16 spaces, found 8 Open
$order = $this->find_order_by_subscription_and_cycle($vindi_subscription_id, $cycle);
- Exclude checks
Line indented incorrectly; expected at least 8 spaces, found 4 Open
$issue_type = $data->issue->issue_type;
- Exclude checks
Line indented incorrectly; expected at least 8 spaces, found 6 Open
$issue_data->transaction_amount
- Exclude checks
Line indented incorrectly; expected at least 8 spaces, found 4 Open
$charge = $this->routes->getCharge($id);
- Exclude checks
Line indented incorrectly; expected at least 8 spaces, found 6 Open
throw new Exception(sprintf(__('Cobrança #%s não encontrada!', VINDI), $id), 2);
- Exclude checks
Line indented incorrectly; expected at least 8 spaces, found 6 Open
array(
- Exclude checks
Line indented incorrectly; expected at least 12 spaces, found 6 Open
$end_date = $this->format_date($end_at);
- Exclude checks
Line indented incorrectly; expected 8 spaces, found 4 Open
}
- Exclude checks
Line indented incorrectly; expected at least 8 spaces, found 4 Open
$subscription_id = $renew_infos['vindi_subscription_id'];
- Exclude checks
Line indented incorrectly; expected at least 8 spaces, found 4 Open
$order->add_order_note(sprintf(
- Exclude checks
Line indented incorrectly; expected at least 8 spaces, found 4 Open
));
- Exclude checks
Line indented incorrectly; expected 8 spaces, found 6 Open
try {
- Exclude checks
Line indented incorrectly; expected at least 8 spaces, found 4 Open
if (empty($subscription))
- Exclude checks
Line indented incorrectly; expected at least 8 spaces, found 6 Open
'post_status' => 'any',
- Exclude checks
Line indented incorrectly; expected at least 8 spaces, found 4 Open
$query = $this->query_order_by_metas(array(
- Exclude checks
Line indented incorrectly; expected at least 8 spaces, found 6 Open
),
- Exclude checks
Line indented incorrectly; expected at least 16 spaces, found 8 Open
return false;
- Exclude checks
Line indented incorrectly; expected 4 spaces, found 2 Open
private function format_date($date)
- Exclude checks
Line indented incorrectly; expected at least 12 spaces, found 8 Open
__('Já existe o ciclo %s para a assinatura #%s pedido #%s!', VINDI),
- Exclude checks
Line indented incorrectly; expected 4 spaces, found 2 Open
}
- Exclude checks
Line indented incorrectly; expected at least 8 spaces, found 4 Open
return $subscription;
- Exclude checks
Line indented incorrectly; expected at least 8 spaces, found 4 Open
return new WP_Query($args);
- Exclude checks
Line indented incorrectly; expected at least 8 spaces, found 4 Open
$vindi_subscription = $this->routes->getSubscription($data->bill->subscription->id);
- Exclude checks
Line indented incorrectly; expected at least 8 spaces, found 4 Open
$subscription = $this->find_subscription_by_id($renew_infos['wc_subscription_id']);
- Exclude checks
Line indented incorrectly; expected at least 4 spaces, found 2 Open
{
- Exclude checks
Line indented incorrectly; expected at least 12 spaces, found 8 Open
$subscription->get_last_order()
- Exclude checks
Line indented incorrectly; expected at least 8 spaces, found 4 Open
remove_action('woocommerce_scheduled_subscription_payment', 'WC_Subscriptions_Manager::prepare_renewal');
- Exclude checks
Line indented incorrectly; expected at least 16 spaces, found 14 Open
$order = $this->find_order_by_id($data->bill->code);
- Exclude checks
Line indented incorrectly; expected 12 spaces, found 6 Open
}
- Exclude checks
Line indented incorrectly; expected at least 8 spaces, found 4 Open
$item_type = strtolower($data->issue->item_type);
- Exclude checks
Line indented incorrectly; expected at least 8 spaces, found 4 Open
if ('open' !== $issue_status)
- Exclude checks
Multi-line function call not indented correctly; expected 8 spaces but found 6 Open
__('Divergencia de valores do Pedido #%s: Valor Esperado R$ %s, Valor Pago R$ %s.', VINDI),
- Exclude checks
Line indented incorrectly; expected at least 8 spaces, found 6 Open
$issue_data->expected_amount,
- Exclude checks
Line indented incorrectly; expected at least 4 spaces, found 2 Open
{
- Exclude checks
Line indented incorrectly; expected at least 8 spaces, found 4 Open
$query = new WP_Query($args);
- Exclude checks
Line indented incorrectly; expected at least 8 spaces, found 4 Open
if (false === $query->have_posts())
- Exclude checks
Line indented incorrectly; expected at least 12 spaces, found 6 Open
$next_billing_at = $vindi_subscription['next_billing_at'];
- Exclude checks
Line indented incorrectly; expected 12 spaces, found 6 Open
if ($end_at != null && $next_billing_at > $end_at) {
- Exclude checks
Line indented incorrectly; expected 8 spaces, found 4 Open
if ($this->subscription_has_order_in_cycle($renew_infos['vindi_subscription_id'], $renew_infos['cycle'])) {
- Exclude checks
Multi-line function call not indented correctly; expected 10 spaces but found 8 Open
$subscription->get_last_order()
- Exclude checks
Line indented incorrectly; expected at least 12 spaces, found 6 Open
));
- Exclude checks
Line indented incorrectly; expected at least 8 spaces, found 4 Open
$order_post_meta[$subscription_id]['product'] = $renew_infos['plan_name'];
- Exclude checks
Line indented incorrectly; expected 12 spaces, found 6 Open
} else {
- Exclude checks
Multi-line function call not indented correctly; expected 8 spaces but found 6 Open
$issue_data->expected_amount,
- Exclude checks
Line indented incorrectly; expected at least 8 spaces, found 4 Open
if (empty($charge))
- Exclude checks
Line indented incorrectly; expected 4 spaces, found 2 Open
}
- Exclude checks
Line indented incorrectly; expected 4 spaces, found 2 Open
private function find_order_by_id($id)
- Exclude checks
Line indented incorrectly; expected at least 4 spaces, found 2 Open
{
- Exclude checks
Multi-line function call not indented correctly; expected 10 spaces but found 8 Open
$renew_infos['vindi_subscription_id'],
- Exclude checks
Line indented incorrectly; expected at least 8 spaces, found 4 Open
$order_id = $subscription->get_last_order();
- Exclude checks
Line indented incorrectly; expected 8 spaces, found 4 Open
try {
- Exclude checks
Line indented incorrectly; expected 8 spaces, found 4 Open
}
- Exclude checks
Line indented incorrectly; expected at least 4 spaces, found 2 Open
{
- Exclude checks
Line indented incorrectly; expected at least 8 spaces, found 4 Open
$order = wc_get_order($id);
- Exclude checks
Line indented incorrectly; expected at least 8 spaces, found 6 Open
'post_type' => 'shop_order',
- Exclude checks
Line indented incorrectly; expected at least 12 spaces, found 8 Open
$renew_infos['cicle'],
- Exclude checks
Line indented incorrectly; expected 4 spaces, found 2 Open
private function bill_canceled($data)
- Exclude checks
Line indented incorrectly; expected 8 spaces, found 4 Open
} catch (Exception $e) {
- Exclude checks
Line indented incorrectly; expected at least 8 spaces, found 6 Open
throw new Exception(sprintf(__('Pendência criada com o tipo "%s" não processada!', VINDI), $issue_type));
- Exclude checks
Line indented incorrectly; expected at least 8 spaces, found 4 Open
$issue_data = $data->issue->data;
- Exclude checks
Multi-line function call not indented correctly; expected 8 spaces but found 6 Open
$order->id,
- Exclude checks
Line indented incorrectly; expected 4 spaces, found 2 Open
}
- Exclude checks
Line indented incorrectly; expected at least 4 spaces, found 2 Open
{
- Exclude checks
Line indented incorrectly; expected at least 8 spaces, found 4 Open
return (object) $charge['bill'];
- Exclude checks
Line indented incorrectly; expected at least 8 spaces, found 4 Open
);
- Exclude checks
Line indented incorrectly; expected at least 12 spaces, found 6 Open
throw new Exception(sprintf(
- Exclude checks
Multi-line function call not indented correctly; expected 10 spaces but found 8 Open
$renew_infos['cicle'],
- Exclude checks
Line indented incorrectly; expected at least 8 spaces, found 4 Open
$order_post_meta[$subscription_id]['cycle'] = $renew_infos['cycle'];
- Exclude checks
Line indented incorrectly; expected at least 12 spaces, found 6 Open
$order->update_status('cancelled', __('Pagamento cancelado dentro da Vindi!', VINDI));
- Exclude checks
Line indented incorrectly; expected 4 spaces, found 2 Open
private function issue_created($data)
- Exclude checks
Line indented incorrectly; expected at least 8 spaces, found 4 Open
return $order;
- Exclude checks
Line indented incorrectly; expected at least 8 spaces, found 6 Open
throw new Exception(sprintf(__('Pedido da assinatura #%s para o ciclo #%s não encontrado!', VINDI), $subscriptionn_id, $cycle), 2);
- Exclude checks
Line indented incorrectly; expected at least 12 spaces, found 6 Open
$subscription->update_dates(array('end_date' => $end_date));
- Exclude checks
Line indented incorrectly; expected at least 8 spaces, found 4 Open
WC_Subscriptions_Manager::prepare_renewal($subscription->id);
- Exclude checks
Line indented incorrectly; expected at least 4 spaces, found 2 Open
{
- Exclude checks
Line indented incorrectly; expected at least 8 spaces, found 4 Open
if ('charge_underpay' !== $issue_type)
- Exclude checks
Line indented incorrectly; expected at least 8 spaces, found 4 Open
$bill = $this->find_bill_by_charge_id($item_id);
- Exclude checks
Line indented incorrectly; expected 4 spaces, found 2 Open
private function find_bill_by_charge_id($id)
- Exclude checks
Line indented incorrectly; expected 4 spaces, found 2 Open
}
- Exclude checks
Line indented incorrectly; expected at least 8 spaces, found 6 Open
throw new Exception(sprintf(__('Pedido com bill_id #%s não encontrado!', VINDI), $bill_id), 2);
- Exclude checks
Line indented incorrectly; expected at least 12 spaces, found 6 Open
$end_at = $vindi_subscription['end_at'];
- Exclude checks
Multi-line function call not indented correctly; expected 8 spaces but found 6 Open
$issue_data->transaction_amount
- Exclude checks
Line indented incorrectly; expected 8 spaces, found 6 Open
} catch (Exception $e) {
- Exclude checks
Line indented incorrectly; expected at least 8 spaces, found 6 Open
'meta_value' => $bill_id,
- Exclude checks
Line indented incorrectly; expected at least 8 spaces, found 4 Open
if (false === $query->have_posts())
- Exclude checks
Line indented incorrectly; expected at least 8 spaces, found 4 Open
$args = array(
- Exclude checks
Line indented incorrectly; expected 12 spaces, found 6 Open
}
- Exclude checks
Line indented incorrectly; expected at least 16 spaces, found 8 Open
$order = $this->find_order_by_id($data->bill->code);
- Exclude checks
Line indented incorrectly; expected at least 8 spaces, found 4 Open
if ('charge' !== $item_type)
- Exclude checks
Line indented incorrectly; expected at least 8 spaces, found 6 Open
throw new Exception(sprintf(__('Pedido #%s não encontrado!', VINDI), $id), 2);
- Exclude checks
Line indented incorrectly; expected at least 8 spaces, found 6 Open
),
- Exclude checks
Line indented incorrectly; expected at least 8 spaces, found 4 Open
));
- Exclude checks
Line indented incorrectly; expected at least 12 spaces, found 6 Open
$next_payment = $this->format_date($next_billing_at);
- Exclude checks