Enable strict mode in Config classes

Signed-off-by: Maurício Meneghini Fauth <mauriciofauth@gmail.com>
This commit is contained in:
Maurício Meneghini Fauth 2018-05-14 21:57:19 -03:00
parent 6cf8ee0831
commit b6435e9ed2
35 changed files with 76 additions and 6 deletions

View File

@ -5,6 +5,8 @@
*
* @package PhpMyAdmin
*/
declare(strict_types=1);
namespace PhpMyAdmin\Config;
use PhpMyAdmin\Config;

View File

@ -5,6 +5,8 @@
*
* @package PhpMyAdmin
*/
declare(strict_types=1);
namespace PhpMyAdmin\Config;
use PhpMyAdmin\Sanitize;

View File

@ -5,6 +5,8 @@
*
* @package PhpMyAdmin
*/
declare(strict_types=1);
namespace PhpMyAdmin\Config;
use PhpMyAdmin\Config\ConfigFile;
@ -81,7 +83,7 @@ class Form
$key = ltrim(
mb_substr(
$option_name,
mb_strrpos($option_name, '/')
(int) mb_strrpos($option_name, '/')
),
'/'
);
@ -184,7 +186,7 @@ class Form
$this->fields = array();
foreach ($paths as $path) {
$key = ltrim(
mb_substr($path, mb_strrpos($path, '/')),
mb_substr($path, (int) mb_strrpos($path, '/')),
'/'
);
$this->fields[$key] = $path;
@ -201,7 +203,7 @@ class Form
{
$cf = $this->_configFile;
foreach ($this->fields as $name => $path) {
if (mb_strpos($name, ':group:') === 0) {
if (mb_strpos((string) $name, ':group:') === 0) {
$this->_fieldsTypes[$name] = 'group';
continue;
}

View File

@ -12,6 +12,8 @@
*
* @package PhpMyAdmin
*/
declare(strict_types=1);
namespace PhpMyAdmin\Config;
use PhpMyAdmin\Config\ConfigFile;

View File

@ -5,6 +5,8 @@
*
* @package PhpMyAdmin
*/
declare(strict_types=1);
namespace PhpMyAdmin\Config;
use PhpMyAdmin\Sanitize;
@ -263,7 +265,7 @@ class FormDisplayTemplate
break;
case 'number_text':
$htmlOutput .= '<input type="number" ' . $name_id . $field_class
. ' value="' . htmlspecialchars($value) . '" />';
. ' value="' . htmlspecialchars((string) $value) . '" />';
break;
case 'checkbox':
$htmlOutput .= '<span' . $field_class . '><input type="checkbox" ' . $name_id
@ -283,8 +285,8 @@ class FormDisplayTemplate
}
// escape if necessary
if ($escape) {
$display = htmlspecialchars($opt_value);
$display_value = htmlspecialchars($opt_value_key);
$display = htmlspecialchars((string) $opt_value);
$display_value = htmlspecialchars((string) $opt_value_key);
} else {
$display = $opt_value;
$display_value = $opt_value_key;

View File

@ -5,6 +5,8 @@
*
* @package PhpMyAdmin
*/
declare(strict_types=1);
namespace PhpMyAdmin\Config\Forms;
use PhpMyAdmin\Config\ConfigFile;

View File

@ -5,6 +5,8 @@
*
* @package PhpMyAdmin
*/
declare(strict_types=1);
namespace PhpMyAdmin\Config\Forms;
use PhpMyAdmin\Config\ConfigFile;

View File

@ -5,6 +5,8 @@
*
* @package PhpMyAdmin
*/
declare(strict_types=1);
namespace PhpMyAdmin\Config\Forms\Page;
use PhpMyAdmin\Config\Forms\BaseForm;

View File

@ -5,6 +5,8 @@
*
* @package PhpMyAdmin
*/
declare(strict_types=1);
namespace PhpMyAdmin\Config\Forms\Page;
use PhpMyAdmin\Config\Forms\BaseForm;

View File

@ -5,6 +5,8 @@
*
* @package PhpMyAdmin
*/
declare(strict_types=1);
namespace PhpMyAdmin\Config\Forms\Page;
use PhpMyAdmin\Config\Forms\BaseForm;

View File

@ -5,6 +5,8 @@
*
* @package PhpMyAdmin
*/
declare(strict_types=1);
namespace PhpMyAdmin\Config\Forms\Page;
class ExportForm extends \PhpMyAdmin\Config\Forms\User\ExportForm

View File

@ -5,6 +5,8 @@
*
* @package PhpMyAdmin
*/
declare(strict_types=1);
namespace PhpMyAdmin\Config\Forms\Page;
class ImportForm extends \PhpMyAdmin\Config\Forms\User\ImportForm

View File

@ -5,6 +5,8 @@
*
* @package PhpMyAdmin
*/
declare(strict_types=1);
namespace PhpMyAdmin\Config\Forms\Page;
class NaviForm extends \PhpMyAdmin\Config\Forms\User\NaviForm

View File

@ -5,6 +5,8 @@
*
* @package PhpMyAdmin
*/
declare(strict_types=1);
namespace PhpMyAdmin\Config\Forms\Page;
use PhpMyAdmin\Config\Forms\BaseFormList;

View File

@ -5,6 +5,8 @@
*
* @package PhpMyAdmin
*/
declare(strict_types=1);
namespace PhpMyAdmin\Config\Forms\Page;
class SqlForm extends \PhpMyAdmin\Config\Forms\User\SqlForm

View File

@ -5,6 +5,8 @@
*
* @package PhpMyAdmin
*/
declare(strict_types=1);
namespace PhpMyAdmin\Config\Forms\Page;
use PhpMyAdmin\Config\Forms\BaseForm;

View File

@ -5,6 +5,8 @@
*
* @package PhpMyAdmin
*/
declare(strict_types=1);
namespace PhpMyAdmin\Config\Forms\Setup;
use PhpMyAdmin\Config\Forms\BaseForm;

View File

@ -5,6 +5,8 @@
*
* @package PhpMyAdmin
*/
declare(strict_types=1);
namespace PhpMyAdmin\Config\Forms\Setup;
class ExportForm extends \PhpMyAdmin\Config\Forms\User\ExportForm

View File

@ -5,6 +5,8 @@
*
* @package PhpMyAdmin
*/
declare(strict_types=1);
namespace PhpMyAdmin\Config\Forms\Setup;
class FeaturesForm extends \PhpMyAdmin\Config\Forms\User\FeaturesForm

View File

@ -5,6 +5,8 @@
*
* @package PhpMyAdmin
*/
declare(strict_types=1);
namespace PhpMyAdmin\Config\Forms\Setup;
class ImportForm extends \PhpMyAdmin\Config\Forms\User\ImportForm

View File

@ -5,6 +5,8 @@
*
* @package PhpMyAdmin
*/
declare(strict_types=1);
namespace PhpMyAdmin\Config\Forms\Setup;
class MainForm extends \PhpMyAdmin\Config\Forms\User\MainForm

View File

@ -5,6 +5,8 @@
*
* @package PhpMyAdmin
*/
declare(strict_types=1);
namespace PhpMyAdmin\Config\Forms\Setup;
class NaviForm extends \PhpMyAdmin\Config\Forms\User\NaviForm

View File

@ -5,6 +5,8 @@
*
* @package PhpMyAdmin
*/
declare(strict_types=1);
namespace PhpMyAdmin\Config\Forms\Setup;
use PhpMyAdmin\Config\Forms\BaseForm;

View File

@ -5,6 +5,8 @@
*
* @package PhpMyAdmin
*/
declare(strict_types=1);
namespace PhpMyAdmin\Config\Forms\Setup;
use PhpMyAdmin\Config\Forms\BaseFormList;

View File

@ -5,6 +5,8 @@
*
* @package PhpMyAdmin
*/
declare(strict_types=1);
namespace PhpMyAdmin\Config\Forms\Setup;
class SqlForm extends \PhpMyAdmin\Config\Forms\User\SqlForm

View File

@ -5,6 +5,8 @@
*
* @package PhpMyAdmin
*/
declare(strict_types=1);
namespace PhpMyAdmin\Config\Forms\User;
use PhpMyAdmin\Config\Forms\BaseForm;

View File

@ -5,6 +5,8 @@
*
* @package PhpMyAdmin
*/
declare(strict_types=1);
namespace PhpMyAdmin\Config\Forms\User;
use PhpMyAdmin\Config\Forms\BaseForm;

View File

@ -5,6 +5,8 @@
*
* @package PhpMyAdmin
*/
declare(strict_types=1);
namespace PhpMyAdmin\Config\Forms\User;
use PhpMyAdmin\Config\Forms\BaseForm;

View File

@ -5,6 +5,8 @@
*
* @package PhpMyAdmin
*/
declare(strict_types=1);
namespace PhpMyAdmin\Config\Forms\User;
use PhpMyAdmin\Config\Forms\BaseForm;

View File

@ -5,6 +5,8 @@
*
* @package PhpMyAdmin
*/
declare(strict_types=1);
namespace PhpMyAdmin\Config\Forms\User;
use PhpMyAdmin\Config\Forms\BaseForm;

View File

@ -5,6 +5,8 @@
*
* @package PhpMyAdmin
*/
declare(strict_types=1);
namespace PhpMyAdmin\Config\Forms\User;
use PhpMyAdmin\Config\Forms\BaseForm;

View File

@ -5,6 +5,8 @@
*
* @package PhpMyAdmin
*/
declare(strict_types=1);
namespace PhpMyAdmin\Config\Forms\User;
use PhpMyAdmin\Config\Forms\BaseFormList;

View File

@ -5,6 +5,8 @@
*
* @package PhpMyAdmin
*/
declare(strict_types=1);
namespace PhpMyAdmin\Config;
use PhpMyAdmin\Config\ConfigFile;

View File

@ -5,6 +5,8 @@
*
* @package PhpMyAdmin
*/
declare(strict_types=1);
namespace PhpMyAdmin\Config;
use PhpMyAdmin\Config\ConfigFile;

View File

@ -5,6 +5,8 @@
*
* @package PhpMyAdmin
*/
declare(strict_types=1);
namespace PhpMyAdmin\Config;
use PhpMyAdmin\Config\ConfigFile;