Skip to content

Commit

Permalink
Merge branch '8.1' into 8.2
Browse files Browse the repository at this point in the history
# Conflicts:
#	Neos.Flow/Documentation/TheDefinitiveGuide/PartV/AnnotationReference.rst
#	Neos.Flow/Documentation/TheDefinitiveGuide/PartV/CommandReference.rst
#	Neos.Flow/Documentation/TheDefinitiveGuide/PartV/SignalsReference.rst
#	Neos.Flow/Documentation/TheDefinitiveGuide/PartV/TypeConverterReference.rst
#	Neos.Flow/Documentation/TheDefinitiveGuide/PartV/ValidatorReference.rst
  • Loading branch information
robertlemke committed May 30, 2023
2 parents daf764e + e70a35a commit 402c43b
Show file tree
Hide file tree
Showing 11 changed files with 225 additions and 228 deletions.
6 changes: 3 additions & 3 deletions Neos.Flow/Classes/Aop/Builder/ProxyClassBuilder.php
Original file line number Diff line number Diff line change
Expand Up @@ -452,7 +452,7 @@ public function buildProxyClass(string $targetClassName, array &$aspectContainer
$proxyClass->addProperty($propertyName, var_export($propertyIntroduction->getInitialValue(), true), $propertyIntroduction->getPropertyVisibility(), $propertyIntroduction->getPropertyDocComment());
}

$proxyClass->getMethod('Flow_Aop_Proxy_buildMethodsAndAdvicesArray')->addPreParentCallCode(" if (method_exists(get_parent_class(), 'Flow_Aop_Proxy_buildMethodsAndAdvicesArray') && is_callable('parent::Flow_Aop_Proxy_buildMethodsAndAdvicesArray')) parent::Flow_Aop_Proxy_buildMethodsAndAdvicesArray();\n");
$proxyClass->getMethod('Flow_Aop_Proxy_buildMethodsAndAdvicesArray')->addPreParentCallCode(" if (method_exists(get_parent_class(), 'Flow_Aop_Proxy_buildMethodsAndAdvicesArray') && is_callable([parent::class, 'Flow_Aop_Proxy_buildMethodsAndAdvicesArray'])) parent::Flow_Aop_Proxy_buildMethodsAndAdvicesArray();\n");
$proxyClass->getMethod('Flow_Aop_Proxy_buildMethodsAndAdvicesArray')->addPreParentCallCode($this->buildMethodsAndAdvicesArrayCode($interceptedMethods));
$proxyClass->getMethod('Flow_Aop_Proxy_buildMethodsAndAdvicesArray')->overrideMethodVisibility('protected');

