Skip to content

Commit

Permalink
Improve PHP 8.2 compatibility
Browse files Browse the repository at this point in the history
  • Loading branch information
LarsMichelsen committed Jul 10, 2023
1 parent 5e6881e commit e091b55
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 4 deletions.
2 changes: 1 addition & 1 deletion share/server/core/classes/objects/NagVisDynGroup.php
Expand Up @@ -31,7 +31,7 @@ class NagVisDynGroup extends NagVisStatefulObject {
protected static $langChild1 = null;

protected $name;
protected $object_types;
public $object_types;
protected $object_filter;

protected $members = array();
Expand Down
4 changes: 2 additions & 2 deletions share/server/core/classes/objects/NagVisObject.php
Expand Up @@ -327,7 +327,7 @@ protected function getUrlTarget() {
* @param OBJ Second object to sort
* @author Lars Michelsen <lm@larsmichelsen.com>
*/
private static function sortObjectsAlphabetical($OBJ1, $OBJ2) {
public static function sortObjectsAlphabetical($OBJ1, $OBJ2) {
if($OBJ1->type == 'service') {
$name1 = strtolower($OBJ1->getName().$OBJ1->getServiceDescription());
} else {
Expand Down Expand Up @@ -368,7 +368,7 @@ private static function sortObjectsAlphabetical($OBJ1, $OBJ2) {
* @param OBJ Second object to sort
* @author Lars Michelsen <lm@larsmichelsen.com>
*/
private static function sortObjectsByState($OBJ1, $OBJ2) {
public static function sortObjectsByState($OBJ1, $OBJ2) {
$state1 = $OBJ1->sum[STATE];
$subState1 = $OBJ1->getSubState(SUMMARY_STATE);

Expand Down
4 changes: 3 additions & 1 deletion share/server/core/classes/objects/NagVisStatefulObject.php
Expand Up @@ -589,7 +589,7 @@ public function hasProblem() {
# End public methods
# #########################################################################

private static function sortStateCountsByState($a1, $a2) {
public static function sortStateCountsByState($a1, $a2) {
if($a1['weight'] == $a2['weight']) {
return 0;
} elseif($a1['weight'] < $a2['weight']) {
Expand Down Expand Up @@ -624,6 +624,8 @@ protected function belowHoverChildsLimit($i) {
* @author Lars Michelsen <lm@larsmichelsen.com>
*/
protected function escapeStringForJson($s) {
if (is_null($s))
return '';
return strtr($s, Array("\r" => '<br />',
"\n" => '<br />',
'"' => '&quot;',
Expand Down
4 changes: 4 additions & 0 deletions share/server/core/classes/objects/NagVisStatelessObject.php
Expand Up @@ -30,5 +30,9 @@ class NagVisStatelessObject extends NagVisObject {

protected static $iconPath = null;
protected static $iconPathLocal = null;

public function getName() {
return $this->object_id;
}
}
?>
4 changes: 4 additions & 0 deletions share/server/core/classes/objects/NagVisTextbox.php
Expand Up @@ -43,6 +43,10 @@ public function __construct() {
parent::__construct();
}

public function getName() {
return $this->object_id;
}

/**
* PUBLIC fetchIcon()
*
Expand Down

0 comments on commit e091b55

Please sign in to comment.