mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-10-03 19:16:51 +00:00
Ignore basic methods, improving code coverage.
This commit is contained in:
@@ -23,7 +23,8 @@ declare(strict_types=1);
|
|||||||
namespace FireflyIII\Services\Github\Object;
|
namespace FireflyIII\Services\Github\Object;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Class SpectreObject
|
* @codeCoverageIgnore
|
||||||
|
* Class GithubObject
|
||||||
*/
|
*/
|
||||||
class GithubObject
|
class GithubObject
|
||||||
{
|
{
|
||||||
|
@@ -27,6 +27,7 @@ use Carbon\Carbon;
|
|||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
* @codeCoverageIgnore
|
||||||
* Class Release
|
* Class Release
|
||||||
*/
|
*/
|
||||||
class Release extends GithubObject
|
class Release extends GithubObject
|
||||||
|
@@ -23,8 +23,8 @@ declare(strict_types=1);
|
|||||||
|
|
||||||
namespace FireflyIII\Services\Internal\File;
|
namespace FireflyIII\Services\Internal\File;
|
||||||
|
|
||||||
use FireflyIII\Exceptions\FireflyException;
|
|
||||||
use Crypt;
|
use Crypt;
|
||||||
|
use FireflyIII\Exceptions\FireflyException;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Class EncryptService
|
* Class EncryptService
|
||||||
|
@@ -23,7 +23,6 @@ declare(strict_types=1);
|
|||||||
|
|
||||||
namespace FireflyIII\Services\Internal\Update;
|
namespace FireflyIII\Services\Internal\Update;
|
||||||
|
|
||||||
use FireflyIII\Exceptions\FireflyException;
|
|
||||||
use FireflyIII\Models\Transaction;
|
use FireflyIII\Models\Transaction;
|
||||||
use FireflyIII\Services\Internal\Support\TransactionServiceTrait;
|
use FireflyIII\Services\Internal\Support\TransactionServiceTrait;
|
||||||
use FireflyIII\User;
|
use FireflyIII\User;
|
||||||
|
@@ -24,6 +24,7 @@ declare(strict_types=1);
|
|||||||
namespace FireflyIII\Services\Spectre\Exception;
|
namespace FireflyIII\Services\Spectre\Exception;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
* @codeCoverageIgnore
|
||||||
* Class DuplicatedCustomerException
|
* Class DuplicatedCustomerException
|
||||||
*/
|
*/
|
||||||
class DuplicatedCustomerException extends SpectreException
|
class DuplicatedCustomerException extends SpectreException
|
||||||
|
@@ -26,6 +26,7 @@ namespace FireflyIII\Services\Spectre\Exception;
|
|||||||
use Exception;
|
use Exception;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
* @codeCoverageIgnore
|
||||||
* Class SpectreException
|
* Class SpectreException
|
||||||
*/
|
*/
|
||||||
class SpectreException extends Exception
|
class SpectreException extends Exception
|
||||||
|
@@ -24,6 +24,7 @@ declare(strict_types=1);
|
|||||||
namespace FireflyIII\Services\Spectre\Exception;
|
namespace FireflyIII\Services\Spectre\Exception;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
* @codeCoverageIgnore
|
||||||
* Class WrongRequestFormatException
|
* Class WrongRequestFormatException
|
||||||
*/
|
*/
|
||||||
class WrongRequestFormatException extends SpectreException
|
class WrongRequestFormatException extends SpectreException
|
||||||
|
@@ -26,6 +26,7 @@ namespace FireflyIII\Services\Spectre\Object;
|
|||||||
use Carbon\Carbon;
|
use Carbon\Carbon;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
* @codeCoverageIgnore
|
||||||
* Class Account
|
* Class Account
|
||||||
*/
|
*/
|
||||||
class Account extends SpectreObject
|
class Account extends SpectreObject
|
||||||
@@ -50,11 +51,24 @@ class Account extends SpectreObject
|
|||||||
private $updatedAt;
|
private $updatedAt;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @return string
|
* Account constructor.
|
||||||
|
*
|
||||||
|
* @param array $data
|
||||||
*/
|
*/
|
||||||
public function getNature(): string
|
public function __construct(array $data)
|
||||||
{
|
{
|
||||||
return $this->nature;
|
$this->id = (int)$data['id'];
|
||||||
|
$this->loginId = $data['login_id'];
|
||||||
|
$this->currencyCode = $data['currency_code'];
|
||||||
|
$this->balance = $data['balance'];
|
||||||
|
$this->name = $data['name'];
|
||||||
|
$this->nature = $data['nature'];
|
||||||
|
$this->createdAt = new Carbon($data['created_at']);
|
||||||
|
$this->updatedAt = new Carbon($data['updated_at']);
|
||||||
|
|
||||||
|
foreach ($data['extra'] as $key => $value) {
|
||||||
|
$this->extra[$key] = $value;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -81,29 +95,6 @@ class Account extends SpectreObject
|
|||||||
return $this->extra;
|
return $this->extra;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Account constructor.
|
|
||||||
*
|
|
||||||
* @param array $data
|
|
||||||
*/
|
|
||||||
public function __construct(array $data)
|
|
||||||
{
|
|
||||||
$this->id = (int)$data['id'];
|
|
||||||
$this->loginId = $data['login_id'];
|
|
||||||
$this->currencyCode = $data['currency_code'];
|
|
||||||
$this->balance = $data['balance'];
|
|
||||||
$this->name = $data['name'];
|
|
||||||
$this->nature = $data['nature'];
|
|
||||||
$this->createdAt = new Carbon($data['created_at']);
|
|
||||||
$this->updatedAt = new Carbon($data['updated_at']);
|
|
||||||
|
|
||||||
foreach ($data['extra'] as $key => $value) {
|
|
||||||
$this->extra[$key] = $value;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @return int
|
* @return int
|
||||||
*/
|
*/
|
||||||
@@ -120,6 +111,14 @@ class Account extends SpectreObject
|
|||||||
return $this->name;
|
return $this->name;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @return string
|
||||||
|
*/
|
||||||
|
public function getNature(): string
|
||||||
|
{
|
||||||
|
return $this->nature;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @return array
|
* @return array
|
||||||
*/
|
*/
|
||||||
|
@@ -26,6 +26,7 @@ namespace FireflyIII\Services\Spectre\Object;
|
|||||||
use Carbon\Carbon;
|
use Carbon\Carbon;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
* @codeCoverageIgnore
|
||||||
* Class Attempt
|
* Class Attempt
|
||||||
*/
|
*/
|
||||||
class Attempt extends SpectreObject
|
class Attempt extends SpectreObject
|
||||||
@@ -58,6 +59,8 @@ class Attempt extends SpectreObject
|
|||||||
private $failErrorClass;
|
private $failErrorClass;
|
||||||
/** @var string */
|
/** @var string */
|
||||||
private $failMessage;
|
private $failMessage;
|
||||||
|
/** @var array */
|
||||||
|
private $fetchScopes = [];
|
||||||
/** @var bool */
|
/** @var bool */
|
||||||
private $finished;
|
private $finished;
|
||||||
/** @var bool */
|
/** @var bool */
|
||||||
@@ -85,11 +88,9 @@ class Attempt extends SpectreObject
|
|||||||
/** @var Carbon */
|
/** @var Carbon */
|
||||||
private $toDate;
|
private $toDate;
|
||||||
/** @var Carbon */
|
/** @var Carbon */
|
||||||
private $updatedAt;
|
private $updatedAt; // undocumented
|
||||||
/** @var string */
|
/** @var string */
|
||||||
private $userAgent; // undocumented
|
private $userAgent;
|
||||||
/** @var array */
|
|
||||||
private $fetchScopes = [];
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Attempt constructor.
|
* Attempt constructor.
|
||||||
|
@@ -23,6 +23,7 @@ declare(strict_types=1);
|
|||||||
namespace FireflyIII\Services\Spectre\Object;
|
namespace FireflyIII\Services\Spectre\Object;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
* @codeCoverageIgnore
|
||||||
* Class Customer
|
* Class Customer
|
||||||
*/
|
*/
|
||||||
class Customer extends SpectreObject
|
class Customer extends SpectreObject
|
||||||
|
@@ -24,6 +24,7 @@ declare(strict_types=1);
|
|||||||
namespace FireflyIII\Services\Spectre\Object;
|
namespace FireflyIII\Services\Spectre\Object;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
* @codeCoverageIgnore
|
||||||
* Class Holder
|
* Class Holder
|
||||||
*/
|
*/
|
||||||
class Holder extends SpectreObject
|
class Holder extends SpectreObject
|
||||||
|
@@ -27,6 +27,7 @@ use Carbon\Carbon;
|
|||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
* @codeCoverageIgnore
|
||||||
* Class Login
|
* Class Login
|
||||||
*/
|
*/
|
||||||
class Login extends SpectreObject
|
class Login extends SpectreObject
|
||||||
@@ -68,6 +69,34 @@ class Login extends SpectreObject
|
|||||||
/** @var Carbon */
|
/** @var Carbon */
|
||||||
private $updatedAt;
|
private $updatedAt;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Login constructor.
|
||||||
|
*
|
||||||
|
* @param array $data
|
||||||
|
*/
|
||||||
|
public function __construct(array $data)
|
||||||
|
{
|
||||||
|
$this->consentGivenAt = new Carbon($data['consent_given_at']);
|
||||||
|
$this->consentTypes = $data['consent_types'];
|
||||||
|
$this->countryCode = $data['country_code'];
|
||||||
|
$this->createdAt = new Carbon($data['created_at']);
|
||||||
|
$this->updatedAt = new Carbon($data['updated_at']);
|
||||||
|
$this->customerId = $data['customer_id'];
|
||||||
|
$this->dailyRefresh = $data['daily_refresh'];
|
||||||
|
$this->holderInfo = new Holder($data['holder_info']);
|
||||||
|
$this->id = (int)$data['id'];
|
||||||
|
$this->lastAttempt = new Attempt($data['last_attempt']);
|
||||||
|
$this->lastSuccessAt = new Carbon($data['last_success_at']);
|
||||||
|
$this->nextRefreshPossibleAt = new Carbon($data['next_refresh_possible_at']);
|
||||||
|
$this->providerCode = $data['provider_code'];
|
||||||
|
$this->providerId = $data['provider_id'];
|
||||||
|
$this->providerName = $data['provider_name'];
|
||||||
|
$this->showConsentConfirmation = $data['show_consent_confirmation'];
|
||||||
|
$this->status = $data['status'];
|
||||||
|
$this->storeCredentials = $data['store_credentials'];
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @return string
|
* @return string
|
||||||
*/
|
*/
|
||||||
@@ -76,6 +105,22 @@ class Login extends SpectreObject
|
|||||||
return $this->countryCode;
|
return $this->countryCode;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @return int
|
||||||
|
*/
|
||||||
|
public function getId(): int
|
||||||
|
{
|
||||||
|
return $this->id;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @return Attempt
|
||||||
|
*/
|
||||||
|
public function getLastAttempt(): Attempt
|
||||||
|
{
|
||||||
|
return $this->lastAttempt;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @return Carbon
|
* @return Carbon
|
||||||
*/
|
*/
|
||||||
@@ -108,53 +153,6 @@ class Login extends SpectreObject
|
|||||||
return $this->updatedAt;
|
return $this->updatedAt;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Login constructor.
|
|
||||||
*
|
|
||||||
* @param array $data
|
|
||||||
*/
|
|
||||||
public function __construct(array $data)
|
|
||||||
{
|
|
||||||
$this->consentGivenAt = new Carbon($data['consent_given_at']);
|
|
||||||
$this->consentTypes = $data['consent_types'];
|
|
||||||
$this->countryCode = $data['country_code'];
|
|
||||||
$this->createdAt = new Carbon($data['created_at']);
|
|
||||||
$this->updatedAt = new Carbon($data['updated_at']);
|
|
||||||
$this->customerId = $data['customer_id'];
|
|
||||||
$this->dailyRefresh = $data['daily_refresh'];
|
|
||||||
$this->holderInfo = new Holder($data['holder_info']);
|
|
||||||
$this->id = (int)$data['id'];
|
|
||||||
$this->lastAttempt = new Attempt($data['last_attempt']);
|
|
||||||
$this->lastSuccessAt = new Carbon($data['last_success_at']);
|
|
||||||
$this->nextRefreshPossibleAt = new Carbon($data['next_refresh_possible_at']);
|
|
||||||
$this->providerCode = $data['provider_code'];
|
|
||||||
$this->providerId = $data['provider_id'];
|
|
||||||
$this->providerName = $data['provider_name'];
|
|
||||||
$this->showConsentConfirmation = $data['show_consent_confirmation'];
|
|
||||||
$this->status = $data['status'];
|
|
||||||
$this->storeCredentials = $data['store_credentials'];
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @return int
|
|
||||||
*/
|
|
||||||
public function getId(): int
|
|
||||||
{
|
|
||||||
return $this->id;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @return Attempt
|
|
||||||
*/
|
|
||||||
public function getLastAttempt(): Attempt
|
|
||||||
{
|
|
||||||
return $this->lastAttempt;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @return array
|
* @return array
|
||||||
*/
|
*/
|
||||||
|
@@ -23,6 +23,7 @@ declare(strict_types=1);
|
|||||||
namespace FireflyIII\Services\Spectre\Object;
|
namespace FireflyIII\Services\Spectre\Object;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
* @codeCoverageIgnore
|
||||||
* Class SpectreObject
|
* Class SpectreObject
|
||||||
*/
|
*/
|
||||||
class SpectreObject
|
class SpectreObject
|
||||||
|
@@ -26,6 +26,7 @@ namespace FireflyIII\Services\Spectre\Object;
|
|||||||
use Carbon\Carbon;
|
use Carbon\Carbon;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
* @codeCoverageIgnore
|
||||||
* Class Token
|
* Class Token
|
||||||
*/
|
*/
|
||||||
class Token extends SpectreObject
|
class Token extends SpectreObject
|
||||||
|
@@ -26,6 +26,7 @@ namespace FireflyIII\Services\Spectre\Object;
|
|||||||
use Carbon\Carbon;
|
use Carbon\Carbon;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
* @codeCoverageIgnore
|
||||||
* Class Transaction
|
* Class Transaction
|
||||||
*/
|
*/
|
||||||
class Transaction extends SpectreObject
|
class Transaction extends SpectreObject
|
||||||
|
@@ -26,6 +26,7 @@ namespace FireflyIII\Services\Spectre\Object;
|
|||||||
use Carbon\Carbon;
|
use Carbon\Carbon;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
* @codeCoverageIgnore
|
||||||
* Class TransactionExtra
|
* Class TransactionExtra
|
||||||
*/
|
*/
|
||||||
class TransactionExtra extends SpectreObject
|
class TransactionExtra extends SpectreObject
|
||||||
|
@@ -24,7 +24,6 @@ declare(strict_types=1);
|
|||||||
namespace FireflyIII\Services\Spectre\Request;
|
namespace FireflyIII\Services\Spectre\Request;
|
||||||
|
|
||||||
use FireflyIII\Exceptions\FireflyException;
|
use FireflyIII\Exceptions\FireflyException;
|
||||||
use FireflyIII\Services\Spectre\Exception\SpectreException;
|
|
||||||
use FireflyIII\Services\Spectre\Object\Account;
|
use FireflyIII\Services\Spectre\Object\Account;
|
||||||
use FireflyIII\Services\Spectre\Object\Login;
|
use FireflyIII\Services\Spectre\Object\Login;
|
||||||
use Log;
|
use Log;
|
||||||
|
@@ -24,7 +24,6 @@ declare(strict_types=1);
|
|||||||
namespace FireflyIII\Services\Spectre\Request;
|
namespace FireflyIII\Services\Spectre\Request;
|
||||||
|
|
||||||
use FireflyIII\Exceptions\FireflyException;
|
use FireflyIII\Exceptions\FireflyException;
|
||||||
use FireflyIII\Services\Spectre\Exception\SpectreException;
|
|
||||||
use FireflyIII\Services\Spectre\Object\Account;
|
use FireflyIII\Services\Spectre\Object\Account;
|
||||||
use FireflyIII\Services\Spectre\Object\Transaction;
|
use FireflyIII\Services\Spectre\Object\Transaction;
|
||||||
use Log;
|
use Log;
|
||||||
|
@@ -53,6 +53,7 @@ abstract class SpectreRequest
|
|||||||
abstract public function call(): void;
|
abstract public function call(): void;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
* @codeCoverageIgnore
|
||||||
* @return string
|
* @return string
|
||||||
*/
|
*/
|
||||||
public function getAppId(): string
|
public function getAppId(): string
|
||||||
@@ -61,6 +62,8 @@ abstract class SpectreRequest
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
* @codeCoverageIgnore
|
||||||
|
*
|
||||||
* @param string $appId
|
* @param string $appId
|
||||||
*/
|
*/
|
||||||
public function setAppId(string $appId): void
|
public function setAppId(string $appId): void
|
||||||
@@ -69,6 +72,7 @@ abstract class SpectreRequest
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
* @codeCoverageIgnore
|
||||||
* @return string
|
* @return string
|
||||||
*/
|
*/
|
||||||
public function getSecret(): string
|
public function getSecret(): string
|
||||||
@@ -77,6 +81,8 @@ abstract class SpectreRequest
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
* @codeCoverageIgnore
|
||||||
|
*
|
||||||
* @param string $secret
|
* @param string $secret
|
||||||
*/
|
*/
|
||||||
public function setSecret(string $secret): void
|
public function setSecret(string $secret): void
|
||||||
@@ -85,6 +91,7 @@ abstract class SpectreRequest
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
* @codeCoverageIgnore
|
||||||
* @return string
|
* @return string
|
||||||
*/
|
*/
|
||||||
public function getServer(): string
|
public function getServer(): string
|
||||||
@@ -93,6 +100,8 @@ abstract class SpectreRequest
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
* @codeCoverageIgnore
|
||||||
|
*
|
||||||
* @param string $privateKey
|
* @param string $privateKey
|
||||||
*/
|
*/
|
||||||
public function setPrivateKey(string $privateKey): void
|
public function setPrivateKey(string $privateKey): void
|
||||||
|
Reference in New Issue
Block a user