From 6ff8c0749bf0ba000191a4fb0fb2d09f3278a2da Mon Sep 17 00:00:00 2001 From: Demian Katz <demian.katz@villanova.edu> Date: Tue, 10 Feb 2015 15:23:56 -0500 Subject: [PATCH] Style fixes. --- module/VuDL/src/VuDL/Connection/Fedora.php | 9 ++++--- .../VuFind/src/VuFind/Connection/Oracle.php | 8 +++++-- .../src/VuFind/Connection/Wikipedia.php | 2 +- .../VuFind/Controller/InstallController.php | 8 +++---- .../VuFind/src/VuFind/ILS/Driver/Amicus.php | 24 +++++++++---------- module/VuFind/src/VuFind/ILS/Driver/Demo.php | 3 ++- .../src/VuFind/ILS/Driver/HorizonXMLAPI.php | 3 +-- module/VuFind/src/VuFind/ILS/Driver/LBS4.php | 6 +++-- .../VuFind/src/VuFind/ILS/Driver/Virtua.php | 3 ++- .../VuFind/src/VuFind/ILS/Driver/XCNCIP2.php | 3 +-- module/VuFind/src/VuFind/RecordDriver/EDS.php | 3 ++- .../src/VuFindTheme/LessCompiler.php | 4 +++- 12 files changed, 44 insertions(+), 32 deletions(-) diff --git a/module/VuDL/src/VuDL/Connection/Fedora.php b/module/VuDL/src/VuDL/Connection/Fedora.php index 0f4418b454c..c3ea24557ce 100644 --- a/module/VuDL/src/VuDL/Connection/Fedora.php +++ b/module/VuDL/src/VuDL/Connection/Fedora.php @@ -204,7 +204,8 @@ class Fedora extends AbstractBase public function getMemberList($root) { $query = 'select $memberPID $memberTitle from <#ri> ' - . 'where $member <fedora-rels-ext:isMemberOf> <info:fedora/' . $root . '> ' + . 'where $member <fedora-rels-ext:isMemberOf> <info:fedora/' + . $root . '> ' . 'and $member <fedora-model:label> $memberTitle ' . 'and $member <dc:identifier> $memberPID'; $response = $this->query($query); @@ -250,7 +251,8 @@ class Fedora extends AbstractBase public function getOrderedMembers($root) { $query = 'select $memberPID $memberTitle $sequence $member from <#ri> ' - . 'where $member <fedora-rels-ext:isMemberOf> <info:fedora/' . $root . '> ' + . 'where $member <fedora-rels-ext:isMemberOf> <info:fedora/' + . $root . '> ' . 'and $member <http://vudl.org/relationships#sequence> $sequence ' . 'and $member <fedora-model:label> $memberTitle ' . 'and $member <dc:identifier> $memberPID'; @@ -291,7 +293,8 @@ class Fedora extends AbstractBase } // No sequence? Title sort. $query = 'select $memberPID $memberTitle from <#ri> ' - . 'where $member <fedora-rels-ext:isMemberOf> <info:fedora/' . $root . '> ' + . 'where $member <fedora-rels-ext:isMemberOf> <info:fedora/' + . $root . '> ' . 'and $member <fedora-model:label> $memberTitle ' . 'and $member <dc:identifier> $memberPID ' . 'order by $memberTitle'; diff --git a/module/VuFind/src/VuFind/Connection/Oracle.php b/module/VuFind/src/VuFind/Connection/Oracle.php index 46d29ff1e6e..79455695230 100644 --- a/module/VuFind/src/VuFind/Connection/Oracle.php +++ b/module/VuFind/src/VuFind/Connection/Oracle.php @@ -366,7 +366,9 @@ class Oracle // Bind Variables foreach (array_keys($data) as $column) { - $this->bindParam($delete, ":" . $column, $data[$column], $types[$column]); + $this->bindParam( + $delete, ":" . $column, $data[$column], $types[$column] + ); } // Execute @@ -421,7 +423,9 @@ class Oracle // Bind Variables foreach (array_keys($data) as $column) { - $this->bindParam($insert, ":" . $column, $data[$column], $types[$column]); + $this->bindParam( + $insert, ":" . $column, $data[$column], $types[$column] + ); } // Execute diff --git a/module/VuFind/src/VuFind/Connection/Wikipedia.php b/module/VuFind/src/VuFind/Connection/Wikipedia.php index 68dbcb2fb8b..8f1b1229631 100644 --- a/module/VuFind/src/VuFind/Connection/Wikipedia.php +++ b/module/VuFind/src/VuFind/Connection/Wikipedia.php @@ -262,7 +262,7 @@ class Wikipedia implements TranslatorAwareInterface // We can either find content or recursive brackets: $recursive_match = "($content|(?R))*"; $body .= "[[file:bad]]"; - preg_match_all("/" . $open . $recursive_match . $close . "/Us", $body, $new_matches); + preg_match_all("/{$open}{$recursive_match}{$close}/Us", $body, $new_matches); // Loop through every match (link) we found if (is_array($new_matches)) { foreach ($new_matches as $nm) { diff --git a/module/VuFind/src/VuFind/Controller/InstallController.php b/module/VuFind/src/VuFind/Controller/InstallController.php index 600b1cca7fa..c4538ed5bd5 100644 --- a/module/VuFind/src/VuFind/Controller/InstallController.php +++ b/module/VuFind/src/VuFind/Controller/InstallController.php @@ -266,8 +266,8 @@ class InstallController extends AbstractBase if (!function_exists('mb_substr')) { $msg = "Your PHP installation appears to be missing the mbstring plug-in." - . " For better language support, it is recommended that you add this." - . " For details on how to do this, see " + . " For better language support, it is recommended that you add" + . " this. For details on how to do this, see " . "http://vufind.org/wiki/vufind2:installation_notes " . "and look at the PHP installation instructions for your platform."; $this->flashMessenger()->setNamespace('error')->addMessage($msg); @@ -290,8 +290,8 @@ class InstallController extends AbstractBase if (!function_exists('mcrypt_module_open')) { $msg = "Your PHP installation appears to be missing the mcrypt plug-in." - . " For better security support, it is recommended that you add this." - . " For details on how to do this, see " + . " For better security support, it is recommended that you add" + . " this. For details on how to do this, see " . "http://vufind.org/wiki/vufind2:installation_notes " . "and look at the PHP installation instructions for your platform."; $this->flashMessenger()->setNamespace('error')->addMessage($msg); diff --git a/module/VuFind/src/VuFind/ILS/Driver/Amicus.php b/module/VuFind/src/VuFind/ILS/Driver/Amicus.php index a5fca4f5f36..bf88b22e419 100644 --- a/module/VuFind/src/VuFind/ILS/Driver/Amicus.php +++ b/module/VuFind/src/VuFind/ILS/Driver/Amicus.php @@ -222,10 +222,10 @@ class Amicus extends AbstractBase implements TranslatorAwareInterface */ protected function sacaFecha($copyId) { - $circulacion = "SELECT to_char(CIRT_ITM_DUE_DTE,'dd-mm-yyyy') AS FECHADEV, " . - "ROUND(CIRT_ITM_DUE_DTE - SYSDATE) AS DIFERENCIA " . - "FROM CIRT_ITM " . - "WHERE CPY_ID_NBR = '$copyId'"; + $circulacion = "SELECT to_char(CIRT_ITM_DUE_DTE,'dd-mm-yyyy') AS FECHADEV, " + . "ROUND(CIRT_ITM_DUE_DTE - SYSDATE) AS DIFERENCIA " + . "FROM CIRT_ITM " + . "WHERE CPY_ID_NBR = '$copyId'"; $fecha = 0; $diferencia = 0; try { @@ -633,14 +633,14 @@ class Amicus extends AbstractBase implements TranslatorAwareInterface { $fineList = array(); - $sql = "SELECT UNIQUE TO_CHAR(CIRT_ITM.CIRT_ITM_CHRG_OUT_DTE,'DD/MM/YYYY') " . - "AS ORIG_CHARGE_DATE, " . - "TO_CHAR(CIRT_ITM.CIRT_ITM_DUE_DTE,'DD/MM/YYYY') AS DUE_DATE, " . - "CIRT_ITM.BIB_ITM_NBR AS BIB_ID " . - "FROM CIRT_ITM, LV_USER " . - "WHERE CIRT_ITM.PRSN_NBR = LV_USER.PRSN_NBR " . - "AND CIRT_ITM_DUE_DTE < SYSDATE " . - "AND LV_USER.LOGIN='" . $patron['id'] . "'"; + $sql = "SELECT UNIQUE TO_CHAR(CIRT_ITM.CIRT_ITM_CHRG_OUT_DTE,'DD/MM/YYYY') " + . "AS ORIG_CHARGE_DATE, " + . "TO_CHAR(CIRT_ITM.CIRT_ITM_DUE_DTE,'DD/MM/YYYY') AS DUE_DATE, " + . "CIRT_ITM.BIB_ITM_NBR AS BIB_ID " + . "FROM CIRT_ITM, LV_USER " + . "WHERE CIRT_ITM.PRSN_NBR = LV_USER.PRSN_NBR " + . "AND CIRT_ITM_DUE_DTE < SYSDATE " + . "AND LV_USER.LOGIN='" . $patron['id'] . "'"; try { $sqlStmt = $this->db->prepare($sql); $sqlStmt->execute(); diff --git a/module/VuFind/src/VuFind/ILS/Driver/Demo.php b/module/VuFind/src/VuFind/ILS/Driver/Demo.php index e1be6da2a83..03789f7e895 100644 --- a/module/VuFind/src/VuFind/ILS/Driver/Demo.php +++ b/module/VuFind/src/VuFind/ILS/Driver/Demo.php @@ -292,9 +292,10 @@ class Demo extends AbstractBase $list = new ArrayObject(); for ($i = 0; $i < $items; $i++) { $location = $this->getFakeLoc(false); + $randDays = rand() % 10; $currentItem = array( "location" => $location, - "create" => date("j-M-y", strtotime("now - " . (rand()%10) . " days")), + "create" => date("j-M-y", strtotime("now - {$randDays} days")), "expire" => date("j-M-y", strtotime("now + 30 days")), "reqnum" => sprintf("%06d", $i), "item_id" => $i, diff --git a/module/VuFind/src/VuFind/ILS/Driver/HorizonXMLAPI.php b/module/VuFind/src/VuFind/ILS/Driver/HorizonXMLAPI.php index bbc605de93d..04f55a62f67 100644 --- a/module/VuFind/src/VuFind/ILS/Driver/HorizonXMLAPI.php +++ b/module/VuFind/src/VuFind/ILS/Driver/HorizonXMLAPI.php @@ -866,8 +866,7 @@ class HorizonXMLAPI extends Horizon implements \VuFindHttp\HttpServiceAwareInter */ public function getRenewDetails($checkOutDetails) { - $renewDetails = $checkOutDetails['item_id'] . "|" . $checkOutDetails['barcode']; - return $renewDetails; + return $checkOutDetails['item_id'] . "|" . $checkOutDetails['barcode']; } /** diff --git a/module/VuFind/src/VuFind/ILS/Driver/LBS4.php b/module/VuFind/src/VuFind/ILS/Driver/LBS4.php index ff3796a3154..74d482517f5 100644 --- a/module/VuFind/src/VuFind/ILS/Driver/LBS4.php +++ b/module/VuFind/src/VuFind/ILS/Driver/LBS4.php @@ -579,9 +579,11 @@ class LBS4 extends AbstractBase implements TranslatorAwareInterface if ($row) { if ($row[8] == $row[13]) { //reminder address first $result['address2'] = $result['address1']; - $result['address1'] = $row[10] . ', ' . $row[9] . ' ' . $row[11]; + $result['address1'] + = $row[10] . ', ' . $row[9] . ' ' . $row[11]; } else { - $result['address2'] = $row[10] . ', ' . $row[9] . ' ' . $row[11]; + $result['address2'] + = $row[10] . ', ' . $row[9] . ' ' . $row[11]; } } return $result; diff --git a/module/VuFind/src/VuFind/ILS/Driver/Virtua.php b/module/VuFind/src/VuFind/ILS/Driver/Virtua.php index f83f4993d67..3c04c0b274c 100644 --- a/module/VuFind/src/VuFind/ILS/Driver/Virtua.php +++ b/module/VuFind/src/VuFind/ILS/Driver/Virtua.php @@ -747,7 +747,8 @@ class Virtua extends AbstractBase implements \VuFindHttp\HttpServiceAwareInterfa $years = explode("-", $data['data'][0]); $y = count($years); $dmy = $d . $m . $y; - $start_time = strtotime($days[0] . "-" . $months[0] . "-" . $years[0]); + $start_time + = strtotime($days[0] . "-" . $months[0] . "-" . $years[0]); $end_string = "jS F Y"; switch ($dmy) { diff --git a/module/VuFind/src/VuFind/ILS/Driver/XCNCIP2.php b/module/VuFind/src/VuFind/ILS/Driver/XCNCIP2.php index 23480719f70..02d44c2acc5 100644 --- a/module/VuFind/src/VuFind/ILS/Driver/XCNCIP2.php +++ b/module/VuFind/src/VuFind/ILS/Driver/XCNCIP2.php @@ -1390,8 +1390,7 @@ class XCNCIP2 extends AbstractBase implements \VuFindHttp\HttpServiceAwareInterf */ public function getCancelStorageRetrievalRequestDetails($callslipDetails) { - $cancelDetails = $callslipDetails['id'] . "|" . $callslipDetails['requestId']; - return $cancelDetails; + return $callslipDetails['id'] . "|" . $callslipDetails['requestId']; } /** diff --git a/module/VuFind/src/VuFind/RecordDriver/EDS.php b/module/VuFind/src/VuFind/RecordDriver/EDS.php index 070935eea66..7b98ac75d64 100644 --- a/module/VuFind/src/VuFind/RecordDriver/EDS.php +++ b/module/VuFind/src/VuFind/RecordDriver/EDS.php @@ -350,7 +350,8 @@ class EDS extends SolrDefault { $authors = array(); if (isset($this->fields['RecordInfo']['BibRecord']['BibRelationships'])) { - $bibRels = & $this->fields['RecordInfo']['BibRecord']['BibRelationships']; + $bibRels + = & $this->fields['RecordInfo']['BibRecord']['BibRelationships']; } if (isset($bibRels['HasContributorRelationships']) && !empty($bibRels['HasContributorRelationships']) diff --git a/module/VuFindTheme/src/VuFindTheme/LessCompiler.php b/module/VuFindTheme/src/VuFindTheme/LessCompiler.php index e3216f150ae..72f485fe407 100644 --- a/module/VuFindTheme/src/VuFindTheme/LessCompiler.php +++ b/module/VuFindTheme/src/VuFindTheme/LessCompiler.php @@ -142,7 +142,9 @@ class LessCompiler } } - \Less_Cache::SetCacheDir(APPLICATION_PATH . '/themes/' . $theme . '/css/less/'); + \Less_Cache::SetCacheDir( + APPLICATION_PATH . '/themes/' . $theme . '/css/less/' + ); \Less_Cache::CleanCache(); // deletes week old files } -- GitLab