Skip to content

Commit

Permalink
Merge branch '9.0' into feature/4726-extract-workspace-metadata-and-u…
Browse files Browse the repository at this point in the history
…ser-assignment-to-neos
  • Loading branch information
bwaidelich committed Aug 7, 2024
2 parents 9c74b65 + b2d5f28 commit 4326424
Show file tree
Hide file tree
Showing 10 changed files with 65 additions and 13 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -113,8 +113,8 @@ private function determineRequiredSqlStatements(): array
{
$schemaManager = $this->dbal->createSchemaManager();
$workspaceTable = new Table($this->tableName, [
(new Column('workspacename', Type::getType(Types::STRING)))->setLength(255)->setNotnull(true)->setPlatformOption('collation', self::DEFAULT_TEXT_COLLATION),
(new Column('baseworkspacename', Type::getType(Types::STRING)))->setLength(255)->setNotnull(false)->setPlatformOption('collation', self::DEFAULT_TEXT_COLLATION),
(new Column('workspacename', Type::getType(Types::STRING)))->setLength(WorkspaceName::MAX_LENGTH)->setNotnull(true)->setPlatformOption('collation', self::DEFAULT_TEXT_COLLATION),
(new Column('baseworkspacename', Type::getType(Types::STRING)))->setLength(WorkspaceName::MAX_LENGTH)->setNotnull(false)->setPlatformOption('collation', self::DEFAULT_TEXT_COLLATION),
(new Column('workspacetitle', Type::getType(Types::STRING)))->setLength(255)->setNotnull(true)->setPlatformOption('collation', self::DEFAULT_TEXT_COLLATION),
(new Column('workspacedescription', Type::getType(Types::STRING)))->setLength(255)->setNotnull(true)->setPlatformOption('collation', self::DEFAULT_TEXT_COLLATION),
(new Column('workspaceowner', Type::getType(Types::STRING)))->setLength(255)->setNotnull(false)->setPlatformOption('collation', self::DEFAULT_TEXT_COLLATION),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ private function __construct(ContentRepositoryId ...$ids)
}

/**
* @param array<mixed> $ids
* @param array<ContentRepositoryId|string> $ids
*/
public static function fromArray(array $ids): self
{
Expand All @@ -50,7 +50,7 @@ public static function fromArray(array $ids): self

public function getIterator(): \Traversable
{
return yield from $this->ids;
yield from $this->ids;
}

public function count(): int
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
<?php

declare(strict_types=1);

namespace Neos\ContentRepository\Core\Tests\Unit\SharedModel\ContentRepository;

/*
* This file is part of the Neos.ContentRepository package.
*
* (c) Contributors of the Neos Project - www.neos.io
*
* This package is Open Source Software. For the full copyright and license
* information, please view the LICENSE file which was distributed with this
* source code.
*/

use Neos\ContentRepository\Core\SharedModel\ContentRepository\ContentRepositoryId;
use Neos\ContentRepository\Core\SharedModel\ContentRepository\ContentRepositoryIds;
use PHPUnit\Framework\TestCase;

class ContentRepositoryIdsTest extends TestCase
{
/**
* @test
*/
public function fromArraySupportsEmptyArray(): void
{
$contentRepositoryIds = ContentRepositoryIds::fromArray([]);
self::assertCount(0, $contentRepositoryIds);
}

/**
* @test
*/
public function fromArrayConvertsStringsToContentRepositoryIds(): void
{
$contentRepositoryIds = ContentRepositoryIds::fromArray(['some_cr_id', ContentRepositoryId::fromString('other_cr_id')]);
self::assertEquals([ContentRepositoryId::fromString('some_cr_id'), ContentRepositoryId::fromString('other_cr_id')], iterator_to_array($contentRepositoryIds));
}

/**
* @test
*/
public function fromArrayThrowsExceptionForInvalidItem(): void
{
$this->expectException(\InvalidArgumentException::class);
ContentRepositoryIds::fromArray([1234]);
}
}
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<?php

declare(strict_types=1);

namespace Neos\ContentRepositoryRegistry;
Expand Down Expand Up @@ -84,7 +85,9 @@ public function get(ContentRepositoryId $contentRepositoryId): ContentRepository

public function getContentRepositoryIds(): ContentRepositoryIds
{
return ContentRepositoryIds::fromArray(array_keys($this->settings['contentRepositories'] ?? []));
/** @var array<string> $contentRepositoryIds */
$contentRepositoryIds = array_keys($this->settings['contentRepositories'] ?? []);
return ContentRepositoryIds::fromArray($contentRepositoryIds);
}

/**
Expand Down Expand Up @@ -136,7 +139,8 @@ private function getFactory(
/**
* @throws ContentRepositoryNotFoundException | InvalidConfigurationException
*/
private function buildFactory(ContentRepositoryId $contentRepositoryId): ContentRepositoryFactory {
private function buildFactory(ContentRepositoryId $contentRepositoryId): ContentRepositoryFactory
{
if (!is_array($this->settings['contentRepositories'] ?? null)) {
throw InvalidConfigurationException::fromMessage('No Content Repositories are configured');
}
Expand Down Expand Up @@ -208,7 +212,6 @@ private function buildContentDimensionSource(ContentRepositoryId $contentReposit
$options['contentDimensions'] = Arrays::arrayMergeRecursiveOverrule($contentRepositorySettings['contentDimensions'], $options['contentDimensions'] ?? []);
}
return $contentDimensionSourceFactory->build($contentRepositoryId, $options);

}

/** @param array<string, mixed> $contentRepositorySettings */
Expand Down
2 changes: 1 addition & 1 deletion Neos.Neos/Documentation/References/CommandReference.rst
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ commands that may be available, use::

./flow help

The following reference was automatically generated from code on 2024-07-30
The following reference was automatically generated from code on 2024-08-05


.. _`Neos Command Reference: NEOS.FLOW`:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
FluidAdaptor ViewHelper Reference
#################################

This reference was automatically generated from code on 2024-07-30
This reference was automatically generated from code on 2024-08-05


.. _`FluidAdaptor ViewHelper Reference: f:debug`:
Expand Down
2 changes: 1 addition & 1 deletion Neos.Neos/Documentation/References/ViewHelpers/Form.rst
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
Form ViewHelper Reference
#########################

This reference was automatically generated from code on 2024-07-30
This reference was automatically generated from code on 2024-08-05


.. _`Form ViewHelper Reference: neos.form:form`:
Expand Down
2 changes: 1 addition & 1 deletion Neos.Neos/Documentation/References/ViewHelpers/Media.rst
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
Media ViewHelper Reference
##########################

This reference was automatically generated from code on 2024-07-30
This reference was automatically generated from code on 2024-08-05


.. _`Media ViewHelper Reference: neos.media:fileTypeIcon`:
Expand Down
2 changes: 1 addition & 1 deletion Neos.Neos/Documentation/References/ViewHelpers/Neos.rst
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
Neos ViewHelper Reference
#########################

This reference was automatically generated from code on 2024-07-30
This reference was automatically generated from code on 2024-08-05


.. _`Neos ViewHelper Reference: neos:backend.authenticationProviderLabel`:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
TYPO3 Fluid ViewHelper Reference
################################

This reference was automatically generated from code on 2024-07-30
This reference was automatically generated from code on 2024-08-05


.. _`TYPO3 Fluid ViewHelper Reference: f:alias`:
Expand Down

0 comments on commit 4326424

Please sign in to comment.