Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Build/rector/composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
}
],
"require": {
"ssch/typo3-rector": "^2.3"
"ssch/typo3-rector": "^3.6"
},
"config": {
"bin-dir": ".Build/bin",
Expand Down
9 changes: 2 additions & 7 deletions Build/rector/rector.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@
use Rector\DeadCode\Rector\StaticCall\RemoveParentCallWithoutParentRector;
use Rector\Php74\Rector\LNumber\AddLiteralSeparatorToNumberRector;
use Rector\TypeDeclaration\Rector\ClassMethod\AddVoidReturnTypeWhereNoReturnRector;
use Ssch\TYPO3Rector\CodeQuality\General\ConvertImplicitVariablesToExplicitGlobalsRector;
use Ssch\TYPO3Rector\CodeQuality\General\ExtEmConfRector;
use Ssch\TYPO3Rector\Configuration\Typo3Option;
use Ssch\TYPO3Rector\Set\Typo3LevelSetList;
Expand All @@ -35,7 +34,7 @@
->withSets([
Typo3SetList::CODE_QUALITY,
Typo3SetList::GENERAL,
Typo3LevelSetList::UP_TO_TYPO3_13,
Typo3LevelSetList::UP_TO_TYPO3_14,
])
->withImportNames(importShortClasses: false, removeUnusedImports: true)
// To have a better analysis from PHPStan, we teach it here some more things
Expand All @@ -44,17 +43,13 @@
])
->withRules([
AddVoidReturnTypeWhereNoReturnRector::class,
ConvertImplicitVariablesToExplicitGlobalsRector::class,
])
->withConfiguredRule(ExtEmConfRector::class, [
ExtEmConfRector::TYPO3_VERSION_CONSTRAINT => '13.3.0-13.99.99',
ExtEmConfRector::TYPO3_VERSION_CONSTRAINT => '14.0.0-14.99.99',
ExtEmConfRector::ADDITIONAL_VALUES_TO_BE_REMOVED => [],
])
// If you use importNames(), you should consider excluding some TYPO3 files.
->withSkip([
// AddLiteralSeparatorToNumberRector would make the exception codes more readable.
// But as they are just timestamps this is not needed/wanted.
AddLiteralSeparatorToNumberRector::class,
RemoveParentCallWithoutParentRector::class,
])
;
4 changes: 2 additions & 2 deletions Classes/Controller/BlogController.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,8 @@
use T3docs\BlogExample\Service\BlogFactory;
use TYPO3\CMS\Core\Pagination\SimplePagination;
use TYPO3\CMS\Core\Type\ContextualFeedbackSeverity;
use TYPO3\CMS\Extbase\Annotation\IgnoreValidation;
use TYPO3\CMS\Extbase\Annotation\Validate;
use TYPO3\CMS\Extbase\Attribute\IgnoreValidation;
use TYPO3\CMS\Extbase\Attribute\Validate;
use TYPO3\CMS\Extbase\Pagination\QueryResultPaginator;

/**
Expand Down
2 changes: 1 addition & 1 deletion Classes/Controller/PostController.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
use T3docs\BlogExample\PageTitle\BlogPageTitleProvider;
use TYPO3\CMS\Core\Pagination\SimplePagination;
use TYPO3\CMS\Core\Type\ContextualFeedbackSeverity;
use TYPO3\CMS\Extbase\Annotation\IgnoreValidation;
use TYPO3\CMS\Extbase\Attribute\IgnoreValidation;
use TYPO3\CMS\Extbase\Http\ForwardResponse;
use TYPO3\CMS\Extbase\Pagination\QueryResultPaginator;
use TYPO3\CMS\Extbase\Persistence\Exception\IllegalObjectTypeException;
Expand Down
6 changes: 3 additions & 3 deletions Classes/Domain/Model/Blog.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,9 @@
* The TYPO3 project - inspiring people to share!
*/
use T3docs\BlogExample\Domain\Validator\TitleValidator;
use TYPO3\CMS\Extbase\Annotation\ORM\Cascade;
use TYPO3\CMS\Extbase\Annotation\ORM\Lazy;
use TYPO3\CMS\Extbase\Annotation\Validate;
use TYPO3\CMS\Extbase\Attribute\ORM\Cascade;
use TYPO3\CMS\Extbase\Attribute\ORM\Lazy;
use TYPO3\CMS\Extbase\Attribute\Validate;
use TYPO3\CMS\Extbase\Domain\Model\Category;
use TYPO3\CMS\Extbase\Domain\Model\FileReference;
use TYPO3\CMS\Extbase\DomainObject\AbstractEntity;
Expand Down
2 changes: 1 addition & 1 deletion Classes/Domain/Model/Comment.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
*
* The TYPO3 project - inspiring people to share!
*/
use TYPO3\CMS\Extbase\Annotation\Validate;
use TYPO3\CMS\Extbase\Attribute\Validate;
use TYPO3\CMS\Extbase\DomainObject\AbstractEntity;

