Separation of concerns
This commit is contained in:
@@ -3,7 +3,7 @@
|
||||
|
||||
use IO\ExceptionHandler;
|
||||
use IO\Input\FinderArguments;
|
||||
use IO\Output\DocumentListingOutput;
|
||||
use IO\Output\DocumentListing;
|
||||
use PDF\Document;
|
||||
|
||||
require_once __DIR__ . '/../vendor/autoload.php';
|
||||
@@ -23,4 +23,4 @@ foreach ($filters as $filter) {
|
||||
$documents = $documents->filter(fn(Document $document) => $filter->allows($document));
|
||||
}
|
||||
|
||||
DocumentListingOutput::forDocuments($documents)->render();
|
||||
DocumentListing::of($documents)->render();
|
||||
|
||||
@@ -3,17 +3,12 @@
|
||||
|
||||
use IO\ExceptionHandler;
|
||||
use IO\Input\ShowInfoArguments;
|
||||
use IO\Output\DocumentOutput;
|
||||
use IO\Output\DocumentDetails;
|
||||
|
||||
require_once __DIR__ . '/../vendor/autoload.php';
|
||||
|
||||
ExceptionHandler::registerCallback();
|
||||
|
||||
$arguments = ShowInfoArguments::createFromGlobals();
|
||||
$file = $arguments->getFile();
|
||||
|
||||
$documentFactory = DocumentFactory::create();
|
||||
$document = $documentFactory->createDocument($file);
|
||||
|
||||
$output = DocumentOutput::forDocument($document);
|
||||
$output->render();
|
||||
$file = ShowInfoArguments::createFromGlobals()->getFile();
|
||||
$document = DocumentFactory::create()->fromFile($file);
|
||||
DocumentDetails::of($document)->render();
|
||||
|
||||
Reference in New Issue
Block a user