Skip to content

Commit 1153167

Browse files
committed
TASK: Avoid prototype injection in constructors
This removes occurances of constructor injection with prototypes, the modified classes are all injected via constructor and should therefore be singletons. Related: neos/flow-development-collection#3494
1 parent 2a1c83d commit 1153167

File tree

3 files changed

+6
-0
lines changed

3 files changed

+6
-0
lines changed

Neos.Neos/Classes/AssetUsage/Domain/AssetUsageRepository.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,12 +16,14 @@
1616
use Neos\ContentRepository\Core\SharedModel\ContentRepository\ContentRepositoryId;
1717
use Neos\ContentRepository\Core\SharedModel\Node\NodeAggregateId;
1818
use Neos\ContentRepository\Core\SharedModel\Workspace\WorkspaceName;
19+
use Neos\Flow\Annotations\Scope;
1920
use Neos\Neos\AssetUsage\Dto\AssetUsageFilter;
2021
use Neos\Neos\AssetUsage\Dto\AssetUsages;
2122

2223
/**
2324
* @internal Not meant to be used in user land code. In order to look up asset usages the AssetUsageService or GlobalAssetUsageService can be used
2425
*/
26+
#[Scope("singleton")]
2527
final class AssetUsageRepository
2628
{
2729
public const TABLE = 'neos_asset_usage';

Neos.Neos/Classes/AssetUsage/Service/AssetUsageIndexingService.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
use Neos\ContentRepository\Core\SharedModel\Workspace\Workspace;
1616
use Neos\ContentRepository\Core\SharedModel\Workspace\WorkspaceName;
1717
use Neos\ContentRepository\Core\SharedModel\Workspace\Workspaces;
18+
use Neos\Flow\Annotations\Scope;
1819
use Neos\Flow\Persistence\Doctrine\PersistenceManager;
1920
use Neos\Media\Domain\Model\AssetInterface;
2021
use Neos\Media\Domain\Model\AssetVariantInterface;
@@ -34,6 +35,7 @@
3435
* 2. Which cache entries do I need to flush on a change to an asset (this requires an additional traversal over all
3536
* dependent workspaces).
3637
*/
38+
#[Scope("singleton")]
3739
final class AssetUsageIndexingService
3840
{
3941
/** @var array <string, string> */

Neos.Neos/Classes/Domain/SubtreeTagging/SoftRemoval/ImpendingHardRemovalConflictRepository.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,10 @@
1919
use Neos\ContentRepository\Core\SharedModel\ContentRepository\ContentRepositoryId;
2020
use Neos\ContentRepository\Core\SharedModel\Node\NodeAggregateId;
2121
use Neos\ContentRepository\Core\SharedModel\Workspace\WorkspaceName;
22+
use Neos\Flow\Annotations\Scope;
2223

2324
/** @internal */
25+
#[Scope("singleton")]
2426
final readonly class ImpendingHardRemovalConflictRepository
2527
{
2628
private const CONFLICT_TABLE_NAME = 'neos_neos_impending_hard_removal_conflict';

0 commit comments

Comments
 (0)