/**
Expand Down
4 changes: 2 additions & 2 deletions Classes/Domain/Model/Person.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@
* The TYPO3 project - inspiring people to share!
*/

use TYPO3\CMS\Extbase\Annotation\ORM\Transient;
use TYPO3\CMS\Extbase\Annotation\Validate;
use TYPO3\CMS\Extbase\Attribute\ORM\Transient;
use TYPO3\CMS\Extbase\Attribute\Validate;
use TYPO3\CMS\Extbase\DomainObject\AbstractEntity;
use TYPO3\CMS\Extbase\Persistence\ObjectStorage;

Expand Down
8 changes: 4 additions & 4 deletions Classes/Domain/Model/Post.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,9 @@
*
* The TYPO3 project - inspiring people to share!
*/
use TYPO3\CMS\Extbase\Annotation\ORM\Cascade;
use TYPO3\CMS\Extbase\Annotation\ORM\Lazy;
use TYPO3\CMS\Extbase\Annotation\Validate;
use TYPO3\CMS\Extbase\Attribute\ORM\Cascade;
use TYPO3\CMS\Extbase\Attribute\ORM\Lazy;
use TYPO3\CMS\Extbase\Attribute\Validate;
use TYPO3\CMS\Extbase\Domain\Model\Category;
use TYPO3\CMS\Extbase\DomainObject\AbstractEntity;
use TYPO3\CMS\Extbase\Persistence\ObjectStorage;
Expand Down Expand Up @@ -234,7 +234,7 @@ public function addComment(Comment $commentToAdd): void
}

