diff --git a/build/phpstan/bootstrap.php b/build/phpstan/bootstrap.php new file mode 100644 index 00000000000..7f232860a2b --- /dev/null +++ b/build/phpstan/bootstrap.php @@ -0,0 +1,15 @@ +file->dol_document_root as $key => $dirroot) // ex: array("main"=>"/home/main/htdocs", "alt0"=>"/home/dirmod/htdocs", ...) + if (is_array($conf->file->dol_document_root)) { - if ($key == 'main') + foreach ($conf->file->dol_document_root as $key => $dirroot) // ex: array("main"=>"/home/main/htdocs", "alt0"=>"/home/dirmod/htdocs", ...) { - continue; - } - if (file_exists($dirroot.'/'.$path)) - { - $res=$dirroot.'/'.$path; - return $res; + if ($key == 'main') + { + continue; + } + if (file_exists($dirroot.'/'.$path)) + { + $res=$dirroot.'/'.$path; + return $res; + } } } if ($returnemptyifnotfound) // Not found into alternate dir diff --git a/htdocs/main.inc.php b/htdocs/main.inc.php index f195d5f945e..4f7776a3150 100644 --- a/htdocs/main.inc.php +++ b/htdocs/main.inc.php @@ -1152,7 +1152,7 @@ function top_httphead($contenttype = 'text/html', $forcenocache = 0) $contentsecuritypolicy = $conf->global->MAIN_HTTP_CONTENT_SECURITY_POLICY; if (! is_object($hookmanager)) $hookmanager = new HookManager($db); - $hookmanager->initHooks("main"); + $hookmanager->initHooks(array("main")); $parameters=array('contentsecuritypolicy'=>$contentsecuritypolicy); $result=$hookmanager->executeHooks('setContentSecurityPolicy', $parameters); // Note that $action and $object may have been modified by some hooks @@ -1212,7 +1212,7 @@ function top_htmlhead($head, $title = '', $disablejs = 0, $disablehead = 0, $arr if (empty($disablehead)) { if (! is_object($hookmanager)) $hookmanager = new HookManager($db); - $hookmanager->initHooks("main"); + $hookmanager->initHooks(array("main")); $ext='layout='.$conf->browser->layout.'&version='.urlencode(DOL_VERSION); diff --git a/htdocs/societe/class/societeaccount.class.php b/htdocs/societe/class/societeaccount.class.php index 14b567a62e6..6f24471a295 100644 --- a/htdocs/societe/class/societeaccount.class.php +++ b/htdocs/societe/class/societeaccount.class.php @@ -20,7 +20,7 @@ */ /** - * \file class/societeaccount.class.php + * \file societe/class/societeaccount.class.php * \ingroup societe * \brief This file is a CRUD class file for SocieteAccount (Create/Read/Update/Delete) */ diff --git a/htdocs/societe/website.php b/htdocs/societe/website.php index 0a5c62b9afb..8f7c83dcef5 100644 --- a/htdocs/societe/website.php +++ b/htdocs/societe/website.php @@ -37,6 +37,12 @@ require_once DOL_DOCUMENT_ROOT.'/core/lib/company.lib.php'; $langs->loadLangs(array("companies","website")); +$action = GETPOST('action', 'aZ09')?GETPOST('action', 'aZ09'):'view'; // The action 'add', 'create', 'edit', 'update', 'view', ... +$show_files = GETPOST('show_files', 'int'); +$contextpage= GETPOST('contextpage', 'aZ')?GETPOST('contextpage', 'aZ'):'myobjectlist'; // To manage different context of search +$backtopage = GETPOST('backtopage', 'alpha'); // Go back to a dedicated page +$optioncss = GETPOST('optioncss', 'aZ'); // Option for the css output (always '' except when 'print') + $search_status=GETPOST('search_status'); // Security check @@ -340,14 +346,14 @@ $objecttmp=new SocieteAccount($db); $trackid='thi'.$object->id; include DOL_DOCUMENT_ROOT.'/core/tpl/massactions_pre.tpl.php'; -if ($sall) +/*if ($sall) { foreach($fieldstosearchall as $key => $val) $fieldstosearchall[$key]=$langs->trans($val); print '
'.$langs->trans("FilterOnInto", $sall) . join(', ', $fieldstosearchall).'
'; -} +}*/ -/*$moreforfilter = ''; -$moreforfilter.='
'; +$moreforfilter = ''; +/*$moreforfilter.='
'; $moreforfilter.= $langs->trans('MyFilter') . ': '; $moreforfilter.= '
';*/ diff --git a/phpstan.neon b/phpstan.neon index 1c35bd2faf3..aa7d4fbacc2 100644 --- a/phpstan.neon +++ b/phpstan.neon @@ -1,8 +1,27 @@ parameters: - bootstrap: null + bootstrap: %currentWorkingDirectory%/build/phpstan/bootstrap.php excludes_analyse: - - %rootDir%/htdocs/includes/* - autoload_directories: [] + - %currentWorkingDirectory%/htdocs/includes/* + autoload_directories: + - %currentWorkingDirectory%/htdocs/accountancy/class + - %currentWorkingDirectory%/htdocs/adherents/class + - %currentWorkingDirectory%/htdocs/api/class + - %currentWorkingDirectory%/htdocs/asset/class + - %currentWorkingDirectory%/htdocs/blockedlog/class + - %currentWorkingDirectory%/htdocs/bom/class + - %currentWorkingDirectory%/htdocs/bookmarks/class + - %currentWorkingDirectory%/htdocs/cashdesk/class + - %currentWorkingDirectory%/htdocs/categories/class + - %currentWorkingDirectory%/htdocs/comm/action/class + - %currentWorkingDirectory%/htdocs/comm/propal/class + - %currentWorkingDirectory%/htdocs/commande/class + - %currentWorkingDirectory%/htdocs/compta/bank/class + - %currentWorkingDirectory%/htdocs/conf + - %currentWorkingDirectory%/htdocs/contact/class + - %currentWorkingDirectory%/htdocs/contrat/class + - %currentWorkingDirectory%/htdocs/core/class + - %currentWorkingDirectory%/htdocs/societe/class + - %currentWorkingDirectory%/htdocs/user/class autoload_files: [] featureToggles: subtractableTypes: false @@ -30,7 +49,15 @@ parameters: polluteCatchScopeWithTryAssignments: false reportMagicMethods: false reportMagicProperties: false - ignoreErrors: [] + ignoreErrors: + - + message: '#Call to an undefined method abcdef#' + path: %currentWorkingDirectory%/dirtoignoreerror/* + - '#Undefined variable: \$langs#' + - '#Undefined variable: \$user#' + - '#Undefined variable: \$db#' + - '#Undefined variable: \$conf#' + - '#Undefined variable: \$hookmanager#' internalErrorsCountLimit: 50 cache: nodesByFileCountMax: 512