Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
moodle
moodle
Commits
6d721cab
Commit
6d721cab
authored
Jun 26, 2017
by
Mark Nelson
Browse files
MDL-59362 core: ensure we use 'new' when throwing exceptions
parent
f4a2d696
Changes
3
Hide whitespace changes
Inline
Side-by-side
lib/classes/plugin_manager.php
View file @
6d721cab
...
...
@@ -146,7 +146,7 @@ class core_plugin_manager {
public
function
get_plugin_types
()
{
if
(
func_num_args
()
>
0
)
{
if
(
!
func_get_arg
(
0
))
{
throw
coding_exception
(
'core_plugin_manager->get_plugin_types() does not support relative paths.'
);
throw
new
coding_exception
(
'core_plugin_manager->get_plugin_types() does not support relative paths.'
);
}
}
if
(
$this
->
plugintypes
)
{
...
...
lib/navigationlib.php
View file @
6d721cab
...
...
@@ -3651,7 +3651,7 @@ class breadcrumb_navigation_node extends navigation_node {
$this
->
$key
=
$value
;
}
}
else
{
throw
coding_exception
(
'Not a valid breadcrumb_navigation_node'
);
throw
new
coding_exception
(
'Not a valid breadcrumb_navigation_node'
);
}
}
...
...
@@ -3705,7 +3705,7 @@ class flat_navigation_node extends navigation_node {
$this
->
$key
=
$value
;
}
}
else
{
throw
coding_exception
(
'Not a valid flat_navigation_node'
);
throw
new
coding_exception
(
'Not a valid flat_navigation_node'
);
}
$this
->
indent
=
$indent
;
}
...
...
tag/classes/collection.php
View file @
6d721cab
...
...
@@ -303,7 +303,7 @@ class core_tag_collection {
public
static
function
change_sortorder
(
$tagcoll
,
$direction
)
{
global
$DB
;
if
(
$direction
!=
-
1
&&
$direction
!=
1
)
{
throw
coding_exception
(
'Second argument in tag_coll_change_sortorder() can be only 1 or -1'
);
throw
new
coding_exception
(
'Second argument in tag_coll_change_sortorder() can be only 1 or -1'
);
}
$tagcolls
=
self
::
get_collections
();
$keys
=
array_keys
(
$tagcolls
);
...
...
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!
Cancel
Please
register
or
sign in
to comment