Skip to content

Commit

Permalink
4228 - Adjust code style
Browse files Browse the repository at this point in the history
  • Loading branch information
Bernhard Schmitt committed May 2, 2023
1 parent 8571e3d commit 93aae71
Show file tree
Hide file tree
Showing 6 changed files with 7 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,9 @@

namespace Neos\ContentRepository\Core\NodeType;

/**
* @internal
*/
final class DefaultNodeLabelGeneratorFactory implements NodeLabelGeneratorFactoryInterface
{
public function create(NodeType $nodeType): NodeLabelGeneratorInterface
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@

namespace Neos\ContentRepository\Core\NodeType;


/**
* Interface for creating a generator for a node labels
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ public static function create(): string
{
return is_callable('uuid_create')
? strtolower(uuid_create(UUID_TYPE_RANDOM))
/** @phpstan-ignore-next-line not always true */
: Uuid::uuid4()->toString();
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ public static function transliterateFromString(string $name): self
$name = preg_replace('/[^a-z0-9\-]/', '', $name);

// Make sure we don't have an empty string left.
if ($name === '') {
if (empty($name)) {
$name = 'node-' . strtolower(md5($originalName));
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ public static function transliterateFromString(string $name): self
$name = preg_replace('/[^a-z0-9\-]/', '', $name);

// Make sure we don't have an empty string left.
if ($name === '') {
if (empty($name)) {
$name = 'workspace-' . strtolower(md5($originalName));
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -226,7 +226,7 @@ public function createAction(
);
while ($contentRepository->getWorkspaceFinder()->findOneByName($workspaceName) instanceof Workspace) {
$workspaceName = WorkspaceName::fromString(
WorkspaceName::transliterateFromString($title->value)->value. '-'
WorkspaceName::transliterateFromString($title->value)->value . '-'
. substr(base_convert(microtime(false), 10, 36), -5, 5)
);
}
Expand Down

0 comments on commit 93aae71

Please sign in to comment.