Code cleanup.

This commit is contained in:
James Cole
2023-12-20 19:35:52 +01:00
parent c4f6366642
commit 64ec0cf62e
997 changed files with 12908 additions and 28136 deletions

View File

@@ -44,8 +44,6 @@ class IndexController extends Controller
/**
* IndexController constructor.
*
*/
public function __construct()
{
@@ -65,7 +63,6 @@ class IndexController extends Controller
}
/**
* @return LaravelResponse
* @throws FireflyException
* @throws ContainerExceptionInterface
* @throws NotFoundExceptionInterface
@@ -90,19 +87,21 @@ class IndexController extends Controller
$name = sprintf('%s_transaction_export.csv', date('Y_m_d'));
$quoted = sprintf('"%s"', addcslashes($name, '"\\'));
// headers for CSV file.
/** @var LaravelResponse $response */
$response = response($result['transactions']);
$response
->header('Content-Description', 'File Transfer')
->header('Content-Type', 'text/x-csv')
->header('Content-Disposition', 'attachment; filename=' . $quoted)
//->header('Content-Transfer-Encoding', 'binary')
->header('Content-Disposition', 'attachment; filename='.$quoted)
// ->header('Content-Transfer-Encoding', 'binary')
->header('Connection', 'Keep-Alive')
->header('Expires', '0')
->header('Cache-Control', 'must-revalidate, post-check=0, pre-check=0')
->header('Pragma', 'public')
->header('Content-Length', (string)strlen($result['transactions']));
->header('Content-Length', (string)strlen($result['transactions']))
;
// return CSV file made from 'transactions' array.
return $response;