Code clean up and reformat.

This commit is contained in:
James Cole
2014-11-12 22:37:09 +01:00
parent 258d6a1688
commit 4aa9a04516
33 changed files with 1543 additions and 1611 deletions

View File

@@ -3,12 +3,12 @@
namespace FireflyIII\Database;
use FireflyIII\Exception\NotImplementedException;
use Illuminate\Support\Collection;
use LaravelBook\Ardent\Ardent;
use FireflyIII\Database\Ifaces\CommonDatabaseCalls;
use FireflyIII\Database\Ifaces\CUD;
use FireflyIII\Database\Ifaces\TransactionCurrencyInterface;
use FireflyIII\Exception\NotImplementedException;
use Illuminate\Support\Collection;
use LaravelBook\Ardent\Ardent;
/**
* Class TransactionType
@@ -19,16 +19,6 @@ class TransactionCurrency implements TransactionCurrencyInterface, CUD, CommonDa
{
/**
* @param string $code
*
* @return \TransactionCurrency|null
*/
public function findByCode($code)
{
return \TransactionCurrency::whereCode($code)->first();
}
/**
* @param Ardent $model
*
@@ -41,16 +31,25 @@ class TransactionCurrency implements TransactionCurrencyInterface, CUD, CommonDa
}
/**
* Validates a model. Returns an array containing MessageBags
* errors/warnings/successes.
* @param array $data
*
* @param Ardent $model
*
* @return array
* @return Ardent
*/
public function validateObject(Ardent $model)
public function store(array $data)
{
// TODO: Implement validateObject() method.
// TODO: Implement store() method.
throw new NotImplementedException;
}
/**
* @param Ardent $model
* @param array $data
*
* @return bool
*/
public function update(Ardent $model, array $data)
{
// TODO: Implement update() method.
throw new NotImplementedException;
}
@@ -69,25 +68,16 @@ class TransactionCurrency implements TransactionCurrencyInterface, CUD, CommonDa
}
/**
* @param array $data
* Validates a model. Returns an array containing MessageBags
* errors/warnings/successes.
*
* @return Ardent
*/
public function store(array $data)
{
// TODO: Implement store() method.
throw new NotImplementedException;
}
/**
* @param Ardent $model
* @param array $data
*
* @return bool
* @return array
*/
public function update(Ardent $model, array $data)
public function validateObject(Ardent $model)
{
// TODO: Implement update() method.
// TODO: Implement validateObject() method.
throw new NotImplementedException;
}
@@ -104,6 +94,19 @@ class TransactionCurrency implements TransactionCurrencyInterface, CUD, CommonDa
throw new NotImplementedException;
}
/**
* Finds an account type using one of the "$what"'s: expense, asset, revenue, opening, etc.
*
* @param $what
*
* @return \AccountType|null
*/
public function findByWhat($what)
{
// TODO: Implement findByWhat() method.
throw new NotImplementedException;
}
/**
* Returns all objects.
*
@@ -127,15 +130,12 @@ class TransactionCurrency implements TransactionCurrencyInterface, CUD, CommonDa
}
/**
* Finds an account type using one of the "$what"'s: expense, asset, revenue, opening, etc.
* @param string $code
*
* @param $what
*
* @return \AccountType|null
* @return \TransactionCurrency|null
*/
public function findByWhat($what)
public function findByCode($code)
{
// TODO: Implement findByWhat() method.
throw new NotImplementedException;
return \TransactionCurrency::whereCode($code)->first();
}
}