Skip to content
This repository has been archived by the owner on Sep 10, 2021. It is now read-only.

Commit

Permalink
Applied fixes from StyleCI
Browse files Browse the repository at this point in the history
  • Loading branch information
Jamie Snape authored and StyleCIBot committed Aug 5, 2015
1 parent f7eb3bd commit ec9d13e
Show file tree
Hide file tree
Showing 8 changed files with 10 additions and 22 deletions.
2 changes: 0 additions & 2 deletions modules/tracker/controllers/api/SubmissionController.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,6 @@

/**
* API submission controller for the tracker module.
*
* @package Modules\Tracker\Controller
*/
class Apitracker_SubmissionController extends ApiController
{
Expand Down
2 changes: 1 addition & 1 deletion modules/tracker/controllers/components/ApiComponent.php
Original file line number Diff line number Diff line change
Expand Up @@ -350,7 +350,6 @@ public function scalarAdd($args)
public function resultsUploadJson($args)
{
/** Change this to add a submission id or uuid. */

$submissionId = -1;
/** @var CommunityModel $communityModel */
$communityModel = MidasLoader::loadModel('Community');
Expand Down Expand Up @@ -658,6 +657,7 @@ public function submissionAdd($args)
/** @var Tracker_ApisubmissionComponent $newApi */
$newApi = MidasLoader::loadComponent('Apisubmission',
'tracker');

return $newApi->post($args);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,6 @@

/**
* API submission component for the tracker module.
*
* @package Modules\Tracker\Component
*/
class Tracker_ApisubmissionComponent extends AppComponent
{
Expand Down
20 changes: 8 additions & 12 deletions modules/tracker/database/upgrade/1.2.0.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,32 +20,29 @@

/**
* Upgrade the tracker module to version 1.2.0.
*
* @package Modules\Tracker\Database
*/
class Tracker_Upgrade_1_2_0 extends MIDASUpgrade
{

/** Upgrade a MySQL database. */
public function mysql()
{
$this->db->query("ALTER TABLE `tracker_scalar` ADD COLUMN `submission_id` bigint(20) NOT NULL DEFAULT '-1';");
$this->db->query(
"CREATE TABLE IF NOT EXISTS `tracker_submission` (" .
" PRIMARY KEY (`submission_id`)," .
" `submission_id` bigint(20) NOT NULL AUTO_INCREMENT,".
" `producer_id` bigint(20) NOT NULL,".
'CREATE TABLE IF NOT EXISTS `tracker_submission` ('.
' PRIMARY KEY (`submission_id`),'.
' `submission_id` bigint(20) NOT NULL AUTO_INCREMENT,'.
' `producer_id` bigint(20) NOT NULL,'.
" `name` varchar(255) NOT NULL DEFAULT '',".
" `uuid` varchar(255) NOT NULL DEFAULT '',".
" `submit_time` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,".
" UNIQUE KEY (`uuid`)".
") DEFAULT CHARSET=utf8;");
' `submit_time` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,'.
' UNIQUE KEY (`uuid`)'.
') DEFAULT CHARSET=utf8;');
}

/** Upgrade a PostgreSQL database. */
public function pgsql()
{
$this->db->query("ALTER TABLE tracker_scalar ADD COLUMN submission_id bigint NOT NULL DEFAULT -1::bigint;");
$this->db->query('ALTER TABLE tracker_scalar ADD COLUMN submission_id bigint NOT NULL DEFAULT -1::bigint;');
$this->db->query(
'CREATE TABLE IF NOT EXISTS "tracker_submission" ('.
' "submission_id" serial PRIMARY KEY,'.
Expand All @@ -57,5 +54,4 @@ public function pgsql()
$this->db->query('CREATE UNIQUE INDEX "tracker_submission_uuid" ON "tracker_submission" ("uuid");');
$this->db->query('CREATE INDEX "tracker_submission_submit_time" ON "tracker_submission" ("submit_time");');
}

}
2 changes: 0 additions & 2 deletions modules/tracker/models/base/SubmissionModelBase.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,6 @@

/**
* Submission base model class for the tracker module.
*
* @package Modules\Tracker\Model
*/
abstract class Tracker_SubmissionModelBase extends Tracker_AppModel
{
Expand Down
1 change: 0 additions & 1 deletion modules/tracker/models/dao/SubmissionDao.php
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@
* @method string setUuid(string $uuid)
* @method array getScalars()
* @method void setScalars(array $scalarDaos)
* @package Modules\Tracker\DAO
*/
class Tracker_SubmissionDao extends Tracker_AppDao
{
Expand Down
2 changes: 0 additions & 2 deletions modules/tracker/models/pdo/SubmissionModel.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,6 @@

/**
* Submission model for the tracker module.
*
* @package Modules\Tracker\Model
*/
class Tracker_SubmissionModel extends Tracker_SubmissionModelBase
{
Expand Down
1 change: 1 addition & 0 deletions modules/tracker/tests/controllers/ApiControllerTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,7 @@ protected function _submitScalar($token, $uuid, $metric, $value)
$this->params['submissionUuid'] = $uuid;

$res = $this->_callJsonApi();

return $res->data;
}
}

0 comments on commit ec9d13e

Please sign in to comment.