Skip to content
GitLab
Explore
Projects
Groups
Topics
Snippets
Projects
Groups
Topics
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
fusiondirectory
fusiondirectory
Commits
76ceb6f1
Verified
Commit
76ceb6f1
authored
2 months ago
by
dockx thibault
Browse files
Options
Download
Patches
Plain Diff
Feat(Errors) - adapt errors classes to php82
Adapt errors classes to php82
parent
bbb0513e
core-php8
No related merge requests found
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
include/errors/class_FatalError.inc
+0
-1
include/errors/class_FatalError.inc
include/errors/class_FusionDirectoryError.inc
+2
-3
include/errors/class_FusionDirectoryError.inc
include/errors/class_SimplePluginError.inc
+8
-8
include/errors/class_SimplePluginError.inc
include/errors/class_SimplePluginHookError.inc
+2
-2
include/errors/class_SimplePluginHookError.inc
include/errors/class_SimplePluginLdapError.inc
+2
-2
include/errors/class_SimplePluginLdapError.inc
with
14 additions
and
16 deletions
+14
-16
include/errors/class_FatalError.inc
+
0
−
1
View file @
76ceb6f1
...
...
@@ -29,7 +29,6 @@ class FatalError extends Error
public
function
__construct
(
string
$htmlMessage
=
''
,
int
$code
=
0
,
Throwable
$previous
=
NULL
)
{
$this
->
htmlMessage
=
$htmlMessage
;
parent
::
__construct
(
htmlunescape
(
strip_tags
(
$htmlMessage
)),
$code
,
$previous
);
}
public
function
getHtmlMessage
()
...
...
This diff is collapsed.
Click to expand it.
include/errors/class_FusionDirectoryError.inc
+
2
−
3
View file @
76ceb6f1
...
...
@@ -28,7 +28,6 @@ class FusionDirectoryError extends Error
public
function
__construct
(
string
$htmlMessage
=
''
,
int
$code
=
0
,
Throwable
$previous
=
NULL
)
{
$this
->
htmlMessage
=
$htmlMessage
;
parent
::
__construct
(
htmlunescape
(
strip_tags
(
$htmlMessage
)),
$code
,
$previous
);
}
public
function
getHtmlMessage
()
...
...
@@ -39,14 +38,14 @@ class FusionDirectoryError extends Error
public
function
toArray
():
array
{
return
[
'class'
=>
get_class
(
$this
)
,
'class'
=>
static
::
class
,
'message'
=>
$this
->
getMessage
(),
'line'
=>
$this
->
getLine
(),
'file'
=>
$this
->
getFile
(),
];
}
public
function
__toString
()
public
function
__toString
()
:
string
{
return
$this
->
getMessage
();
}
...
...
This diff is collapsed.
Click to expand it.
include/errors/class_SimplePluginError.inc
+
8
−
8
View file @
76ceb6f1
...
...
@@ -21,7 +21,7 @@
/*! \class SimplePluginError
\brief Error returned by any method of SimplePlugin
*/
class
SimplePluginError
extends
FusionDirectoryError
class
SimplePluginError
extends
FusionDirectoryError
implements
\
Stringable
{
protected
$object
;
protected
$tab
;
...
...
@@ -49,7 +49,7 @@ class SimplePluginError extends FusionDirectoryError
$this
->
tab
=
NULL
;
$this
->
object
=
$origin
;
}
elseif
(
$origin
!==
NULL
)
{
trigger_error
(
'Invalid origin of class '
.
get_class
(
$origin
)
);
trigger_error
(
'Invalid origin of class '
.
$origin
::
class
);
}
}
if
(
!
$this
->
object
instanceof
simpleTabs
)
{
...
...
@@ -66,7 +66,7 @@ class SimplePluginError extends FusionDirectoryError
}
if
(
isset
(
$this
->
tab
))
{
$array
[
'tab'
]
=
get_class
(
$this
->
tab
)
;
$array
[
'tab'
]
=
$this
->
tab
::
class
;
}
if
(
isset
(
$this
->
attribute
))
{
...
...
@@ -76,7 +76,7 @@ class SimplePluginError extends FusionDirectoryError
return
$array
;
}
public
function
__toString
()
public
function
__toString
()
:
string
{
$msg
=
''
;
...
...
@@ -84,8 +84,8 @@ class SimplePluginError extends FusionDirectoryError
$msg
.
=
$this
->
object
->
dn
.
' > '
;
}
if
(
isset
(
$this
->
tab
)
&&
isset
(
$this
->
tab
->
parent
->
by_name
[
get_class
(
$this
->
tab
)
]))
{
$msg
.
=
$this
->
tab
->
parent
->
by_name
[
get_class
(
$this
->
tab
)
]
.
' > '
;
if
(
isset
(
$this
->
tab
)
&&
isset
(
$this
->
tab
->
parent
->
by_name
[
$this
->
tab
::
class
]))
{
$msg
.
=
$this
->
tab
->
parent
->
by_name
[
$this
->
tab
::
class
]
.
' > '
;
}
if
(
isset
(
$this
->
attribute
))
{
...
...
@@ -110,8 +110,8 @@ class SimplePluginError extends FusionDirectoryError
$breadcrumbs
[]
=
htmlescape
(
$this
->
object
->
dn
);
}
if
(
isset
(
$this
->
tab
)
&&
isset
(
$this
->
tab
->
parent
->
by_name
[
get_class
(
$this
->
tab
)
]))
{
$breadcrumbs
[]
=
htmlescape
(
$this
->
tab
->
parent
->
by_name
[
get_class
(
$this
->
tab
)
]);
if
(
isset
(
$this
->
tab
)
&&
isset
(
$this
->
tab
->
parent
->
by_name
[
$this
->
tab
::
class
]))
{
$breadcrumbs
[]
=
htmlescape
(
$this
->
tab
->
parent
->
by_name
[
$this
->
tab
::
class
]);
}
if
(
isset
(
$this
->
attribute
))
{
...
...
This diff is collapsed.
Click to expand it.
include/errors/class_SimplePluginHookError.inc
+
2
−
2
View file @
76ceb6f1
...
...
@@ -50,8 +50,8 @@ class SimplePluginHookError extends SimplePluginError
$html
.
=
htmlescape
(
$this
->
object
->
dn
.
' > '
);
}
if
(
isset
(
$this
->
tab
)
&&
isset
(
$this
->
tab
->
parent
->
by_name
[
get_class
(
$this
->
tab
)
]))
{
$html
.
=
htmlescape
(
$this
->
tab
->
parent
->
by_name
[
get_class
(
$this
->
tab
)
]
.
' > '
);
if
(
isset
(
$this
->
tab
)
&&
isset
(
$this
->
tab
->
parent
->
by_name
[
$this
->
tab
::
class
]))
{
$html
.
=
htmlescape
(
$this
->
tab
->
parent
->
by_name
[
$this
->
tab
::
class
]
.
' > '
);
}
if
(
isset
(
$this
->
attribute
))
{
...
...
This diff is collapsed.
Click to expand it.
include/errors/class_SimplePluginLdapError.inc
+
2
−
2
View file @
76ceb6f1
...
...
@@ -57,8 +57,8 @@ class SimplePluginLdapError extends SimplePluginError
$html
.
=
htmlescape
(
$this
->
object
->
dn
.
' > '
);
}
if
(
isset
(
$this
->
tab
)
&&
isset
(
$this
->
tab
->
parent
->
by_name
[
get_class
(
$this
->
tab
)
]))
{
$html
.
=
htmlescape
(
$this
->
tab
->
parent
->
by_name
[
get_class
(
$this
->
tab
)
]
.
' > '
);
if
(
isset
(
$this
->
tab
)
&&
isset
(
$this
->
tab
->
parent
->
by_name
[
$this
->
tab
::
class
]))
{
$html
.
=
htmlescape
(
$this
->
tab
->
parent
->
by_name
[
$this
->
tab
::
class
]
.
' > '
);
}
if
(
isset
(
$this
->
attribute
))
{
...
...
This diff is collapsed.
Click to expand it.
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment
Menu
Explore
Projects
Groups
Topics
Snippets