Skip to content

Commit

Permalink
Run php-cs-fix
Browse files Browse the repository at this point in the history
  • Loading branch information
Prokyonn committed May 31, 2023
1 parent 890f158 commit 556d27f
Show file tree
Hide file tree
Showing 23 changed files with 33 additions and 33 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ class ContentNormalizer implements ContentNormalizerInterface
*/
public function __construct(
iterable $normalizers,
?SymfonyNormalizerInterface $serializer = null
SymfonyNormalizerInterface $serializer = null
) {
$this->normalizers = $normalizers;
$this->serializer = $serializer ?: $this->createSerializer();
Expand Down
6 changes: 3 additions & 3 deletions Content/Application/ContentWorkflow/ContentWorkflow.php
Original file line number Diff line number Diff line change
Expand Up @@ -58,8 +58,8 @@ class ContentWorkflow implements ContentWorkflowInterface
public function __construct(
DimensionContentRepositoryInterface $dimensionContentRepository,
ContentMergerInterface $contentMerger,
?Registry $workflowRegistry = null,
?EventDispatcherInterface $eventDispatcher = null
Registry $workflowRegistry = null,
EventDispatcherInterface $eventDispatcher = null
) {
$this->dimensionContentRepository = $dimensionContentRepository;
$this->contentMerger = $contentMerger;
Expand Down Expand Up @@ -94,7 +94,7 @@ public function apply(
}

if (!$localizedDimensionContent instanceof WorkflowInterface) {
throw new \RuntimeException(\sprintf('Expected "%s" but "%s" given.', WorkflowInterface::class, \get_class($localizedDimensionContent)));
throw new \RuntimeException(\sprintf('Expected "%s" but "%s" given.', WorkflowInterface::class, $localizedDimensionContent::class));
}

$workflow = $this->workflowRegistry->get(
Expand Down
2 changes: 1 addition & 1 deletion Content/Domain/Model/ShadowTrait.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ trait ShadowTrait
/**
* @var string[]|null
*/
protected $shadowLocales = null;
protected $shadowLocales;

/**
* @internal should only be set by content bundle services not from outside
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,8 +60,8 @@ public function load(
ContentRichEntityInterface $contentRichEntity,
array $dimensionAttributes
): DimensionContentCollectionInterface {
$dimensionContentClass = $this->contentMetadataInspector->getDimensionContentClass(\get_class($contentRichEntity));
$mappingProperty = $this->contentMetadataInspector->getDimensionContentPropertyName(\get_class($contentRichEntity));
$dimensionContentClass = $this->contentMetadataInspector->getDimensionContentClass($contentRichEntity::class);
$mappingProperty = $this->contentMetadataInspector->getDimensionContentPropertyName($contentRichEntity::class);

$queryBuilder = $this->entityManager->createQueryBuilder()
->from($dimensionContentClass, 'dimensionContent')
Expand Down
2 changes: 1 addition & 1 deletion Content/Infrastructure/Doctrine/RouteRemover.php
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ public function preRemove(LifecycleEventArgs $event): void
return; // @codeCoverageIgnore
}

$dimensionContentClass = $this->contentMetadataInspector->getDimensionContentClass(\get_class($object));
$dimensionContentClass = $this->contentMetadataInspector->getDimensionContentClass($object::class);
$resourceKey = $dimensionContentClass::getResourceKey();

$entityClass = null;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -140,9 +140,9 @@ public function getDefaultToolbarActions(
public function createViews(
string $contentRichEntityClass,
string $editParentView,
?string $addParentView = null,
?string $securityContext = null,
?array $toolbarActions = null
string $addParentView = null,
string $securityContext = null,
array $toolbarActions = null
): array {
$dimensionContentClass = $this->contentMetadataInspector->getDimensionContentClass($contentRichEntityClass);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,8 @@ public function getDefaultToolbarActions(
public function createViews(
string $contentRichEntityClass,
string $editParentView,
?string $addParentView = null,
?string $securityContext = null,
?array $toolbarActions = null
string $addParentView = null,
string $securityContext = null,
array $toolbarActions = null
): array;
}
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ public function __construct(
ContentResolverInterface $contentResolver,
ContentDataMapperInterface $contentDataMapper,
string $contentRichEntityClass,
?string $securityContext = null
string $securityContext = null
) {
$this->entityManager = $entityManager;
$this->contentResolver = $contentResolver;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ public function getByEntity($entityClass, $id, $locale, $object = null)
}

if (!$entity instanceof TemplateInterface) {
throw new \RuntimeException(\sprintf('Expected to get "%s" from ContentResolver but "%s" given.', TemplateInterface::class, \get_class($entity)));
throw new \RuntimeException(\sprintf('Expected to get "%s" from ContentResolver but "%s" given.', TemplateInterface::class, $entity::class));
}

try {
Expand Down Expand Up @@ -156,7 +156,7 @@ protected function loadEntity(string $entityClass, string $id, string $locale):
);

if (!$resolvedDimensionContent instanceof TemplateInterface) {
throw new \RuntimeException(\sprintf('Expected to get "%s" from ContentResolver but "%s" given.', TemplateInterface::class, \get_class($resolvedDimensionContent)));
throw new \RuntimeException(\sprintf('Expected to get "%s" from ContentResolver but "%s" given.', TemplateInterface::class, $resolvedDimensionContent::class));
}

return $resolvedDimensionContent;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ class ContentReindexProvider implements LocalizedReindexProviderInterface
/**
* @var class-string<B>|null
*/
private $dimensionContentClass = null;
private $dimensionContentClass;

/**
* @param class-string<T> $contentRichEntityClass
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ class ContentSearchMetadataProvider implements ProviderInterface
/**
* @var class-string<B>|null
*/
private $dimensionContentClass = null;
private $dimensionContentClass;

/**
* @param class-string<T> $contentRichEntityClass
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@ public function testCreateSitemap(): void
$sitemap = $this->contentSitemapProvider->createSitemap(static::SCHEME, static::HOST);

$this->assertNotNull($sitemap);
$this->assertSame(Sitemap::class, \get_class($sitemap));
$this->assertSame(Sitemap::class, $sitemap::class);
$this->assertSame($this->contentSitemapProvider->getAlias(), $sitemap->getAlias());
$this->assertSame($this->contentSitemapProvider->getMaxPage(static::SCHEME, static::HOST), $sitemap->getMaxPage());
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,7 @@ public function testFindENNoRoute(): void
}

/**
* @param Teaser[]$teasers
* @param Teaser[] $teasers
*
* @return array<string, mixed>
*/
Expand Down
2 changes: 1 addition & 1 deletion Tests/Traits/CreateExampleTrait.php
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,7 @@ protected static function createExample(array $dataSet = [], array $options = []
$draftTemplateData = $draftLocalizedDimension->getTemplateData();
$route->setPath($draftTemplateData['url']);
$route->setEntityId($example->getId()); // @phpstan-ignore-line
$route->setEntityClass(\get_class($example));
$route->setEntityClass($example::class);

$entityManager->persist($route);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ protected function setUp(): void
* @param array<string, array<mixed>> $resourceKeyMappings
*/
protected function createRouteDataMapperInstance(
?array $resourceKeyMappings = null
array $resourceKeyMappings = null
): RoutableDataMapper {
if (!\is_array($resourceKeyMappings)) {
$resourceKeyMappings = [
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ public function testMerge(): void
], [
'locale' => 'en',
'stage' => 'draft',
], \get_class($dimensionContent1));
], $dimensionContent1::class);

$this->assertSame(
$mergedDimensionContent->reveal(),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -446,7 +446,7 @@ public function testCreateViewsWithContentRichEntityClass(DimensionContentInterf

$contentMetadataInspector = $this->prophesize(ContentMetadataInspectorInterface::class);
$contentMetadataInspector->getDimensionContentClass(Example::class)
->willReturn(\get_class($dimensionContentObject));
->willReturn($dimensionContentObject::class);

$contentViewBuilder = $this->createContentViewBuilder($contentMetadataInspector->reveal(), $securityChecker->reveal());

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ public function testSupports(): void
{
$entity = new Example();

$this->assertTrue($this->handler->supports(\get_class($entity)));
$this->assertTrue($this->handler->supports($entity::class));
$this->assertFalse($this->handler->supports(PageDocument::class));
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ public function testSupports(): void
{
$entity = new Example();

$this->assertTrue($this->handler->supports(\get_class($entity)));
$this->assertTrue($this->handler->supports($entity::class));
$this->assertFalse($this->handler->supports(PageDocument::class));
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ class PreviewDimensionContentCollectionTest extends TestCase
* @return PreviewDimensionContentCollection<T|ExampleDimensionContent>
*/
protected function createPreviewDimensionContentCollection(
?ExampleDimensionContent $previewDimensionContent = null,
ExampleDimensionContent $previewDimensionContent = null,
string $locale = 'en'
): PreviewDimensionContentCollection {
return new PreviewDimensionContentCollection(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ public function testSupports(): void

$contentRichEntity = new Example();

$this->assertTrue($contentRouteDefaultsProvider->supports(\get_class($contentRichEntity)));
$this->assertTrue($contentRouteDefaultsProvider->supports($contentRichEntity::class));
$this->assertFalse($contentRouteDefaultsProvider->supports(\stdClass::class));
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ class ContentDocumentTest extends TestCase
use \Prophecy\PhpUnit\ProphecyTrait;

protected function createContentDocument(
?TemplateInterface $content = null,
TemplateInterface $content = null,
string $locale = 'en'
): ContentDocument {
return new ContentDocument(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,9 @@ class ContentStructureBridgeTest extends TestCase
use \Prophecy\PhpUnit\ProphecyTrait;

protected function createStructureBridge(
?TemplateInterface $content = null,
?StructureMetadata $structure = null,
?LegacyPropertyFactory $propertyFactory = null,
TemplateInterface $content = null,
StructureMetadata $structure = null,
LegacyPropertyFactory $propertyFactory = null,
string $id = '123-123-123',
string $locale = 'en'
): ContentStructureBridge {
Expand Down

0 comments on commit 556d27f

Please sign in to comment.