Commit c5eb6088 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 3569ae7a
......@@ -242,7 +242,7 @@ class PluginBlocktypeAnnotation extends MaharaCoreBlocktype {
return $elements;
}
public static function delete_instance($instance) {
public static function delete_instance(BlockInstance $instance) {
$configdata = $instance->get('configdata');
if (!empty($configdata)) {
$artefactid = $configdata['artefactid'];
......
......@@ -508,7 +508,7 @@ class ArtefactTypeAnnotationfeedback extends ArtefactType {
*
* @param array $artefactids is a list of artefactids representing the annotationfeedback artefacts.
*/
public static function bulk_delete($artefactids) {
public static function bulk_delete($artefactids, $log=false) {
if (empty($artefactids)) {
return;
}
......@@ -1051,7 +1051,7 @@ class ArtefactTypeAnnotationfeedback extends ArtefactType {
}
}
public function render_self() {
public function render_self($options) {
return clean_html($this->get('description'));
}
......
......@@ -754,7 +754,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;
}
......
......@@ -279,7 +279,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;
}
......@@ -896,7 +896,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'));
}
......@@ -1146,7 +1146,7 @@ class ArtefactTypeComment extends ArtefactType {
);
}
public static function save_config_options($form, $values) {
public static function save_config_options(Pieform $form, $values) {
$valid = array('commentratings', 'ratingicon', 'ratinglength',
'ratingcolour');
foreach ($valid as $settingname) {
......
......@@ -1378,7 +1378,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');
......@@ -1755,7 +1755,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;
......@@ -2315,7 +2315,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;
}
......@@ -2370,7 +2370,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)) {
......
......@@ -218,7 +218,7 @@ class PluginBlocktypeProfileinfo extends MaharaCoreBlocktype {
return $values;
}
public static function delete_instance($instance) {
public static function delete_instance(BlockInstance $instance) {
require_once('embeddedimage.php');
EmbeddedImage::delete_embedded_images('introtext', $instance->get('id'));
}
......
......@@ -436,7 +436,7 @@ EOF;
return $elements;
}
public static function delete_instance($instance) {
public static function delete_instance(BlockInstance $instance) {
require_once('embeddedimage.php');
$configdata = $instance->get('configdata');
if (!empty($configdata)) {
......
......@@ -641,7 +641,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']);
......@@ -677,7 +677,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']);
}
}
......@@ -759,7 +759,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;
}
......@@ -832,7 +832,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']] : '');
}
......@@ -1001,7 +1001,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);
}
......
......@@ -419,7 +419,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;
}
......
......@@ -265,7 +265,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']);
}
}
......@@ -482,7 +482,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);
}
......@@ -495,7 +495,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;
}
......@@ -933,7 +933,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) {
......@@ -1307,7 +1307,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');
}
......@@ -1348,7 +1348,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()));
}
......@@ -1491,7 +1491,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');
}
......@@ -1532,7 +1532,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()));
}
......@@ -1606,7 +1606,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');
}
......@@ -1645,7 +1645,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()));
}
......@@ -1734,7 +1734,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');
}
/**
......@@ -1772,7 +1772,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()));
}
......@@ -1852,7 +1852,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');
}
......@@ -1892,7 +1892,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();
}
}
......@@ -2664,10 +2664,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();
}
}
......@@ -83,7 +83,7 @@ class PluginAuthWebservice extends PluginAuth {
return false;
}
public static function get_instance_config_options() {
public static function get_instance_config_options($institution, $instance = 0) {
return array();
}
......
......@@ -90,7 +90,7 @@ class PluginBlocktypeText extends MaharaCoreBlocktype {
return $values;
}
public static function delete_instance($instance) {
public static function delete_instance(BlockInstance $instance) {
require_once('embeddedimage.php');
EmbeddedImage::delete_embedded_images('text', $instance->get('id'));
}
......@@ -206,7 +206,7 @@ class PluginBlocktypeText extends MaharaCoreBlocktype {
* @param $form the pieform to send the ok-message to
* @param array $values
*/
public static function save_config_options($form, $values) {
public static function save_config_options(Pieform $form, $values) {
global $SESSION;
if (!array_key_exists('convertcheckbox', $values) || !$values['convertcheckbox']) {
return;
......
......@@ -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