Enhance phpstan

This commit is contained in:
Laurent Destailleur 2019-07-20 16:08:31 +02:00
parent f368ef377b
commit b6a1c92fc0
2 changed files with 31 additions and 33 deletions

View File

@ -778,40 +778,39 @@ if ($socid && $action != 'edit' && $action != 'create' && $action != 'editcard'
if ($conf->facture->enabled && $user->rights->facture->lire) $elementTypeArray['invoice']=$langs->transnoentitiesnoconv('Invoices');
if ($conf->contrat->enabled && $user->rights->contrat->lire) $elementTypeArray['contract']=$langs->transnoentitiesnoconv('Contracts');
if (! empty($conf->stripe->enabled))
{
$permissiontowrite = $user->rights->societe->creer;
// Stripe customer key 'cu_....' stored into llx_societe_account
print '<tr><td class="titlefield">';
//print $langs->trans('StripeCustomerId');
print $form->editfieldkey("StripeCustomerId", 'key_account', $stripecu, $object, $permissiontowrite, 'string', '', 0, 2, 'socid');
print '</td><td>';
//print $stripecu;
print $form->editfieldval("StripeCustomerId", 'key_account', $stripecu, $object, $permissiontowrite, 'string', '', null, null, '', 2, '', 'socid');
if (! empty($conf->stripe->enabled) && $stripecu && $action != 'editkey_account')
if (! empty($conf->stripe->enabled))
{
$connect='';
if (!empty($stripeacc)) $connect=$stripeacc.'/';
$url='https://dashboard.stripe.com/'.$connect.'test/customers/'.$stripecu;
if ($servicestatus)
$permissiontowrite = $user->rights->societe->creer;
// Stripe customer key 'cu_....' stored into llx_societe_account
print '<tr><td class="titlefield">';
//print $langs->trans('StripeCustomerId');
print $form->editfieldkey("StripeCustomerId", 'key_account', $stripecu, $object, $permissiontowrite, 'string', '', 0, 2, 'socid');
print '</td><td>';
//print $stripecu;
print $form->editfieldval("StripeCustomerId", 'key_account', $stripecu, $object, $permissiontowrite, 'string', '', null, null, '', 2, '', 'socid');
if (! empty($conf->stripe->enabled) && $stripecu && $action != 'editkey_account')
{
$url='https://dashboard.stripe.com/'.$connect.'customers/'.$stripecu;
$connect='';
if (!empty($stripeacc)) $connect=$stripeacc.'/';
$url='https://dashboard.stripe.com/'.$connect.'test/customers/'.$stripecu;
if ($servicestatus)
{
$url='https://dashboard.stripe.com/'.$connect.'customers/'.$stripecu;
}
print ' <a href="'.$url.'" target="_stripe">'.img_picto($langs->trans('ShowInStripe'), 'object_globe').'</a>';
}
print ' <a href="'.$url.'" target="_stripe">'.img_picto($langs->trans('ShowInStripe'), 'object_globe').'</a>';
print '</td><td class="right">';
if (empty($stripecu))
{
print '<form action="'.$_SERVER["PHP_SELF"].'" method="post">';
print '<input type="hidden" name="action" value="synccustomertostripe">';
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
print '<input type="hidden" name="socid" value="'.$object->id.'">';
print '<input type="submit" class="button" name="syncstripecustomer" value="'.$langs->trans("CreateCustomerOnStripe").'">';
print '</form>';
}
print '</td></tr>';
}
print '</td><td class="right">';
if (empty($stripecu))
{
print '<form action="'.$_SERVER["PHP_SELF"].'" method="post">';
print '<input type="hidden" name="action" value="synccustomertostripe">';
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
print '<input type="hidden" name="socid" value="'.$object->id.'">';
print '<input type="hidden" name="companybankid" value="'.$rib->id.'">';
print '<input type="submit" class="button" name="syncstripecustomer" value="'.$langs->trans("CreateCustomerOnStripe").'">';
print '</form>';
}
print '</td></tr>';
}
}
print '</table>';

View File

@ -139,9 +139,6 @@ parameters:
reportMagicMethods: false
reportMagicProperties: false
ignoreErrors:
-
message: '#Call to an undefined method abcdef#'
path: %currentWorkingDirectory%/dirtoignoreerror/*
- '#Undefined variable: \$langs#'
- '#Undefined variable: \$user#'
- '#Undefined variable: \$db#'
@ -150,6 +147,8 @@ parameters:
- '#Undefined variable: \$mysoc#'
- '#Undefined variable: \$error#'
- '#Undefined variable: \$errors#'
- message: '#Undefined variable: \$object#'
path: %currentWorkingDirectory%/htdocs/societe/tpl
internalErrorsCountLimit: 50
cache:
nodesByFileCountMax: 512