Improve CS.

This commit is contained in:
Marco Vito Moscaritolo 2015-05-31 16:01:51 +02:00
commit 180bdcf4fe
6 changed files with 63 additions and 15 deletions

View file

@ -223,6 +223,7 @@ class BuildController extends \PHPCI\Controller
$response = new JsonResponse();
$response->setContent($rtn);
return $response;
}

View file

@ -34,9 +34,19 @@ abstract class BaseCommandExecutor implements CommandExecutor
*/
protected $verbose;
/**
* @var string
*/
protected $lastOutput;
/**
* @var string
*/
protected $lastError;
/**
* @var bool
*/
public $logExecOutput = true;
/**

View file

@ -22,8 +22,10 @@ class BuildMetaStoreBase extends Store
/**
* Returns a BuildMeta model by primary key.
*
* @param mixed $value
* @param string $useConnection
*
* @return \@appNamespace\Model\BuildMeta|null
*/
public function getByPrimaryKey($value, $useConnection = 'read')
@ -33,10 +35,13 @@ class BuildMetaStoreBase extends Store
/**
* Returns a BuildMeta model by Id.
*
* @param mixed $value
* @param string $useConnection
* @throws HttpException
*
* @return \@appNamespace\Model\BuildMeta|null
*
* @throws HttpException
*/
public function getById($value, $useConnection = 'read')
{
@ -59,11 +64,14 @@ class BuildMetaStoreBase extends Store
/**
* Returns an array of BuildMeta models by ProjectId.
*
* @param mixed $value
* @param int $limit
* @param string $useConnection
* @throws HttpException
*
* @return array
*
* @throws HttpException
*/
public function getByProjectId($value, $limit = 1000, $useConnection = 'read')
{
@ -71,7 +79,6 @@ class BuildMetaStoreBase extends Store
throw new HttpException('Value passed to ' . __FUNCTION__ . ' cannot be null.');
}
$query = 'SELECT * FROM `build_meta` WHERE `project_id` = :project_id LIMIT :limit';
$stmt = Database::getConnection($useConnection)->prepare($query);
$stmt->bindValue(':project_id', $value);
@ -95,11 +102,14 @@ class BuildMetaStoreBase extends Store
/**
* Returns an array of BuildMeta models by BuildId.
*
* @param mixed $value
* @param int $limit
* @param string $useConnection
* @throws HttpException
*
* @return array
*
* @throws HttpException
*/
public function getByBuildId($value, $limit = 1000, $useConnection = 'read')
{
@ -107,7 +117,6 @@ class BuildMetaStoreBase extends Store
throw new HttpException('Value passed to ' . __FUNCTION__ . ' cannot be null.');
}
$query = 'SELECT * FROM `build_meta` WHERE `build_id` = :build_id LIMIT :limit';
$stmt = Database::getConnection($useConnection)->prepare($query);
$stmt->bindValue(':build_id', $value);

View file

@ -22,8 +22,10 @@ class BuildStoreBase extends Store
/**
* Returns a Build model by primary key.
*
* @param mixed $value
* @param string $useConnection
*
* @return \@appNamespace\Model\Build|null
*/
public function getByPrimaryKey($value, $useConnection = 'read')
@ -33,10 +35,13 @@ class BuildStoreBase extends Store
/**
* Returns a Build model by Id.
*
* @param mixed $value
* @param string $useConnection
* @throws HttpException
*
* @return \@appNamespace\Model\Build|null
*
* @throws HttpException
*/
public function getById($value, $useConnection = 'read')
{
@ -59,10 +64,13 @@ class BuildStoreBase extends Store
/**
* Returns an array of Build models by ProjectId.
*
* @param mixed $value
* @param int $limit
* @param string $useConnection
*
* @throws HttpException
*
* @return array
*/
public function getByProjectId($value, $limit = 1000, $useConnection = 'read')
@ -95,11 +103,14 @@ class BuildStoreBase extends Store
/**
* Returns an array of Build models by Status.
*
* @param mixed $value
* @param int $limit
* @param string $useConnection
* @throws HttpException
*
* @return array
*
* @throws HttpException
*/
public function getByStatus($value, $limit = 1000, $useConnection = 'read')
{
@ -107,7 +118,6 @@ class BuildStoreBase extends Store
throw new HttpException('Value passed to ' . __FUNCTION__ . ' cannot be null.');
}
$query = 'SELECT * FROM `build` WHERE `status` = :status LIMIT :limit';
$stmt = Database::getConnection($useConnection)->prepare($query);
$stmt->bindValue(':status', $value);

View file

@ -22,8 +22,10 @@ class ProjectStoreBase extends Store
/**
* Returns a Project model by primary key.
*
* @param mixed $value
* @param string $useConnection
*
* @return \@appNamespace\Model\Project|null
*/
public function getByPrimaryKey($value, $useConnection = 'read')
@ -33,10 +35,13 @@ class ProjectStoreBase extends Store
/**
* Returns a Project model by Id.
*
* @param mixed $value
* @param string $useConnection
* @throws HttpException
*
* @return \@appNamespace\Model\Project|null
*
* @throws HttpException
*/
public function getById($value, $useConnection = 'read')
{
@ -59,11 +64,14 @@ class ProjectStoreBase extends Store
/**
* Returns an array of Project models by Title.
*
* @param mixed $value
* @param int $limit
* @param string $useConnection
* @throws HttpException
*
* @return array
*
* @throws HttpException
*/
public function getByTitle($value, $limit = 1000, $useConnection = 'read')
{
@ -71,7 +79,6 @@ class ProjectStoreBase extends Store
throw new HttpException('Value passed to ' . __FUNCTION__ . ' cannot be null.');
}
$query = 'SELECT * FROM `project` WHERE `title` = :title LIMIT :limit';
$stmt = Database::getConnection($useConnection)->prepare($query);
$stmt->bindValue(':title', $value);

View file

@ -22,8 +22,10 @@ class UserStoreBase extends Store
/**
* Returns a User model by primary key.
*
* @param mixed $value
* @param string $useConnection
*
* @return \@appNamespace\Model\User|null
*/
public function getByPrimaryKey($value, $useConnection = 'read')
@ -33,10 +35,13 @@ class UserStoreBase extends Store
/**
* Returns a User model by Id.
*
* @param mixed $value
* @param string $useConnection
* @throws HttpException
*
* @return \@appNamespace\Model\User|null
*
* @throws HttpException
*/
public function getById($value, $useConnection = 'read')
{
@ -59,10 +64,13 @@ class UserStoreBase extends Store
/**
* Returns a User model by Email.
*
* @param string $value
* @param string $useConnection
*
* @return \@appNamespace\Model\User|null
*
* @throws HttpException
* @return \@appNamespace\Model\User|null
*/
public function getByEmail($value, $useConnection = 'read')
{
@ -82,13 +90,16 @@ class UserStoreBase extends Store
return null;
}
/**
* Returns a User model by Email.
*
* @param string $value
* @param string $useConnection
* @throws HttpException
*
* @return \@appNamespace\Model\User|null
*
* @throws HttpException
*/
public function getByLoginOrEmail($value, $useConnection = 'read')
{