/**
* Removes Comment from this post and deletes it due to annotation `@Cascade("remove")`
* Removes Comment from this post and deletes it due to attribute `Cascade("remove")`
*/
public function removeComment(Comment $commentToDelete): void
{
Expand Down
2 changes: 1 addition & 1 deletion Classes/Domain/Validator/PostValidator.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
*/
class PostValidator extends AbstractValidator
{
public function __construct(private PostValidationService $postValidationService) {}
public function __construct(private readonly PostValidationService $postValidationService) {}

/**
* Check if $value is valid. If it's not valid, it needs to add an error
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,14 @@
use TYPO3\CMS\Install\Updates\UpgradeWizardInterface;

#[UpgradeWizard('blogExample_migratePluginsToContentElementsUpgradeWizard')]
final class MigratePluginsToContentElementsUpgradeWizard implements UpgradeWizardInterface
final readonly class MigratePluginsToContentElementsUpgradeWizard implements UpgradeWizardInterface
{
private const PLUGINS = [
'blogexample_bloglist',
'blogexample_blogadmin',
'blogexample_postlistrss',
];
public function __construct(private ConnectionPool $connectionPool) {}

public function getTitle(): string
{
Expand Down Expand Up @@ -82,7 +83,7 @@ public function updateNecessary(): bool

private function getQueryBuilder(): QueryBuilder
{
$queryBuilder = GeneralUtility::makeInstance(ConnectionPool::class)
$queryBuilder = $this->connectionPool
->getQueryBuilderForTable('tt_content');

$queryBuilder
Expand Down
4 changes: 2 additions & 2 deletions Classes/Upgrades/PluginUpgradeWizard.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,12 @@
use TYPO3\CMS\Install\Updates\UpgradeWizardInterface;

#[UpgradeWizard('blogExample_pluginUpgradeWizard')]
final class PluginUpgradeWizard implements UpgradeWizardInterface
final readonly class PluginUpgradeWizard implements UpgradeWizardInterface
{
private const OLD_LIST_TYPE = 'blogexample_pi1';
private const NEW_LIST_TYPE = 'blogexample_bloglist';
public function __construct(
private readonly ConnectionPool $connectionPool,
private ConnectionPool $connectionPool,
) {}

public function getTitle(): string
Expand Down
2 changes: 1 addition & 1 deletion Classes/ViewHelpers/GravatarViewHelper.php
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ public function initializeArguments(): void
public function render(): string
{
$gravatarUri = $this->uriFactory->createUri(
'https://gravatar.com/avatar/' . md5($this->arguments['emailAddress']),
'https://gravatar.com/avatar/' . md5((string)$this->arguments['emailAddress']),
);

$queryArguments = [];
Expand Down
19 changes: 4 additions & 15 deletions Configuration/TCA/Overrides/tt_content.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,27 +17,16 @@
'BlogList',
'List of Blogs (BlogExample)',
'blog_example_icon',
'plugins',
'blog_example',
'Display a list of blogs',
'FILE:EXT:blog_example/Configuration/FlexForms/PluginSettings.xml'
);
ExtensionUtility::registerPlugin(
'blog_example',
'BlogAdmin',
'Admin Plugin (BlogExample)',
'blog_example_icon',
'plugins',
'blog_example',
'Administrate the blog',
);

ExtensionManagementUtility::addToAllTCAtypes(
'tt_content',
'--div--;Configuration,pi_flexform',
'blogexample_bloglist',
'after:subheader',
);

ExtensionManagementUtility::addPiFlexFormValue(
'*',
'FILE:EXT:blog_example/Configuration/FlexForms/PluginSettings.xml',
'blogexample_bloglist',
'FILE:EXT:blog_example/Configuration/FlexForms/PluginSettings.xml'
);
5 changes: 4 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,10 @@ help: ## Displays this list of targets with descriptions
install: ## Run rector
Build/Scripts/runTests.sh -s composerUpdate

.PHONY: install-rector
install-rector: ## Run rector
Build/Scripts/runTests.sh -s composerUpdateRector

.PHONY: rector
rector: ## Run rector
Build/Scripts/runTests.sh -s rector
Expand Down Expand Up @@ -36,4 +40,3 @@ test-unit: ## Run unit tests
.PHONY: test-functional
test-functional: ## Run functional tests
Build/Scripts/runTests.sh -s functional -d mysql

12 changes: 6 additions & 6 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,17 +15,17 @@
"source": "https://github.com/TYPO3-Documentation/blog_example"
},
"require": {
"typo3/cms-backend": "^13.3 || dev-main",
"typo3/cms-core": "^13.3 || dev-main",
"typo3/cms-extbase": "^13.3 || dev-main",
"typo3/cms-fluid": "^13.3 || dev-main"
"typo3/cms-backend": "^14.0 || dev-main",
"typo3/cms-core": "^14.0 || dev-main",
"typo3/cms-extbase": "^14.0 || dev-main",
"typo3/cms-fluid": "^14.0 || dev-main"
},
"require-dev": {
"ergebnis/composer-normalize": "~2.42.0",
"friendsofphp/php-cs-fixer": "^3.52",
"phpstan/phpstan": "^1.10",
"phpunit/phpunit": "^11.0.3",
"typo3/cms-install": "^13.3 || dev-main",
"typo3/cms-install": "^14.0 || dev-main",
"typo3/testing-framework": "dev-main"
},
"minimum-stability": "dev",
Expand All @@ -52,7 +52,7 @@
},
"extra": {
"branch-alias": {
"dev-main": "13.0.x-dev"
"dev-main": "14.0.x-dev"
},
"typo3/cms": {
"extension-key": "blog_example",
Expand Down
4 changes: 2 additions & 2 deletions ext_emconf.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,15 @@
$EM_CONF[$_EXTKEY] = [
'title' => 'A Blog Example for the Extbase Framework',
'description' => 'This extension contains code examples used in TYPO3 explained to describe the use of Extbase',
'version' => '13.0.0',
'version' => '14.0.0',
'category' => 'example',
'author' => 'TYPO3 Documentation Team and contributors',
'author_company' => '',
'author_email' => '',
'state' => 'stable',
'constraints' => [
'depends' => [
'typo3' => '13.3.0-13.99.99',
'typo3' => '14.0.0-14.99.99',
],
'conflicts' => [],
'suggests' => [],
Expand Down
3 changes: 0 additions & 3 deletions ext_localconf.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@
[
CommentController::class => 'create',
],
ExtensionUtility::PLUGIN_TYPE_CONTENT_ELEMENT,
);

// RSS Feed
Expand All @@ -34,7 +33,6 @@
PostController::class => 'displayRssList',
],
[],
ExtensionUtility::PLUGIN_TYPE_CONTENT_ELEMENT,
);

// admin plugins
Expand All @@ -53,6 +51,5 @@
PostController::class => 'create,delete,update',
CommentController::class => 'delete',
],
ExtensionUtility::PLUGIN_TYPE_CONTENT_ELEMENT,
);
})('BlogExample');