Code cleanup

This commit is contained in:
James Cole
2018-04-02 15:10:40 +02:00
parent fa7ab45a40
commit a3c34e6b3c
151 changed files with 802 additions and 990 deletions

View File

@@ -60,7 +60,7 @@ class BunqConfigurator implements ConfiguratorInterface
*/
public function configureJob(array $data): bool
{
if (is_null($this->job)) {
if (null === $this->job) {
throw new FireflyException('Cannot call configureJob() without a job.');
}
$stage = $this->getConfig()['stage'] ?? 'initial';
@@ -94,7 +94,7 @@ class BunqConfigurator implements ConfiguratorInterface
*/
public function getNextData(): array
{
if (is_null($this->job)) {
if (null === $this->job) {
throw new FireflyException('Cannot call configureJob() without a job.');
}
$config = $this->getConfig();
@@ -107,9 +107,8 @@ class BunqConfigurator implements ConfiguratorInterface
/** @var HaveAccounts $class */
$class = app(HaveAccounts::class);
$class->setJob($this->job);
$data = $class->getData();
return $data;
return $class->getData();
default:
return [];
}
@@ -122,7 +121,7 @@ class BunqConfigurator implements ConfiguratorInterface
*/
public function getNextView(): string
{
if (is_null($this->job)) {
if (null === $this->job) {
throw new FireflyException('Cannot call configureJob() without a job.');
}
$stage = $this->getConfig()['stage'] ?? 'initial';
@@ -153,7 +152,7 @@ class BunqConfigurator implements ConfiguratorInterface
*/
public function isJobConfigured(): bool
{
if (is_null($this->job)) {
if (null === $this->job) {
throw new FireflyException('Cannot call configureJob() without a job.');
}
$stage = $this->getConfig()['stage'] ?? 'initial';

View File

@@ -84,7 +84,7 @@ class FileConfigurator implements ConfiguratorInterface
*/
public function configureJob(array $data): bool
{
if (is_null($this->job)) {
if (null === $this->job) {
throw new FireflyException('Cannot call configureJob() without a job.');
}
/** @var ConfigurationInterface $object */
@@ -105,7 +105,7 @@ class FileConfigurator implements ConfiguratorInterface
*/
public function getNextData(): array
{
if (is_null($this->job)) {
if (null === $this->job) {
throw new FireflyException('Cannot call getNextData() without a job.');
}
/** @var ConfigurationInterface $object */
@@ -122,7 +122,7 @@ class FileConfigurator implements ConfiguratorInterface
*/
public function getNextView(): string
{
if (is_null($this->job)) {
if (null === $this->job) {
throw new FireflyException('Cannot call getNextView() without a job.');
}
$config = $this->getConfig();
@@ -149,7 +149,7 @@ class FileConfigurator implements ConfiguratorInterface
*/
public function getWarningMessage(): string
{
if (is_null($this->job)) {
if (null === $this->job) {
throw new FireflyException('Cannot call getWarningMessage() without a job.');
}
@@ -163,7 +163,7 @@ class FileConfigurator implements ConfiguratorInterface
*/
public function isJobConfigured(): bool
{
if (is_null($this->job)) {
if (null === $this->job) {
throw new FireflyException('Cannot call isJobConfigured() without a job.');
}
$config = $this->getConfig();

View File

@@ -60,7 +60,7 @@ class SpectreConfigurator implements ConfiguratorInterface
*/
public function configureJob(array $data): bool
{
if (is_null($this->job)) {
if (null === $this->job) {
throw new FireflyException('Cannot call configureJob() without a job.');
}
$stage = $this->getConfig()['stage'] ?? 'initial';
@@ -93,7 +93,7 @@ class SpectreConfigurator implements ConfiguratorInterface
*/
public function getNextData(): array
{
if (is_null($this->job)) {
if (null === $this->job) {
throw new FireflyException('Cannot call configureJob() without a job.');
}
$config = $this->getConfig();
@@ -116,9 +116,8 @@ class SpectreConfigurator implements ConfiguratorInterface
/** @var HaveAccounts $class */
$class = app(HaveAccounts::class);
$class->setJob($this->job);
$data = $class->getData();
return $data;
return $class->getData();
default:
return [];
}
@@ -131,7 +130,7 @@ class SpectreConfigurator implements ConfiguratorInterface
*/
public function getNextView(): string
{
if (is_null($this->job)) {
if (null === $this->job) {
throw new FireflyException('Cannot call configureJob() without a job.');
}
$stage = $this->getConfig()['stage'] ?? 'initial';
@@ -166,7 +165,7 @@ class SpectreConfigurator implements ConfiguratorInterface
*/
public function isJobConfigured(): bool
{
if (is_null($this->job)) {
if (null === $this->job) {
throw new FireflyException('Cannot call configureJob() without a job.');
}
$stage = $this->getConfig()['stage'] ?? 'initial';