Created
September 5, 2017 20:19
-
-
Save x0st/f827c3bb730d93084e16cc000cbc42e3 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Class IndexAction | |
* @package App\Http\Controllers\EditingController | |
*/ | |
class IndexAction | |
{ | |
/** | |
* @var EgnyteState | |
*/ | |
private $stateModel; | |
/** | |
* IndexAction constructor. | |
* @param EgnyteState $stateModel | |
*/ | |
public function __construct(EgnyteState $stateModel) | |
{ | |
$this->stateModel = $stateModel; | |
} | |
/** | |
* @return \Illuminate\Contracts\View\Factory|\Illuminate\View\View | |
*/ | |
public function act() | |
{ | |
$this->checkIfUserIsEditingDocument(); | |
$this->checkDocumentSize(); | |
$documentLocalPath = $this->downloadDocumentFromEgnyte(); | |
$this->checkDocumentPageCount($documentLocalPath); | |
$pdffillerDocument = $this->uploadDocumentToPDFfiller($documentLocalPath); | |
$url = $this->urlForOpeningEditor($pdffillerDocument); | |
$this->updateStateModel($pdffillerDocument); | |
$this->deleteLocalFile($documentLocalPath); | |
return view('editing.index', [ | |
'url' => $url, | |
'state' => $this->stateModel->getState() | |
]); | |
} | |
/** | |
* @return void | |
* | |
* @throws ConflictHttpException | |
*/ | |
private function checkIfUserIsEditingDocument() {} | |
/** | |
* @param string $documentFilePath | |
*/ | |
private function deleteLocalFile(string $documentFilePath) {} | |
/** | |
* @param Document $documentRepresentation | |
*/ | |
private function updateStateModel(Document $documentRepresentation) {} | |
/** | |
* @param Document $documentRepresentation | |
* | |
* @return string | |
*/ | |
private function urlForOpeningEditor(Document $documentRepresentation) {} | |
/** | |
* @param $localPath | |
* @return \App\Services\PDFfillerCore\Entities\Document | |
*/ | |
private function uploadDocumentToPDFfiller(string $localPath) {} | |
/** | |
* @return string | |
*/ | |
private function downloadDocumentFromEgnyte() {} | |
/** | |
* @return void | |
* | |
* @throws BadRequestHttpException | |
*/ | |
private function checkDocumentSize() {} | |
/** | |
* @param string $localPath | |
* | |
* @return void | |
* | |
* @throws BadRequestHttpException | |
*/ | |
private function checkDocumentPageCount(string $localPath) {} | |
/** | |
* @return int | |
*/ | |
private function egnyteDocumentSize() {} | |
} |
Author
x0st
commented
Sep 5, 2017
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment