Skip to content

Commit

Permalink
cs + some more deprecation warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
konradoboza committed Nov 26, 2021
1 parent 04fbce4 commit a791e2f
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 23 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -203,7 +203,9 @@ protected function storeNewFieldData(VersionInfo $versionInfo, Field $field)
*/
public function removeMimeFromPath($path)
{
return substr($path, strpos((string)$path, '/') + 1);
$path = (string)$path;

return substr($path, strpos($path, '/') + 1);
}

/**
Expand Down
29 changes: 7 additions & 22 deletions eZ/Publish/Core/Repository/ContentTypeService.php
Original file line number Diff line number Diff line change
Expand Up @@ -785,30 +785,18 @@ function (APIContentTypeGroup $contentTypeGroup) {
'identifier' => $contentTypeCreateStruct->identifier,
'name' => $contentTypeCreateStruct->names,
'status' => APIContentType::STATUS_DRAFT,
'description' => $contentTypeCreateStruct->descriptions === null ?
[] :
$contentTypeCreateStruct->descriptions,
'description' => $contentTypeCreateStruct->descriptions ?? [],
'created' => $timestamp,
'modified' => $timestamp,
'creatorId' => $contentTypeCreateStruct->creatorId,
'modifierId' => $contentTypeCreateStruct->creatorId,
'remoteId' => $contentTypeCreateStruct->remoteId,
'urlAliasSchema' => $contentTypeCreateStruct->urlAliasSchema === null ?
'' :
$contentTypeCreateStruct->urlAliasSchema,
'nameSchema' => $contentTypeCreateStruct->nameSchema === null ?
'' :
$contentTypeCreateStruct->nameSchema,
'isContainer' => $contentTypeCreateStruct->isContainer === null ?
false :
$contentTypeCreateStruct->isContainer,
'urlAliasSchema' => $contentTypeCreateStruct->urlAliasSchema ?? '',
'nameSchema' => $contentTypeCreateStruct->nameSchema ?? '',
'isContainer' => $contentTypeCreateStruct->isContainer ?? false,
'initialLanguageId' => $initialLanguageId,
'sortField' => $contentTypeCreateStruct->defaultSortField === null ?
Location::SORT_FIELD_PUBLISHED :
$contentTypeCreateStruct->defaultSortField,
'sortOrder' => $contentTypeCreateStruct->defaultSortOrder === null ?
Location::SORT_ORDER_DESC :
$contentTypeCreateStruct->defaultSortOrder,
'sortField' => $contentTypeCreateStruct->defaultSortField ?? Location::SORT_FIELD_PUBLISHED,
'sortOrder' => $contentTypeCreateStruct->defaultSortOrder ?? Location::SORT_ORDER_DESC,
'groupIds' => $groupIds,
'fieldDefinitions' => $spiFieldDefinitions,
'defaultAlwaysAvailable' => $contentTypeCreateStruct->defaultAlwaysAvailable,
Expand Down Expand Up @@ -859,10 +847,7 @@ protected function validateFieldDefinitionCreateStruct(FieldDefinitionCreateStru
*/
public function loadContentType(int $contentTypeId, array $prioritizedLanguages = []): ContentType
{
$spiContentType = $this->contentTypeHandler->load(
$contentTypeId,
SPIContentType::STATUS_DEFINED
);
$spiContentType = $this->contentTypeHandler->load($contentTypeId);

return $this->contentTypeDomainMapper->buildContentTypeDomainObject(
$spiContentType,
Expand Down

0 comments on commit a791e2f

Please sign in to comment.