-
Notifications
You must be signed in to change notification settings - Fork 20
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #125 from derhansen/feature/typo3-11
[!!!][TASK] TYPO3 11.5 compatible version
- Loading branch information
Showing
36 changed files
with
659 additions
and
518 deletions.
There are no files selected for viewing
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
This file was deleted.
Oops, something went wrong.
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,69 @@ | ||
<?php | ||
|
||
$header = <<<'EOF' | ||
This file is part of the TYPO3 extension web2pdf. | ||
For the full copyright and license information, please view the LICENSE | ||
file that was distributed with this source code. | ||
EOF; | ||
|
||
return (new \PhpCsFixer\Config()) | ||
->setRiskyAllowed(true) | ||
->setRules([ | ||
'@DoctrineAnnotation' => true, | ||
'@PSR2' => true, | ||
'array_syntax' => ['syntax' => 'short'], | ||
'blank_line_after_opening_tag' => true, | ||
'braces' => ['allow_single_line_closure' => true], | ||
'cast_spaces' => ['space' => 'none'], | ||
'compact_nullable_typehint' => true, | ||
'concat_space' => ['spacing' => 'one'], | ||
'declare_equal_normalize' => ['space' => 'none'], | ||
'dir_constant' => true, | ||
'function_typehint_space' => true, | ||
'lowercase_cast' => true, | ||
'method_argument_space' => ['on_multiline' => 'ensure_fully_multiline'], | ||
'modernize_types_casting' => true, | ||
'native_function_casing' => true, | ||
'new_with_braces' => true, | ||
'no_alias_functions' => true, | ||
'no_blank_lines_after_phpdoc' => true, | ||
'no_empty_phpdoc' => true, | ||
'no_empty_statement' => true, | ||
'no_extra_blank_lines' => true, | ||
'no_leading_import_slash' => true, | ||
'no_leading_namespace_whitespace' => true, | ||
'no_null_property_initialization' => true, | ||
'no_short_bool_cast' => true, | ||
'no_singleline_whitespace_before_semicolons' => true, | ||
'no_superfluous_elseif' => true, | ||
'no_trailing_comma_in_singleline_array' => true, | ||
'no_unneeded_control_parentheses' => true, | ||
'no_unused_imports' => true, | ||
'no_useless_else' => true, | ||
'no_whitespace_in_blank_line' => true, | ||
'ordered_imports' => true, | ||
'php_unit_construct' => ['assertions' => ['assertEquals', 'assertSame', 'assertNotEquals', 'assertNotSame']], | ||
'php_unit_mock_short_will_return' => true, | ||
'php_unit_test_case_static_method_calls' => ['call_type' => 'self'], | ||
'phpdoc_no_access' => true, | ||
'phpdoc_no_empty_return' => true, | ||
'phpdoc_no_package' => true, | ||
'phpdoc_scalar' => true, | ||
'phpdoc_trim' => true, | ||
'phpdoc_types' => true, | ||
'phpdoc_types_order' => ['null_adjustment' => 'always_last', 'sort_algorithm' => 'none'], | ||
'return_type_declaration' => ['space_before' => 'none'], | ||
'single_quote' => true, | ||
'single_line_comment_style' => ['comment_types' => ['hash']], | ||
'single_trait_insert_per_statement' => true, | ||
'trailing_comma_in_multiline' => ['elements' => ['arrays']], | ||
'whitespace_after_comma_in_array' => true, | ||
]) | ||
->setFinder( | ||
PhpCsFixer\Finder::create() | ||
->in(__DIR__) | ||
->exclude(['.Build', 'Documentation', 'Resources']) | ||
->notName('ext_emconf.php') | ||
); |
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,9 @@ | ||
<?php | ||
|
||
/* * ************************************************************* | ||
/**************************************************************** | ||
* Copyright notice | ||
* | ||
* (C) 2015 Mittwald CM Service GmbH & Co. KG <[email protected]> | ||
* (C) Mittwald CM Service GmbH & Co. KG <[email protected]> | ||
* | ||
* All rights reserved | ||
* | ||
|
@@ -22,26 +22,17 @@ | |
* GNU General Public License for more details. | ||
* | ||
* This copyright notice MUST APPEAR in all copies of the script! | ||
* ************************************************************* */ | ||
***************************************************************/ | ||
|
||
namespace Mittwald\Web2pdf\Controller; | ||
|
||
use Mittwald\Web2pdf\Options\ModuleOptions; | ||
use TYPO3\CMS\Extbase\Mvc\Controller\ActionController; | ||
|
||
/** | ||
* Controller provides partial view for pdf link | ||
* | ||
* @author Kevin Purrmann <[email protected]>, Purrmann Websolutions | ||
* @package Mittwald | ||
* @subpackage Web2Pdf\Controller | ||
*/ | ||
class PdfController extends ActionController | ||
{ | ||
|
||
/** | ||
* Method provides link generation | ||
* | ||
*/ | ||
public function generatePdfLinkAction() | ||
{ | ||
|
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,31 @@ | ||
<?php | ||
|
||
/**************************************************************** | ||
* Copyright notice | ||
* | ||
* (C) Mittwald CM Service GmbH & Co. KG <[email protected]> | ||
* | ||
* All rights reserved | ||
* | ||
* This script is part of the TYPO3 project. The TYPO3 project is | ||
* free software; you can redistribute it and/or modify | ||
* it under the terms of the GNU General Public License as published by | ||
* the Free Software Foundation; either version 2 of the License, or | ||
* (at your option) any later version. | ||
* | ||
* The GNU General Public License can be found at | ||
* http://www.gnu.org/copyleft/gpl.html. | ||
* | ||
* This script is distributed in the hope that it will be useful, | ||
* but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
* GNU General Public License for more details. | ||
* | ||
* This copyright notice MUST APPEAR in all copies of the script! | ||
***************************************************************/ | ||
|
||
namespace Mittwald\Web2pdf\Middleware; | ||
|
||
|
||
use Mittwald\Web2pdf\Options\ModuleOptions; | ||
use Mittwald\Web2pdf\View\PdfView; | ||
use Psr\Http\Message\ResponseInterface; | ||
|
@@ -15,24 +37,10 @@ | |
|
||
class PdfHandler implements MiddlewareInterface | ||
{ | ||
/** | ||
* @var PdfView | ||
*/ | ||
private $pdfView; | ||
/** | ||
* @var TypoScriptFrontendController | ||
*/ | ||
private $frontendController; | ||
/** | ||
* @var ModuleOptions | ||
*/ | ||
private $moduleOptions; | ||
private PdfView $pdfView; | ||
private TypoScriptFrontendController $frontendController; | ||
private ModuleOptions $moduleOptions; | ||
|
||
/** | ||
* PdfHandler constructor. | ||
* @param PdfView $pdfView | ||
* @param ModuleOptions $moduleOptions | ||
*/ | ||
public function __construct(PdfView $pdfView, ModuleOptions $moduleOptions) | ||
{ | ||
$this->pdfView = $pdfView; | ||
|
@@ -61,7 +69,7 @@ public function process(ServerRequestInterface $request, RequestHandlerInterface | |
|
||
$response = new Response(); | ||
$file = $this->pdfView->renderHtmlOutput($output->getBody(), $this->frontendController->generatePageTitle()); | ||
$destination = ($pdfDestination = $this->moduleOptions->getPdfDestination()) ? $pdfDestination : 'attachment'; | ||
$destination = $this->moduleOptions->getPdfDestination() ?? 'attachment'; | ||
|
||
$response = $response->withHeader('Content-Transfer-Encoding', 'binary'); | ||
$response->getBody()->write(file_get_contents($file)); | ||
|
@@ -70,4 +78,4 @@ public function process(ServerRequestInterface $request, RequestHandlerInterface | |
|
||
return $response->withStatus(200); | ||
} | ||
} | ||
} |
Oops, something went wrong.