Skip to content

Commit

Permalink
[TASK] Let rector fix EXT:blog
Browse files Browse the repository at this point in the history
  • Loading branch information
andreaskienast committed Jun 16, 2021
1 parent 5afba5d commit aa2401d
Show file tree
Hide file tree
Showing 16 changed files with 29 additions and 33 deletions.
6 changes: 3 additions & 3 deletions Classes/Controller/BackendController.php
Original file line number Diff line number Diff line change
Expand Up @@ -138,11 +138,11 @@ protected function initializeDataTables(): void
*
* @throws \BadFunctionCallException
*/
public function setupWizardAction(): string
public function setupWizardAction(): ResponseInterface
{
return $this->render('Backend/SetupWizard.html', [
return $this->htmlResponse($this->render('Backend/SetupWizard.html', [
'blogSetups' => $this->setupService->determineBlogSetups(),
]);
]));
}

/**
Expand Down
3 changes: 0 additions & 3 deletions Classes/Controller/PostController.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,15 +22,12 @@
use T3G\AgencyPack\Blog\Service\CacheService;
use T3G\AgencyPack\Blog\Service\MetaTagService;
use T3G\AgencyPack\Blog\Utility\ArchiveUtility;
use TYPO3\CMS\Core\Context\Context;
use TYPO3\CMS\Core\Exception;
use TYPO3\CMS\Core\Http\NormalizedParams;
use TYPO3\CMS\Core\Pagination\SimplePagination;
use TYPO3\CMS\Core\Site\Entity\SiteLanguage;
use TYPO3\CMS\Extbase\Mvc\Controller\ActionController;
use TYPO3\CMS\Extbase\Mvc\View\ViewInterface;
use TYPO3\CMS\Extbase\Pagination\QueryResultPaginator;
use TYPO3\CMS\Extbase\Utility\DebuggerUtility;
use TYPO3\CMS\Extbase\Utility\LocalizationUtility;
use TYPO3\CMS\Frontend\Controller\TypoScriptFrontendController;

Expand Down
3 changes: 2 additions & 1 deletion Classes/Domain/Repository/PostRepository.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
use T3G\AgencyPack\Blog\Domain\Model\Post;
use T3G\AgencyPack\Blog\Domain\Model\Tag;
use TYPO3\CMS\Core\Context\Context;
use TYPO3\CMS\Core\Http\ApplicationType;
use TYPO3\CMS\Core\Site\Entity\Site;
use TYPO3\CMS\Core\Site\Entity\SiteLanguage;
use TYPO3\CMS\Core\Utility\GeneralUtility;
Expand Down Expand Up @@ -427,7 +428,7 @@ protected function getStoragePidsFromTypoScript(): array
*/
protected function getStoragePidConstraint(): ?ComparisonInterface
{
if (TYPO3_MODE === 'FE') {
if (ApplicationType::fromRequest($GLOBALS['TYPO3_REQUEST'])->isFrontend()) {
$pids = $this->getPidsForConstraints();
$query = $this->createQuery();
return $query->in('pid', $pids);
Expand Down
3 changes: 2 additions & 1 deletion Classes/Mail/MailMessage.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@

namespace T3G\AgencyPack\Blog\Mail;

use Symfony\Component\Mime\Email;
use TYPO3\CMS\Core\Mail\MailMessage as CoreMailMessage;
use TYPO3\CMS\Core\Utility\GeneralUtility;

Expand Down Expand Up @@ -95,7 +96,7 @@ public function send(): bool
$this->mailMessage->setFrom($this->getFrom());
$this->mailMessage->setTo($this->getTo());

if ($this->mailMessage instanceof \Symfony\Component\Mime\Email) {
if ($this->mailMessage instanceof Email) {
$this->mailMessage->html($this->getBody());
} else {
$this->mailMessage->setBody($this->getBody(), 'text/html');
Expand Down
2 changes: 1 addition & 1 deletion Classes/Service/CacheService.php
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ public function flushCacheByTag(string $tag): void
public function flushCacheByTags(array $tags): void
{
GeneralUtility::makeInstance(CacheManager::class)
->getCache('cache_pages')
->getCache('pages')
->flushByTags($tags);
}

Expand Down
21 changes: 12 additions & 9 deletions Configuration/DataHandler/BlogSetupRecords.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,17 @@
* LICENSE file that was distributed with this source code.
*/

use T3G\AgencyPack\Blog\Constants;
use TYPO3\CMS\Core\Domain\Repository\PageRepository;

$data = [];

// Pages
$data['pages']['NEW_blogRoot'] = [
'pid' => 0,
'hidden' => 1,
'title' => 'Blog',
'doktype' => \T3G\AgencyPack\Blog\Constants::DOKTYPE_BLOG_PAGE,
'doktype' => Constants::DOKTYPE_BLOG_PAGE,
'is_siteroot' => 1,
'TSconfig' => 'TCEFORM.pages.tags.PAGE_TSCONFIG_ID = NEW_blogFolder
TCEFORM.pages.authors.PAGE_TSCONFIG_ID = NEW_blogFolder
Expand All @@ -24,38 +27,38 @@
'pid' => 'NEW_blogRoot',
'hidden' => 0,
'title' => 'Data',
'doktype' => \TYPO3\CMS\Core\Domain\Repository\PageRepository::DOKTYPE_SYSFOLDER,
'doktype' => PageRepository::DOKTYPE_SYSFOLDER,
'module' => 'blog'
];
$data['pages']['NEW_blogCategoryPage'] = [
'pid' => '-NEW_blogFolder',
'hidden' => 0,
'title' => 'Category',
'doktype' => \T3G\AgencyPack\Blog\Constants::DOKTYPE_BLOG_PAGE,
'doktype' => Constants::DOKTYPE_BLOG_PAGE,
];
$data['pages']['NEW_blogTagPage'] = [
'pid' => '-NEW_blogCategoryPage',
'hidden' => 0,
'title' => 'Tag',
'doktype' => \T3G\AgencyPack\Blog\Constants::DOKTYPE_BLOG_PAGE,
'doktype' => Constants::DOKTYPE_BLOG_PAGE,
];
$data['pages']['NEW_blogAuthorPage'] = [
'pid' => '-NEW_blogTagPage',
'hidden' => 0,
'title' => 'Author',
'doktype' => \T3G\AgencyPack\Blog\Constants::DOKTYPE_BLOG_PAGE,
'doktype' => Constants::DOKTYPE_BLOG_PAGE,
];
$data['pages']['NEW_blogArchivePage'] = [
'pid' => '-NEW_blogAuthorPage',
'hidden' => 0,
'title' => 'Archive',
'doktype' => \T3G\AgencyPack\Blog\Constants::DOKTYPE_BLOG_PAGE,
'doktype' => Constants::DOKTYPE_BLOG_PAGE,
];
$data['pages']['NEW_firstBlogPostPage'] = [
'pid' => 'NEW_blogFolder',
'hidden' => 0,
'title' => 'First blog post',
'doktype' => \T3G\AgencyPack\Blog\Constants::DOKTYPE_BLOG_POST,
'doktype' => Constants::DOKTYPE_BLOG_POST,
'abstract' => 'Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed ut consectetur quam. Ut rutrum augue libero, non rhoncus libero imperdiet vel. Pellentesque libero orci, porttitor sed dui vel, tempus sodales ex. Sed placerat lobortis tellus at tempus.'
];

Expand Down Expand Up @@ -135,12 +138,12 @@
// Categories
$data['sys_category']['NEW_blogCategoryRoot'] = [
'pid' => 'NEW_blogFolder',
'record_type' => \T3G\AgencyPack\Blog\Constants::CATEGORY_TYPE_BLOG,
'record_type' => Constants::CATEGORY_TYPE_BLOG,
'title' => 'Blog',
];
$data['sys_category']['NEW_blogCategoryTYPO3'] = [
'pid' => 'NEW_blogFolder',
'record_type' => \T3G\AgencyPack\Blog\Constants::CATEGORY_TYPE_BLOG,
'record_type' => Constants::CATEGORY_TYPE_BLOG,
'parent' => 'NEW_blogCategoryRoot',
'title' => 'TYPO3',
];
Expand Down
2 changes: 1 addition & 1 deletion Configuration/TCA/Overrides/pages.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
* LICENSE file that was distributed with this source code.
*/

if (!defined('TYPO3_MODE')) {
if (!defined('TYPO3')) {
die('Access denied.');
}

Expand Down
2 changes: 1 addition & 1 deletion Configuration/TCA/Overrides/sys_category.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
* LICENSE file that was distributed with this source code.
*/

if (!defined('TYPO3_MODE')) {
if (!defined('TYPO3')) {
die('Access denied.');
}

Expand Down
2 changes: 1 addition & 1 deletion Configuration/TCA/Overrides/sys_template.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
* LICENSE file that was distributed with this source code.
*/

if (!defined('TYPO3_MODE')) {
if (!defined('TYPO3')) {
die('Access denied.');
}

Expand Down
2 changes: 1 addition & 1 deletion Configuration/TCA/Overrides/tt_content.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
* LICENSE file that was distributed with this source code.
*/

if (!defined('TYPO3_MODE')) {
if (!defined('TYPO3')) {
die('Access denied.');
}

Expand Down
3 changes: 1 addition & 2 deletions Configuration/TCA/tx_blog_domain_model_author.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
* LICENSE file that was distributed with this source code.
*/

if (!defined('TYPO3_MODE')) {
if (!defined('TYPO3')) {
die('Access denied.');
}

Expand All @@ -21,7 +21,6 @@
'tstamp' => 'tstamp',
'crdate' => 'crdate',
'cruser_id' => 'cruser_id',
'dividers2tabs' => true,
'default_sortby' => 'ORDER BY title',
'delete' => 'deleted',
'enablecolumns' => [
Expand Down
3 changes: 1 addition & 2 deletions Configuration/TCA/tx_blog_domain_model_comment.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
* LICENSE file that was distributed with this source code.
*/

if (!defined('TYPO3_MODE')) {
if (!defined('TYPO3')) {
die('Access denied.');
}

Expand All @@ -22,7 +22,6 @@
'tstamp' => 'tstamp',
'crdate' => 'crdate',
'cruser_id' => 'cruser_id',
'dividers2tabs' => true,
'default_sortby' => 'ORDER BY crdate DESC',
'delete' => 'deleted',
'enablecolumns' => [
Expand Down
3 changes: 1 addition & 2 deletions Configuration/TCA/tx_blog_domain_model_tag.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
* LICENSE file that was distributed with this source code.
*/

if (!defined('TYPO3_MODE')) {
if (!defined('TYPO3')) {
die('Access denied.');
}

Expand All @@ -26,7 +26,6 @@
'tstamp' => 'tstamp',
'crdate' => 'crdate',
'cruser_id' => 'cruser_id',
'dividers2tabs' => true,
'default_sortby' => 'ORDER BY title',
'delete' => 'deleted',
'enablecolumns' => [
Expand Down
3 changes: 0 additions & 3 deletions ext_emconf.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,6 @@
'description' => 'This blog extension uses TYPO3s core concepts and elements to provide a full-blown blog that users of TYPO3 can instantly understand and use.',
'category' => 'fe',
'state' => 'stable',
'uploadfolder' => 0,
'createDirs' => '',
'clearCacheOnLoad' => 0,
'author' => 'TYPO3 GmbH',
'author_email' => 'info@typo3.com',
'version' => '11.0.0-dev',
Expand Down
2 changes: 1 addition & 1 deletion ext_localconf.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
* LICENSE file that was distributed with this source code.
*/

if (!defined('TYPO3_MODE')) {
if (!defined('TYPO3')) {
die('Access denied.');
}

Expand Down
2 changes: 1 addition & 1 deletion ext_tables.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
* LICENSE file that was distributed with this source code.
*/

if (!defined('TYPO3_MODE')) {
if (!defined('TYPO3')) {
die('Access denied.');
}

Expand Down

0 comments on commit aa2401d

Please sign in to comment.