Expand All @@ -462,7 +462,7 @@ public function buildProxyClass(string $targetClassName, array &$aspectContainer
$proxyClass->getMethod('__clone')->addPreParentCallCode($callBuildMethodsAndAdvicesArrayCode);

if (!$this->reflectionService->hasMethod($targetClassName, '__wakeup')) {
$proxyClass->getMethod('__wakeup')->addPostParentCallCode(" if (method_exists(get_parent_class(), '__wakeup') && is_callable('parent::__wakeup')) parent::__wakeup();\n");
$proxyClass->getMethod('__wakeup')->addPostParentCallCode(" if (method_exists(get_parent_class(), '__wakeup') && is_callable([parent::class, '__wakeup'])) parent::__wakeup();\n");
}

$proxyClass->addTraits(['\\' . AdvicesTrait::class]);
Expand Down Expand Up @@ -531,7 +531,7 @@ protected function addBuildMethodsAndAdvicesCodeToClass(string $className, Class
return $treatedSubClasses;
}

$callBuildMethodsAndAdvicesArrayCode = " if (method_exists(get_parent_class(), 'Flow_Aop_Proxy_buildMethodsAndAdvicesArray') && is_callable('parent::Flow_Aop_Proxy_buildMethodsAndAdvicesArray')) parent::Flow_Aop_Proxy_buildMethodsAndAdvicesArray();\n";
$callBuildMethodsAndAdvicesArrayCode = " if (method_exists(get_parent_class(), 'Flow_Aop_Proxy_buildMethodsAndAdvicesArray') && is_callable([parent::class, 'Flow_Aop_Proxy_buildMethodsAndAdvicesArray'])) parent::Flow_Aop_Proxy_buildMethodsAndAdvicesArray();\n";
$proxyClass->getConstructor()->addPreParentCallCode($callBuildMethodsAndAdvicesArrayCode);
$proxyClass->getMethod('__wakeup')->addPreParentCallCode($callBuildMethodsAndAdvicesArrayCode);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@
*/
trait PropertyInjectionTrait
{
protected array $Flow_Injected_Properties = [];

/**
* Does a property injection lazily with fallbacks.
* Used in proxy classes.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,10 @@
*/
trait ObjectSerializationTrait
{
protected array $Flow_Object_PropertiesToSerialize = [];

protected ?array $Flow_Persistence_RelatedEntities = null;

/**
* Code to find and serialize entities on sleep
*
Expand All @@ -45,17 +49,20 @@ private function Flow_serializeRelatedEntities(array $transientProperties, array
if (in_array($propertyName, [
'Flow_Aop_Proxy_targetMethodsAndGroupedAdvices',
'Flow_Aop_Proxy_groupedAdviceChains',
'Flow_Aop_Proxy_methodIsInAdviceMode'
'Flow_Aop_Proxy_methodIsInAdviceMode',
'Flow_Persistence_RelatedEntities',
'Flow_Object_PropertiesToSerialize',
'Flow_Injected_Properties',
])) {
continue;
}
if (isset($this->Flow_Injected_Properties) && is_array($this->Flow_Injected_Properties) && in_array($propertyName, $this->Flow_Injected_Properties)) {
if (property_exists($this, 'Flow_Injected_Properties') && is_array($this->Flow_Injected_Properties) && in_array($propertyName, $this->Flow_Injected_Properties, true)) {
continue;
}
if ($reflectionProperty->isStatic() || in_array($propertyName, $transientProperties)) {
if ($reflectionProperty->isStatic() || in_array($propertyName, $transientProperties, true)) {
continue;
}
if (is_array($this->$propertyName) || (is_object($this->$propertyName) && ($this->$propertyName instanceof \ArrayObject || $this->$propertyName instanceof \SplObjectStorage || $this->$propertyName instanceof Collection))) {
if (is_array($this->$propertyName) || ($this->$propertyName instanceof \ArrayObject || $this->$propertyName instanceof \SplObjectStorage || $this->$propertyName instanceof Collection)) {
if (count($this->$propertyName) > 0) {
foreach ($this->$propertyName as $key => $value) {
$this->Flow_searchForEntitiesAndStoreIdentifierArray((string)$key, $value, $propertyName);
Expand All @@ -69,14 +76,14 @@ private function Flow_serializeRelatedEntities(array $transientProperties, array
if (isset($propertyVarTags[$propertyName])) {
$className = trim($propertyVarTags[$propertyName], '\\');
} else {
$className = $reflectionProperty->getType()->getName();
$className = $reflectionProperty->getType()?->getName();
}
if (Bootstrap::$staticObjectManager->isRegistered($className) === false) {
$className = Bootstrap::$staticObjectManager->getObjectNameByClassName(get_class($this->$propertyName));
}
}
if ($this->$propertyName instanceof PersistenceMagicInterface && !Bootstrap::$staticObjectManager->get(PersistenceManagerInterface::class)->isNewObject($this->$propertyName) || $this->$propertyName instanceof DoctrineProxy) {
if (!property_exists($this, 'Flow_Persistence_RelatedEntities') || !is_array($this->Flow_Persistence_RelatedEntities)) {
if ($this->$propertyName instanceof DoctrineProxy || ($this->$propertyName instanceof PersistenceMagicInterface && !Bootstrap::$staticObjectManager->get(PersistenceManagerInterface::class)->isNewObject($this->$propertyName))) {
if (!isset($this->Flow_Persistence_RelatedEntities) || !is_array($this->Flow_Persistence_RelatedEntities)) {
$this->Flow_Persistence_RelatedEntities = [];
$this->Flow_Object_PropertiesToSerialize[] = 'Flow_Persistence_RelatedEntities';
}
Expand Down Expand Up @@ -109,14 +116,14 @@ private function Flow_serializeRelatedEntities(array $transientProperties, array
* @param string $originalPropertyName
* @return void
*/
private function Flow_searchForEntitiesAndStoreIdentifierArray(string $path, mixed $propertyValue, string $originalPropertyName)
private function Flow_searchForEntitiesAndStoreIdentifierArray(string $path, mixed $propertyValue, string $originalPropertyName): void
{
if (is_array($propertyValue) || ($propertyValue instanceof \ArrayObject || $propertyValue instanceof \SplObjectStorage)) {
foreach ($propertyValue as $key => $value) {
$this->Flow_searchForEntitiesAndStoreIdentifierArray($path . '.' . $key, $value, $originalPropertyName);
}
} elseif ($propertyValue instanceof PersistenceMagicInterface && !Bootstrap::$staticObjectManager->get(PersistenceManagerInterface::class)->isNewObject($propertyValue) || $propertyValue instanceof DoctrineProxy) {
if (!property_exists($this, 'Flow_Persistence_RelatedEntities') || !is_array($this->Flow_Persistence_RelatedEntities)) {
} elseif ($propertyValue instanceof DoctrineProxy || ($propertyValue instanceof PersistenceMagicInterface && !Bootstrap::$staticObjectManager->get(PersistenceManagerInterface::class)->isNewObject($propertyValue))) {
if (!isset($this->Flow_Persistence_RelatedEntities) || !is_array($this->Flow_Persistence_RelatedEntities)) {
$this->Flow_Persistence_RelatedEntities = [];
$this->Flow_Object_PropertiesToSerialize[] = 'Flow_Persistence_RelatedEntities';
}
Expand Down Expand Up @@ -145,9 +152,9 @@ private function Flow_searchForEntitiesAndStoreIdentifierArray(string $path, mix
*
* @return void
*/
private function Flow_setRelatedEntities()
private function Flow_setRelatedEntities(): void
{
if (property_exists($this, 'Flow_Persistence_RelatedEntities') && is_array($this->Flow_Persistence_RelatedEntities)) {
if (isset($this->Flow_Persistence_RelatedEntities)) {
$persistenceManager = Bootstrap::$staticObjectManager->get(PersistenceManagerInterface::class);
foreach ($this->Flow_Persistence_RelatedEntities as $entityInformation) {
$entity = $persistenceManager->getObjectByIdentifier($entityInformation['identifier'], $entityInformation['entityType'], true);
Expand Down
32 changes: 0 additions & 32 deletions Neos.Flow/Resources/Private/Translations/ar/ValidationErrors.xlf
Original file line number Diff line number Diff line change
Expand Up @@ -156,22 +156,6 @@
<source>This field must contain at least {0,number} character</source>
<target state="needs-translation">This field must contain at least {0,number} character</target>
</trans-unit>
<trans-unit id="1238108068[2]">
<source>This field must contain at least {0,number} characters</source>
<target state="needs-translation">This field must contain at least {0,number} characters</target>
</trans-unit>
<trans-unit id="1238108068[3]">
<source>This field must contain at least {0,number} characters</source>
<target state="needs-translation">This field must contain at least {0,number} characters</target>
</trans-unit>
<trans-unit id="1238108068[4]">
<source>This field must contain at least {0,number} characters</source>
<target state="needs-translation">This field must contain at least {0,number} characters</target>
</trans-unit>
<trans-unit id="1238108068[5]">
<source>This field must contain at least {0,number} characters</source>
<target state="needs-translation">This field must contain at least {0,number} characters</target>
</trans-unit>
</group>
<group id="1238108069" restype="x-gettext-plurals">
<trans-unit id="1238108069[0]">
Expand All @@ -182,22 +166,6 @@
<source>This text may not exceed {0,number} character</source>
<target state="needs-translation">This text may not exceed {0,number} character</target>
</trans-unit>
<trans-unit id="1238108069[2]">
<source>This text may not exceed {0,number} characters</source>
<target state="needs-translation">This text may not exceed {0,number} characters</target>
</trans-unit>
<trans-unit id="1238108069[3]">
<source>This text may not exceed {0,number} characters</source>
<target state="needs-translation">This text may not exceed {0,number} characters</target>
</trans-unit>
<trans-unit id="1238108069[4]">
<source>This text may not exceed {0,number} characters</source>
<target state="needs-translation">This text may not exceed {0,number} characters</target>
</trans-unit>
<trans-unit id="1238108069[5]">
<source>This text may not exceed {0,number} characters</source>
<target state="needs-translation">This text may not exceed {0,number} characters</target>
</trans-unit>
</group>
<!-- StringValidator -->
<trans-unit id="1238108070" xml:space="preserve">
Expand Down
16 changes: 0 additions & 16 deletions Neos.Flow/Resources/Private/Translations/cs/ValidationErrors.xlf
Original file line number Diff line number Diff line change
Expand Up @@ -156,14 +156,6 @@
<source>This field must contain at least {0,number} characters</source>
<target state="needs-translation">This field must contain at least {0,number} characters</target>
</trans-unit>
<trans-unit id="1238108068[2]">
<source>This field must contain at least {0,number} characters</source>
<target state="needs-translation">This field must contain at least {0,number} characters</target>
</trans-unit>
<trans-unit id="1238108068[3]">
<source>This field must contain at least {0,number} characters</source>
<target state="needs-translation">This field must contain at least {0,number} characters</target>
</trans-unit>
</group>
<group id="1238108069" restype="x-gettext-plurals">
<trans-unit id="1238108069[0]">
Expand All @@ -174,14 +166,6 @@
<source>This text may not exceed {0,number} characters</source>
<target state="needs-translation">This text may not exceed {0,number} characters</target>
</trans-unit>
<trans-unit id="1238108069[2]">
<source>This text may not exceed {0,number} characters</source>
<target state="needs-translation">This text may not exceed {0,number} characters</target>
</trans-unit>
<trans-unit id="1238108069[3]">
<source>This text may not exceed {0,number} characters</source>
<target state="needs-translation">This text may not exceed {0,number} characters</target>
</trans-unit>
</group>
<!-- StringValidator -->
<trans-unit id="1238108070" xml:space="preserve">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -156,10 +156,6 @@
<source>This field must contain at least {0,number} character</source>
<target state="translated">Šim laukam jāsatur vismaz {0,number} rakstzīmi</target>
</trans-unit>
<trans-unit id="1238108068[2]">
<source>This field must contain at least {0,number} characters</source>
<target state="translated">Šim laukam jāsatur vismaz {0,number} rakstzīmi</target>
</trans-unit>
</group>
<group id="1238108069" restype="x-gettext-plurals">
<trans-unit id="1238108069[0]" approved="yes">
Expand All @@ -170,10 +166,6 @@
<source>This text may not exceed {0,number} character</source>
<target state="translated">Šis teksts nedrīkst būt garāks par {0,number} rakstzīmi</target>
</trans-unit>
<trans-unit id="1238108069[2]">
<source>This text may not exceed {0,number} characters</source>
<target state="translated">Šis teksts nedrīkst būt garāks par {0,number} rakstzīmēm</target>
</trans-unit>
</group>
<!-- StringValidator -->
<trans-unit id="1238108070" xml:space="preserve" approved="yes">
Expand Down

0 comments on commit 402c43b

Please sign in to comment.