Browse Source

Corrected coding standards violations.

pull/305/head
Islandora 12 years ago
parent
commit
7175316d11
  1. 4
      includes/ingest.form.inc
  2. 8
      includes/tuque_wrapper.inc
  3. 4
      includes/utilities.inc
  4. 10
      tests/hooks.test

4
includes/ingest.form.inc

@ -35,7 +35,7 @@ function islandora_ingest_form(array $form, array &$form_state, array $configura
islandora_ingest_form_init_form_state_storage($form_state, $configuration);
return islandora_ingest_form_execute_step($form, $form_state);
}
catch(Exception $e) {
catch (Exception $e) {
drupal_set_message($e->getMessage(), 'error');
return array(array(
'#markup' => l(t('Back'), 'javascript:window.history.back();', array('external' => TRUE))));
@ -242,7 +242,7 @@ function islandora_ingest_get_approximate_steps(array $configuration) {
try {
islandora_ingest_form_validate_configuration($configuration);
}
catch(InvalidArgumentException $e) {
catch (InvalidArgumentException $e) {
// Don't log or display exception.
return array();
}

8
includes/tuque_wrapper.inc

@ -205,7 +205,7 @@ class IslandoraFedoraApiM extends FedoraApiM {
}
return $ret;
}
catch(Exception $e) {
catch (Exception $e) {
watchdog('islandora', 'Failed to modify datastream @dsid from @pid</br>code: @code<br/>message: @msg', array(
'@pid' => $pid,
'@dsid' => $dsid,
@ -239,7 +239,7 @@ class IslandoraFedoraApiM extends FedoraApiM {
}
return $ret;
}
catch(Exception $e) {
catch (Exception $e) {
watchdog('islandora', 'Failed to modify object: @pid</br>code: @code<br/>message: @msg', array(
'@pid' => $pid,
'@code' => $e->getCode(),
@ -281,7 +281,7 @@ class IslandoraFedoraApiM extends FedoraApiM {
return $ret;
}
}
catch(Exception $e) {
catch (Exception $e) {
watchdog('islandora', 'Failed to purge datastream @dsid from @pid</br>code: @code<br/>message: @msg', array(
'@pid' => $pid,
'@dsid' => $dsid,
@ -325,7 +325,7 @@ class IslandoraFedoraApiM extends FedoraApiM {
return $ret;
}
}
catch(Exception $e) {
catch (Exception $e) {
watchdog('islandora', 'Failed to purge object @pid</br>code: @code<br/>message: @msg', array(
'@pid' => $pid,
'@code' => $e->getCode(),

4
includes/utilities.inc

@ -492,7 +492,7 @@ function islandora_prepare_new_object($namespace = NULL, $label = NULL, $datastr
watchdog('islandora', 'Attempting to ingest %file in islandora_prepare_new_object(), ' .
' but it does not appear to be readable. We will pass the path through' .
' url(), and pass along as such.',
array('%file' => $datastream_file, ) ,
array('%file' => $datastream_file),
WATCHDOG_WARNING);
}
}
@ -531,7 +531,7 @@ function islandora_display_repository_inaccessible_message() {
$text = t('Islandora configuration');
$link = l($text, 'admin/islandora/configure', array('attributes' => array('title' => $text)));
$message = t('Could not connect to the repository. Please check the settings on the !link page.',
array('!link' => $link));
array('!link' => $link));
drupal_set_message(check_plain($message), 'error', FALSE);
}

10
tests/hooks.test

@ -67,7 +67,7 @@ class IslandoraHooksTestCase extends IslandoraWebTestCase {
$object->label = "Don't Block";
$this->repository->purgeObject($object->id);
}
catch(Exception $e) {
catch (Exception $e) {
// Meh... Either it didn't exist or the purge failed.
}
}
@ -95,7 +95,7 @@ class IslandoraHooksTestCase extends IslandoraWebTestCase {
$this->fail('Blocked ingest should throw an Exception.');
$this->repository->purgeObject($object->id);
}
catch(Exception $e) {
catch (Exception $e) {
$this->pass('Ingest blocked and exception thrown.');
$this->assert($_SESSION['islandora_hooks']['alter'][ISLANDORA_OBJECT_INGESTED_HOOK], 'Called "hook_islandora_object_alter" when blocking ingesting via FedoraRepository::ingestObject.');
$this->assertFalse($_SESSION['islandora_hooks']['hook'][ISLANDORA_OBJECT_INGESTED_HOOK], 'Did not called ISLANDORA_OBJECT_INGESTED_HOOK when blocking ingesting via FedoraRepository::ingestObject.');
@ -115,7 +115,7 @@ class IslandoraHooksTestCase extends IslandoraWebTestCase {
$object->label = 'block';
$this->fail('Blocked modify should throw an Exception.');
}
catch(Exception $e) {
catch (Exception $e) {
$this->pass('Modify blocked and exception thrown.');
$this->assertNotEqual($object->label, 'block', 'Modification did not stick.');
$this->assert($_SESSION['islandora_hooks']['alter'][ISLANDORA_OBJECT_MODIFIED_HOOK], 'Called "hook_islandora_object_alter" when blocking modifying via set magic functions.');
@ -149,7 +149,7 @@ class IslandoraHooksTestCase extends IslandoraWebTestCase {
$this->repository->purgeObject($object->id);
$this->fail('Blocked modify should throw an Exception.');
}
catch(Exception $e) {
catch (Exception $e) {
$this->pass('Modify blocked and exception thrown.');
$this->assert($_SESSION['islandora_hooks']['alter'][ISLANDORA_OBJECT_PURGED_HOOK], 'Called "hook_islandora_object_alter" when blocking purge via FedoraRepository::purgeObject.');
$this->assertFalse($_SESSION['islandora_hooks']['hook'][ISLANDORA_OBJECT_PURGED_HOOK], 'Called ISLANDORA_OBJECT_PURGED_HOOK when blocking purge via FedoraRepository::purgeObject.');
@ -191,7 +191,7 @@ class IslandoraHooksTestCase extends IslandoraWebTestCase {
$ds->label = 'block';
$this->fail('Blocked modify should throw an Exception.');
}
catch(Exception $e) {
catch (Exception $e) {
$this->pass('Modify blocked and exception thrown.');
$this->assert($_SESSION['islandora_hooks']['alter'][ISLANDORA_DATASTREAM_MODIFIED_HOOK], 'Called "hook_islandora_datastream_alter" when blocking modifying via set magic functions.');
$this->assertFALSE($_SESSION['islandora_hooks']['hook'][ISLANDORA_DATASTREAM_MODIFIED_HOOK], 'Called ISLANDORA_DATASTREAM_MODIFIED_HOOK when blocking modifying via set magic functions.');

Loading…
Cancel
Save