Various code cleanup.

This commit is contained in:
James Cole
2018-07-27 05:03:37 +02:00
parent 0312ba8ad7
commit e3e0e12fef
43 changed files with 167 additions and 145 deletions

View File

@@ -123,7 +123,7 @@ class NewFileJobHandler implements FileConfigurationInterface
/** @var Attachment $attachment */
foreach ($attachments as $attachment) {
// if file is configuration file, store it into the job.
if ($attachment->filename === 'configuration_file') {
if ('configuration_file' === $attachment->filename) {
$this->storeConfig($attachment);
}
}
@@ -162,7 +162,7 @@ class NewFileJobHandler implements FileConfigurationInterface
}
// if file is configuration file, store it into the job.
if ($attachment->filename === 'configuration_file') {
if ('configuration_file' === $attachment->filename) {
$this->storeConfig($attachment);
}
}
@@ -179,10 +179,10 @@ class NewFileJobHandler implements FileConfigurationInterface
{
$content = $this->attachments->getAttachmentContent($attachment);
$result = mb_detect_encoding($content, 'UTF-8', true);
if ($result === false) {
if (false === $result) {
return false;
}
if ($result !== 'ASCII' && $result !== 'UTF-8') {
if ('ASCII' !== $result && 'UTF-8' !== $result) {
return false; // @codeCoverageIgnore
}
@@ -194,7 +194,6 @@ class NewFileJobHandler implements FileConfigurationInterface
*
* @param Attachment $attachment
*
* @throws FireflyException
*/
private function storeConfig(Attachment $attachment): void
{