Skip to content

Commit

Permalink
Adjust to Neos 9
Browse files Browse the repository at this point in the history
  • Loading branch information
Bernhard Schmitt committed Aug 28, 2023
1 parent 4da276a commit b24a4b0
Show file tree
Hide file tree
Showing 10 changed files with 29 additions and 28 deletions.
2 changes: 1 addition & 1 deletion Classes/Command/KickstartCommandController.php
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ public function __construct(
private readonly ConfigurationManager $configurationManager,
ContentRepositoryRegistry $contentRepositoryRegistry
) {
$this->nodeTypeManager = $contentRepositoryRegistry->get(ContentRepositoryId::from('default'))->nodeTypeManager;
$this->nodeTypeManager = $contentRepositoryRegistry->get(ContentRepositoryId::fromString('default'))->getNodeTypeManager();
parent::__construct();
}

Expand Down
4 changes: 2 additions & 2 deletions Classes/Domain/GroupedSchemaOrgProperties.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,11 @@
* @implements \IteratorAggregate<string,SchemaOrgProperties>
*/
#[Flow\Proxy(false)]
class GroupedSchemaOrgProperties implements \IteratorAggregate
final readonly class GroupedSchemaOrgProperties implements \IteratorAggregate
{
public function __construct(
/** @var array<string,SchemaOrgProperties> */
private readonly array $properties
private array $properties
) {
}

Expand Down
2 changes: 1 addition & 1 deletion Classes/Domain/PropertyTypeResolver.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
use Sitegeist\Noderobis\Domain\Specification\PropertyTypeSpecification;

#[Flow\Proxy(false)]
class PropertyTypeResolver
final class PropertyTypeResolver
{
public function resolvePropertyType(
SchemaOrgProperty $property,
Expand Down
10 changes: 5 additions & 5 deletions Classes/Domain/SchemaOrgClass.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,16 +11,16 @@
use Neos\Flow\Annotations as Flow;

#[Flow\Proxy(false)]
class SchemaOrgClass
final readonly class SchemaOrgClass
{
/**
* @param array<int,string> $parentClassIds
*/
public function __construct(
public readonly string $id,
public readonly string $comment,
public readonly string $label,
public readonly array $parentClassIds,
public string $id,
public string $comment,
public string $label,
public array $parentClassIds,
) {
}

Expand Down
4 changes: 2 additions & 2 deletions Classes/Domain/SchemaOrgClasses.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,12 @@
* @implements \IteratorAggregate<int|string,SchemaOrgClass>
*/
#[Flow\Proxy(false)]
class SchemaOrgClasses implements \IteratorAggregate
final readonly class SchemaOrgClasses implements \IteratorAggregate
{
/**
* @var array<int|string,SchemaOrgClass>
*/
private readonly array $classes;
private array $classes;

public function __construct(SchemaOrgClass ...$classes)
{
Expand Down
6 changes: 3 additions & 3 deletions Classes/Domain/SchemaOrgGraph.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,11 @@
use Neos\Utility\Files;

#[Flow\Proxy(false)]
class SchemaOrgGraph
final readonly class SchemaOrgGraph
{
public function __construct(
private readonly SchemaOrgClasses $classes,
private readonly SchemaOrgProperties $properties
private SchemaOrgClasses $classes,
private SchemaOrgProperties $properties
) {
}

Expand Down
4 changes: 2 additions & 2 deletions Classes/Domain/SchemaOrgProperties.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,12 @@
* @implements \IteratorAggregate<int|string,SchemaOrgProperty>
*/
#[Flow\Proxy(false)]
class SchemaOrgProperties implements \IteratorAggregate
final readonly class SchemaOrgProperties implements \IteratorAggregate
{
/**
* @var array<int|string,SchemaOrgProperty>
*/
private readonly array $properties;
private array $properties;

public function __construct(SchemaOrgProperty ...$properties)
{
Expand Down
12 changes: 6 additions & 6 deletions Classes/Domain/SchemaOrgProperty.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,18 +11,18 @@
use Neos\Flow\Annotations as Flow;

#[Flow\Proxy(false)]
class SchemaOrgProperty implements \Stringable
final readonly class SchemaOrgProperty implements \Stringable
{
/**
* @param array<int,string> $domainIncludes
* @param array<int,string> $rangeIncludes
*/
public function __construct(
public readonly string $id,
public readonly string $comment,
public readonly string $label,
public readonly array $domainIncludes,
public readonly array $rangeIncludes
public string $id,
public string $comment,
public string $label,
public array $domainIncludes,
public array $rangeIncludes
) {
}

Expand Down
4 changes: 2 additions & 2 deletions Classes/Domain/SchemaSelectionWizard.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,12 @@
use Symfony\Component\Console\Question\ChoiceQuestion;

#[Flow\Proxy(false)]
class SchemaSelectionWizard
final readonly class SchemaSelectionWizard
{
public const SELECTED_SUPERTYPE_NONE = 'none';

public function __construct(
private readonly ConsoleOutput $output
private ConsoleOutput $output
) {
}

Expand Down
9 changes: 5 additions & 4 deletions Classes/Domain/SuperTypeResolver.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,24 +8,25 @@

namespace Sitegeist\Pyranodis\Domain;

use Neos\ContentRepository\Core\NodeType\NodeTypeManager;
use Neos\ContentRepository\Core\Factory\ContentRepositoryId;
use Neos\ContentRepositoryRegistry\ContentRepositoryRegistry;
use Neos\Flow\Annotations as Flow;

#[Flow\Scope("singleton")]
class SuperTypeResolver
{
#[Flow\Inject]
protected NodeTypeManager $nodeTypeManager;
protected ContentRepositoryRegistry $contentRepositoryRegistry;

/**
* @return array<int,string>
*/
public function resolveSuperTypeCandidatesForPropertyName(SchemaOrgProperty $property): array
{
$supertypeCandidates = [];
foreach ($this->nodeTypeManager->getNodeTypes() as $nodeType) {
foreach ($this->contentRepositoryRegistry->get(ContentRepositoryId::fromString('default'))->getNodeTypeManager()->getNodeTypes() as $nodeType) {
if (array_key_exists($property->id, $nodeType->getProperties())) {
$supertypeCandidates[] = $nodeType->getName();
$supertypeCandidates[] = $nodeType->name->value;
}
}

Expand Down

0 comments on commit b24a4b0

Please sign in to comment.