Skip to content

Commit

Permalink
Dev Fixed Scrutinizer issues
Browse files Browse the repository at this point in the history
  • Loading branch information
c-schmitz committed Dec 11, 2017
1 parent a5ce5c6 commit 0cf80e4
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 15 deletions.
1 change: 1 addition & 0 deletions .scrutinizer.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ tools:
- 'third_party/*'
- 'application/helpers/adodb/*'
- 'application/libraries/admin/http/*'
- 'application/libraries/admin/Services_JSON.php'
- 'application/libraries/admin/pclzip/*'
- 'application/extensions/*'
- 'application/views/*'
Expand Down
2 changes: 1 addition & 1 deletion application/controllers/admin/assessments.php
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ public function index($iSurveyID)
* Renders template(s) wrapped in header and footer
*
* @param string $sAction Current action, the folder to fetch views from
* @param array $aViewUrls View url(s)
* @param array|string $aViewUrls View url(s)
* @param array $aData Data to be passed on. Optional.
*/
protected function _renderWrappedTemplate($sAction = 'assessments', $aViewUrls = array(), $aData = array())
Expand Down
4 changes: 2 additions & 2 deletions application/core/Survey_Common_Action.php
Original file line number Diff line number Diff line change
Expand Up @@ -246,8 +246,8 @@ public function renderInternal($_viewFile_, $_data_ = null, $_return_ = false)
* Rendering the subviews and views of _renderWrappedTemplate
*
* @param string $sAction
* @param array $aViewUrls
* @param array|string $aData
* @param array|string $aViewUrls
* @param array $aData
* @return string
*/
private function renderCentralContents($sAction, $aViewUrls, $aData = [])
Expand Down
24 changes: 12 additions & 12 deletions application/models/ParticipantAttributeName.php
Original file line number Diff line number Diff line change
Expand Up @@ -261,7 +261,7 @@ function getAllAttributesValues()
* @param mixed $sLanguageFilter
* @return array
*/
function getVisibleAttributes($sLanguageFilter = null)
public function getVisibleAttributes($sLanguageFilter = null)
{
if ($sLanguageFilter == null) {
$sLanguageFilter = Yii::app()->session['adminlang'];
Expand Down Expand Up @@ -319,7 +319,7 @@ function getVisibleAttributes($sLanguageFilter = null)
* @param string $participant_id the id of the participant to return values/names for (if empty, returns all)
* @return array
*/
function getParticipantVisibleAttribute($participant_id)
public function getParticipantVisibleAttribute($participant_id)
{
$output = array();

Expand Down Expand Up @@ -372,7 +372,7 @@ function getParticipantVisibleAttribute($participant_id)
}
}

function getAttributeValue($participantid, $attributeid)
public function getAttributeValue($participantid, $attributeid)
{
$data = Yii::app()->db->createCommand()
->select('*')
Expand Down Expand Up @@ -417,7 +417,7 @@ function getCPDBAttributes()
* @param int $attribute_id
* @return array
*/
function getAttributesValues($attribute_id = null)
public function getAttributesValues($attribute_id = null)
{
if (empty($attribute_id)) {
return array();
Expand All @@ -438,7 +438,7 @@ function getAttributesValues($attribute_id = null)
* @param array $attributeIds
* @return array
*/
function getNotAddedAttributes($attributeIds)
public function getNotAddedAttributes($attributeIds)
{
$output = array();
$notin = array();
Expand Down Expand Up @@ -475,7 +475,7 @@ function getNotAddedAttributes($attributeIds)
* @param mixed $data
* @return bool|int
*/
function storeAttribute($data)
public function storeAttribute($data)
{
// Do not allow more than 60 attributes because queries will break because of too many joins
if (ParticipantAttributeName::model()->count() > 59) {
Expand All @@ -495,7 +495,7 @@ function storeAttribute($data)
return $iAttributeID;
}

function editParticipantAttributeValue($data)
public function editParticipantAttributeValue($data)
{
$query = ParticipantAttribute::model()
->find('participant_id = :participant_id AND attribute_id=:attribute_id',
Expand All @@ -520,7 +520,7 @@ function editParticipantAttributeValue($data)
* @param integer $attid
* @return void
*/
public function delAttribute($attid)
public public function delAttribute($attid)
{
Yii::app()->db->createCommand()->delete('{{participant_attribute_names_lang}}', 'attribute_id = '.$attid);
Yii::app()->db->createCommand()->delete('{{participant_attribute_names}}', 'attribute_id = '.$attid);
Expand Down Expand Up @@ -558,7 +558,7 @@ public function getAttributeNames($attributeid)
* @param string $lang
* @return ParticipantAttributeNameLang
*/
function getAttributeName($attributeid, $lang = 'en')
public function getAttributeName($attributeid, $lang = 'en')
{
return Yii::app()->db->createCommand()
->select('*')
Expand All @@ -576,7 +576,7 @@ function getAttributeName($attributeid, $lang = 'en')
* @return ParticipantAttributeName
* TODO: Tonis: this is a bad name for this method - it overrides parent method doing totally different thing
*/
function getAttribute($attribute_id)
public function getAttribute($attribute_id)
{
$data = Yii::app()->db->createCommand()
->select('*')
Expand Down Expand Up @@ -619,7 +619,7 @@ function saveAttribute($data)
* @todo Doc
* @param array $data
*/
function saveAttributeLanguages($data)
public function saveAttributeLanguages($data)
{
$query = Yii::app()->db
->createCommand()
Expand Down Expand Up @@ -650,7 +650,7 @@ function saveAttributeLanguages($data)
/**
* @param array $data
*/
public function storeAttributeValues($data)
public public function storeAttributeValues($data)
{
foreach ($data as $record) {
Yii::app()->db->createCommand()->insert('{{participant_attribute_values}}', $record);
Expand Down

0 comments on commit 0cf80e4

Please sign in to comment.