jeedom / core

Software for home automation
https://www.jeedom.com
GNU General Public License v2.0
383 stars 312 forks source link

fix: deprecated and warning notices #2701

Closed pifou25 closed 1 week ago

pifou25 commented 2 weeks ago

Description

Fix deprecated and warning messages while setting error level = E_ALL :

E_DEPRECATED: trim(): Passing null to parameter #1 ($string) of type string is deprecated in /var/www/html/core/class/system.class.php on line 57 
E_DEPRECATED: json_decode(): Passing null to parameter #1 ($json) of type string is deprecated in /var/www/html/core/class/cron.class.php on line 554
E_DEPRECATED: json_decode(): Passing null to parameter #1 ($json) of type string is deprecated in /var/www/html/core/class/utils.class.php on line 186 

PHP Error: Cannot use object of type stdClass as array in /var/www/html/core/class/system.class.php on line 423 PHP Stack trace: PHP 1. {main}() /var/www/html/core/php/jeeCron.php:0 PHP 2. plugin::checkDeamon() /var/www/html/core/php/jeeCron.php:78 PHP 3. plugin->dependancy_info($_refresh = uninitialized) /var/www/html/core/class/plugin.class.php:583 PHP 4. system::checkAndInstall($_packages = ['composer' => ['phpseclib/phpseclib' => [...]]], $_fix = FALSE, $_foreground = FALSE, $_plugin = 'Monitoring', $_force = uninitialized) /var/www/html/core/class/plugin.class.php:674 PHP 5. system::getInstallPackage($_type = 'composer', $_plugin = 'Monitoring') /var/www/html/core/class/system.class.php:461

E_DEPRECATED: preg_match_all(): Passing null to parameter #2 ($subject) of type string is deprecated in /var/www/html/core/class/eqLogic.class.php on line 484 
#0: /var/www/html/core/class/eqLogic.class.php:484 preg_match_all(["\/#eqLogic([0-9]*)#\/",null,null])
#1: /var/www/html/core/class/eqLogic.class.php:479 toHumanReadable([null])
#2: /var/www/html/core/class/jeedom.class.php:1400 toHumanReadable([{"id":4,"name":"Chambre 1","father_id":3,"isVisible":1,"position":null,"configuration":{"parentNumber":1,"tagColor":"#000000","tagTextColor":"#FFFFFF","mobile::summaryTextColor":"","icon":"<\/i>"},"display":{"icon":"<\/i>"},"image":{"type":"jpg","sha512":"4bd3961a00828381802c9fde9c2852924c6a59c298a134b9d1cb65b88650a393310f4bb76b551c4cc4da91d5842e20de0a105f84a2d85bcb69f6e4b06c5186f8"},"img":"data\/object\/object4-4bd3961a00828381802c9fde9c2852924c6a59c298a134b9d1cb65b88650a393310f4bb76b551c4cc4da91d5842e20de0a105f84a2d85bcb69f6e4b06c5186f8.jpg"}])
#3: /var/www/html/core/ajax/object.ajax.php:47 toHumanReadable(
[{
        "id": 4,
        "name": "Chambre 1",
        "father_id": 3,
        "isVisible": 1,
        "position": null,
        "configuration": {
            "parentNumber": 1,
            "tagColor": "#000000",
            "tagTextColor": "#FFFFFF",
            "mobile::summaryTextColor": "",
            "icon": "<\/i>"
        },
        "display": {
            "icon": "<\/i>"
        },
        "image": {
            "type": "jpg",
            "sha512": "4bd3961a00828381802c9fde9c2852924c6a59c298a134b9d1cb65b88650a393310f4bb76b551c4cc4da91d5842e20de0a105f84a2d85bcb69f6e4b06c5186f8"
        },
        "img": "data\/object\/object4-4bd3961a00828381802c9fde9c2852924c6a59c298a134b9d1cb65b88650a393310f4bb76b551c4cc4da91d5842e20de0a105f84a2d85bcb69f6e4b06c5186f8.jpg"
    }
]
)

Suggested changelog entry

Related issues/external references

Fixes #2678

Types of changes

PR checklist