Various code cleanup.

This commit is contained in:
James Cole
2017-12-22 18:32:43 +01:00
parent f13a93348f
commit 8bd76d1ff0
188 changed files with 383 additions and 396 deletions

View File

@@ -63,7 +63,7 @@ class Account extends Model
* @var array
*/
protected $rules
= [
= [
'user_id' => 'required|exists:users,id',
'account_type_id' => 'required|exists:account_types,id',
'name' => 'required|between:1,200',
@@ -118,7 +118,7 @@ class Account extends Model
*
* @return Account
*/
public static function routeBinder(Account $value)
public static function routeBinder(self $value)
{
if (auth()->check()) {
if (intval($value->user_id) === auth()->user()->id) {
@@ -218,7 +218,6 @@ class Account extends Model
* Returns the opening balance.
*
* @return TransactionJournal
*
*/
public function getOpeningBalance(): TransactionJournal
{
@@ -268,7 +267,6 @@ class Account extends Model
* Returns the date of the opening balance for this account. If no date, will return 01-01-1900.
*
* @return Carbon
*
*/
public function getOpeningBalanceDate(): Carbon
{

View File

@@ -30,7 +30,7 @@ use Illuminate\Database\Eloquent\Relations\HasMany;
*/
class AccountType extends Model
{
const DEFAULT = 'Default account';
const DEFAULT = 'Default account';
/**
*
*/

View File

@@ -42,7 +42,7 @@ class Bill extends Model
* @var array
*/
protected $casts
= [
= [
'created_at' => 'datetime',
'updated_at' => 'datetime',
'deleted_at' => 'datetime',
@@ -57,8 +57,8 @@ class Bill extends Model
* @var array
*/
protected $fillable
= ['name', 'match', 'amount_min', 'match_encrypted', 'name_encrypted', 'user_id', 'amount_max', 'date', 'repeat_freq', 'skip',
'automatch', 'active',];
= ['name', 'match', 'amount_min', 'match_encrypted', 'name_encrypted', 'user_id', 'amount_max', 'date', 'repeat_freq', 'skip',
'automatch', 'active',];
/**
* @var array
*/

View File

@@ -38,7 +38,7 @@ class Configuration extends Model
* @var array
*/
protected $casts
= [
= [
'created_at' => 'datetime',
'updated_at' => 'datetime',
];

View File

@@ -179,6 +179,7 @@ class ImportJob extends Model
/**
* @return string
*
* @throws \Illuminate\Contracts\Filesystem\FileNotFoundException
*/
public function uploadFileContents(): string

View File

@@ -41,7 +41,7 @@ class PiggyBankEvent extends Model
'date' => 'datetime',
];
/** @var array */
protected $dates = ['date'];
protected $dates = ['date'];
/**
* @var array
*/

View File

@@ -18,12 +18,10 @@
* You should have received a copy of the GNU General Public License
* along with Firefly III. If not, see <http://www.gnu.org/licenses/>.
*/
declare(strict_types=1);
namespace FireflyIII\Models;
use Illuminate\Database\Eloquent\Model;
/**
@@ -51,5 +49,4 @@ class SpectreProvider extends Model
* @var array
*/
protected $fillable = ['spectre_id', 'code', 'mode', 'name', 'status', 'interactive', 'automatic_fetch', 'country_code', 'data'];
}
}

View File

@@ -105,6 +105,7 @@ class Tag extends Model
* @param Tag $tag
*
* @return string
*
* @throws \FireflyIII\Exceptions\FireflyException
*/
public static function tagSum(self $tag): string

View File

@@ -75,7 +75,7 @@ class Transaction extends Model
* @var array
*/
protected $casts
= [
= [
'created_at' => 'datetime',
'updated_at' => 'datetime',
'deleted_at' => 'datetime',
@@ -88,8 +88,8 @@ class Transaction extends Model
* @var array
*/
protected $fillable
= ['account_id', 'transaction_journal_id', 'description', 'amount', 'identifier', 'transaction_currency_id', 'foreign_currency_id',
'foreign_amount',];
= ['account_id', 'transaction_journal_id', 'description', 'amount', 'identifier', 'transaction_currency_id', 'foreign_currency_id',
'foreign_amount',];
/**
* @var array
*/
@@ -98,7 +98,7 @@ class Transaction extends Model
* @var array
*/
protected $rules
= [
= [
'account_id' => 'required|exists:accounts,id',
'transaction_journal_id' => 'required|exists:transaction_journals,id',
'transaction_currency_id' => 'required|exists:transaction_currencies,id',