Commit c7106c83 authored by Robert Lyon's avatar Robert Lyon

Bug 1575955: fixing function signatures for PHP7

They need to  be consistent in PHP7 and include the parameter types.

behatnotneeded - existing tests are ok

Change-Id: I5d94ee53962a92db6faf3718e5a54f48ea31e367
Signed-off-by: Robert Lyon's avatarRobert Lyon <robertl@catalyst.net.nz>
parent ede1f0b9
......@@ -587,7 +587,7 @@ class ArtefactTypeBlogPost extends ArtefactType {
db_commit();
}
public static function bulk_delete($artefactids) {
public static function bulk_delete($artefactids, $log=false) {
if (empty($artefactids)) {
return;
}
......
......@@ -267,7 +267,7 @@ class ArtefactTypeComment extends ArtefactType {
db_commit();
}
public static function bulk_delete($artefactids) {
public static function bulk_delete($artefactids, $log=false) {
if (empty($artefactids)) {
return;
}
......@@ -634,7 +634,7 @@ class ArtefactTypeComment extends ArtefactType {
$data->pagination_js = $pagination['javascript'];
}
public function render_self() {
public function render_self($options) {
return clean_html($this->get('description'));
}
......@@ -820,7 +820,7 @@ class ArtefactTypeComment extends ArtefactType {
);
}
public static function save_config_options($form, $values) {
public static function save_config_options(Pieform $form, $values) {
foreach (array('commentratings') as $settingname) {
set_config_plugin('artefact', 'comment', $settingname, $values[$settingname]);
}
......
......@@ -1365,7 +1365,7 @@ class ArtefactTypeFile extends ArtefactTypeFileBase {
parent::delete();
}
public static function bulk_delete($artefactids) {
public static function bulk_delete($artefactids, $log=false) {
global $USER;
require_once('group.php');
......@@ -1740,7 +1740,7 @@ class ArtefactTypeFile extends ArtefactTypeFileBase {
}
}
public static function save_config_options($form, $values) {
public static function save_config_options(Pieform $form, $values) {
global $USER;
$updatingquota = false;
......@@ -2300,7 +2300,7 @@ class ArtefactTypeImage extends ArtefactTypeFile {
parent::delete();
}
public static function bulk_delete($artefactids) {
public static function bulk_delete($artefactids, $log=false) {
if (empty($artefactids)) {
return;
}
......@@ -2355,7 +2355,7 @@ class ArtefactTypeProfileIcon extends ArtefactTypeImage {
}
}
public static function bulk_delete($artefactids) {
public static function bulk_delete($artefactids, $log=false) {
global $USER;
parent::bulk_delete($artefactids);
if (in_array($USER->get('profileicon'), $artefactids)) {
......
......@@ -633,7 +633,7 @@ class ArtefactTypeProfile extends ArtefactType {
return $form;
}
public function save_config_options($form, $values) {
public function save_config_options(Pieform $form, $values) {
$mandatory = array_merge(array_keys(self::get_always_mandatory_fields()), $values['mandatory']);
set_config_plugin('artefact', 'internal', 'profilemandatory', join(',', $mandatory));
$searchable = array_merge(array_keys(self::get_always_searchable_fields()), $values['searchable']);
......@@ -669,7 +669,7 @@ class ArtefactTypeProfileField extends ArtefactTypeProfile {
/**
* Render the import entry request for profile fields
*/
public static function render_import_entry_request($entry_content) {
public static function render_import_entry_request($entry_content, $renderfields=array()) {
return clean_html($entry_content['title']);
}
}
......@@ -751,7 +751,7 @@ class ArtefactTypeEmail extends ArtefactTypeProfileField {
parent::delete();
}
public static function bulk_delete($artefactids) {
public static function bulk_delete($artefactids, $log=false) {
if (empty($artefactids)) {
return;
}
......@@ -824,7 +824,7 @@ class ArtefactTypeCountry extends ArtefactTypeProfileField {
/**
* Render the import entry request for country fields
*/
public static function render_import_entry_request($entry_content) {
public static function render_import_entry_request($entry_content, $renderfields=array()) {
$countries = getoptions_country();
return (isset($countries[$entry_content['title']]) ? $countries[$entry_content['title']] : '');
}
......@@ -956,7 +956,7 @@ class ArtefactTypeSocialprofile extends ArtefactTypeProfileField {
/**
* Render the import entry request for social profile fields
*/
public static function render_import_entry_request($entry_content) {
public static function render_import_entry_request($entry_content, $renderfields=array()) {
$html = '<strong>' . $entry_content['description'] . ':</strong>&nbsp;' . $entry_content['title'];
return clean_html($html);
}
......
......@@ -421,7 +421,7 @@ class ArtefactTypeTask extends ArtefactType {
db_commit();
}
public static function bulk_delete($artefactids) {
public static function bulk_delete($artefactids, $log=false) {
if (empty($artefactids)) {
return;
}
......
......@@ -262,7 +262,7 @@ class ArtefactTypeResume extends ArtefactType {
/**
* Render the import entry request for resume fields
*/
public static function render_import_entry_request($entry_content) {
public static function render_import_entry_request($entry_content, $renderfields=array()) {
return clean_html($entry_content['description']);
}
}
......@@ -479,7 +479,7 @@ class ArtefactTypePersonalinformation extends ArtefactTypeResume {
return array('html' => self::render_fields($this, $options), 'javascript' => '');
}
public static function render_import_entry_request($entry_content) {
public static function render_import_entry_request($entry_content, $renderfields=array()) {
return self::render_fields(null, array(), $entry_content);
}
......@@ -492,7 +492,7 @@ class ArtefactTypePersonalinformation extends ArtefactTypeResume {
db_commit();
}
public static function bulk_delete($artefactids) {
public static function bulk_delete($artefactids, $log=false) {
if (empty($artefactids)) {
return;
}
......@@ -921,7 +921,7 @@ abstract class ArtefactTypeResumeComposite extends ArtefactTypeResume implements
return $content;
}
public static function render_import_entry_request($entry_content, $renderfields) {
public static function render_import_entry_request($entry_content, $renderfields=array()) {
$smarty = smarty_core();
$fields = array();
foreach ($renderfields as $field) {
......@@ -1280,7 +1280,7 @@ class ArtefactTypeEmploymenthistory extends ArtefactTypeResumeComposite {
);
}
public static function bulk_delete($artefactids) {
public static function bulk_delete($artefactids, $log=false) {
ArtefactTypeResumeComposite::bulk_delete_composite($artefactids, 'employmenthistory');
}
......@@ -1321,7 +1321,7 @@ class ArtefactTypeEmploymenthistory extends ArtefactTypeResumeComposite {
);
}
public static function render_import_entry_request($entry_content) {
public static function render_import_entry_request($entry_content, $renderfields=array()) {
return parent::render_import_entry_request($entry_content, array_keys(self::get_addform_elements()));
}
......@@ -1464,7 +1464,7 @@ function formatQualification(name, type, institution) {
EOF;
}
public static function bulk_delete($artefactids) {
public static function bulk_delete($artefactids, $log=false) {
ArtefactTypeResumeComposite::bulk_delete_composite($artefactids, 'educationhistory');
}
......@@ -1505,7 +1505,7 @@ EOF;
);
}
public static function render_import_entry_request($entry_content) {
public static function render_import_entry_request($entry_content, $renderfields=array()) {
return parent::render_import_entry_request($entry_content, array_keys(self::get_addform_elements()));
}
......@@ -1579,7 +1579,7 @@ class ArtefactTypeCertification extends ArtefactTypeResumeComposite {
);
}
public static function bulk_delete($artefactids) {
public static function bulk_delete($artefactids, $log=false) {
ArtefactTypeResumeComposite::bulk_delete_composite($artefactids, 'certification');
}
......@@ -1618,7 +1618,7 @@ class ArtefactTypeCertification extends ArtefactTypeResumeComposite {
);
}
public static function render_import_entry_request($entry_content) {
public static function render_import_entry_request($entry_content, $renderfields=array()) {
return parent::render_import_entry_request($entry_content, array_keys(self::get_addform_elements()));
}
......@@ -1707,7 +1707,7 @@ class ArtefactTypeBook extends ArtefactTypeResumeComposite {
);
}
public static function bulk_delete($artefactids) {
public static function bulk_delete($artefactids, $log=false) {
ArtefactTypeResumeComposite::bulk_delete_composite($artefactids, 'book');
}
/**
......@@ -1745,7 +1745,7 @@ class ArtefactTypeBook extends ArtefactTypeResumeComposite {
);
}
public static function render_import_entry_request($entry_content) {
public static function render_import_entry_request($entry_content, $renderfields=array()) {
return parent::render_import_entry_request($entry_content, array_keys(self::get_addform_elements()));
}
......@@ -1825,7 +1825,7 @@ class ArtefactTypeMembership extends ArtefactTypeResumeComposite {
);
}
public static function bulk_delete($artefactids) {
public static function bulk_delete($artefactids, $log=false) {
ArtefactTypeResumeComposite::bulk_delete_composite($artefactids, 'membership');
}
......@@ -1865,7 +1865,7 @@ class ArtefactTypeMembership extends ArtefactTypeResumeComposite {
);
}
public static function render_import_entry_request($entry_content) {
public static function render_import_entry_request($entry_content, $renderfields=array()) {
return parent::render_import_entry_request($entry_content, array_keys(self::get_addform_elements()));
}
......
......@@ -305,7 +305,7 @@ class PluginAuthInternal extends PluginAuth {
return false;
}
public static function get_instance_config_options() {
public static function get_instance_config_options($institution, $instance = 0) {
return array();
}
}
......@@ -2573,10 +2573,12 @@ class PluginAuth extends Plugin {
* contain any elements called "plugintype", "pluginname", "name", or "submit".
*
* The form definition itself should NOT contain a successcallback, validatecallback, or jsform setting.
* @param array $institution
* @param int $instance
*
* @return array
*/
public static function get_instance_config_options() {
public static function get_instance_config_options($institution, $instance = 0) {
throw new SystemException('This plugin claims to have instance config but does not define a '
. 'get_instance_config_options() method. Most likely it is still using the get_config_options() '
. 'method for this purpose. Please ask the developer to upgrade the plugin.');
......
......@@ -87,7 +87,7 @@ class PluginAuthNone extends PluginAuth {
return false;
}
public static function get_instance_config_options() {
public static function get_instance_config_options($institution, $instance = 0) {
return array();
}
}
......@@ -1101,7 +1101,7 @@ class XMLDBgenerator {
/**
* Returns the code (array of statements) needed to execute extra statements on field rename
*/
function getRenameFieldExtraSQL ($xmldb_table, $xmldb_field) {
function getRenameFieldExtraSQL ($xmldb_table, $xmldb_field, $newname) {
return array('Code for field rename goes to getRenameFieldExtraSQL(). Can be disabled with rename_column_extra_code=false;');
}
......@@ -1123,7 +1123,7 @@ class XMLDBgenerator {
/**
* Returns the code (array of statements) needed to execute extra statements on table rename
*/
function getRenameTableExtraSQL ($xmldb_table) {
function getRenameTableExtraSQL ($xmldb_table, $newname) {
return array('Code for table rename goes to getRenameTableExtraSQL(). Can be disabled with rename_table_extra_code=false;');
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment