From 9b301b097b16deba1f4c5415ac4f01348f36a90a Mon Sep 17 00:00:00 2001 From: lacatoire Date: Sun, 7 Jun 2026 20:09:48 +0200 Subject: [PATCH] =?UTF-8?q?[Sync=20EN]=20reflection:=20deutsche=20=C3=9Cbe?= =?UTF-8?q?rsetzung=20neuer=20Dateien?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../reflectionclass/isiterateable.xml | 41 ++++ .../reflection/reflectionmethod/construct.xml | 192 ++++++++++++++++++ .../reflectionproperty/getdefaultvalue.xml | 124 +++++++++++ .../reflectionproperty/getdoccomment.xml | 131 ++++++++++++ 4 files changed, 488 insertions(+) create mode 100644 reference/reflection/reflectionclass/isiterateable.xml create mode 100644 reference/reflection/reflectionmethod/construct.xml create mode 100644 reference/reflection/reflectionproperty/getdefaultvalue.xml create mode 100644 reference/reflection/reflectionproperty/getdoccomment.xml diff --git a/reference/reflection/reflectionclass/isiterateable.xml b/reference/reflection/reflectionclass/isiterateable.xml new file mode 100644 index 000000000..b9f4dc7bf --- /dev/null +++ b/reference/reflection/reflectionclass/isiterateable.xml @@ -0,0 +1,41 @@ + + + + + + + ReflectionClass::isIterateable + &Alias; ReflectionClass::isIterable + + + + &reftitle.description; + &Alias; ReflectionClass::isIterable + + Seit PHP 7.2.0 sollte anstelle der falsch geschriebenen Methode RefectionClass::isIterateable + die Methode ReflectionClass::isIterable bevorzugt werden. + + + + + + diff --git a/reference/reflection/reflectionmethod/construct.xml b/reference/reflection/reflectionmethod/construct.xml new file mode 100644 index 000000000..ed10e6432 --- /dev/null +++ b/reference/reflection/reflectionmethod/construct.xml @@ -0,0 +1,192 @@ + + + + + + ReflectionMethod::__construct + Erzeugt ein ReflectionMethod-Objekt + + + + &reftitle.description; + + public ReflectionMethod::__construct + objectstringobjectOrMethod + stringmethod + + Alternative Signatur (wird mit benannten Argumenten nicht unterstützt): + + public ReflectionMethod::__construct + stringclassMethod + + + + Die alternative Signatur ist seit PHP 8.4.0 veraltet; + stattdessen sollte ReflectionMethod::createFromMethodName + verwendet werden. + + + + Erzeugt eine neue ReflectionMethod. + + + + + + &reftitle.parameters; + + + + objectOrMethod + + + Klassenname oder Objekt (Instanz der Klasse), das die Methode enthält. + + + + + method + + + Name der Methode. + + + + + classMethod + + + Klassenname und Methodenname, getrennt durch ::. + + + + + + + + + &reftitle.errors; + + Es wird eine ReflectionException ausgelöst, wenn die angegebene Methode nicht existiert. + + + + + &reftitle.examples; + + + Beispiel für <methodname>ReflectionMethod::__construct</methodname> + + The %s%s%s%s%s%s%s method '%s' (which is %s)\n" . + " declared in %s\n" . + " lines %d to %d\n" . + " having the modifiers %d[%s]\n", + $method->isInternal() ? 'internal' : 'user-defined', + $method->isAbstract() ? ' abstract' : '', + $method->isFinal() ? ' final' : '', + $method->isPublic() ? ' public' : '', + $method->isPrivate() ? ' private' : '', + $method->isProtected() ? ' protected' : '', + $method->isStatic() ? ' static' : '', + $method->getName(), + $method->isConstructor() ? 'the constructor' : 'a regular method', + $method->getFileName(), + $method->getStartLine(), + $method->getEndline(), + $method->getModifiers(), + implode(' ', Reflection::getModifierNames($method->getModifiers())) +); + +// Doc-Kommentar ausgeben +printf("---> Documentation:\n %s\n", var_export($method->getDocComment(), true)); + +// Statische Variablen ausgeben, sofern vorhanden +if ($statics= $method->getStaticVariables()) { + printf("---> Static variables: %s\n", var_export($statics, true)); +} + +// Die Methode aufrufen +printf("---> Invocation results in: "); +var_dump($method->invoke(NULL)); +?> +]]> + + &example.outputs.similar; + + The user-defined final public static method 'increment' (which is a regular method) + declared in /Users/philip/cvs/phpdoc/test.php + lines 14 to 17 + having the modifiers 261[final public static] +---> Documentation: + '/** + * Increment counter + * + * @final + * @static + * @access public + * @return int + */' +---> Invocation results in: int(1) +]]> + + + + + + + &reftitle.seealso; + + + ReflectionMethod::export + Konstruktoren + + + + + + diff --git a/reference/reflection/reflectionproperty/getdefaultvalue.xml b/reference/reflection/reflectionproperty/getdefaultvalue.xml new file mode 100644 index 000000000..1f8ceb3c4 --- /dev/null +++ b/reference/reflection/reflectionproperty/getdefaultvalue.xml @@ -0,0 +1,124 @@ + + + + + + ReflectionProperty::getDefaultValue + Gibt den für eine Eigenschaft deklarierten Standardwert zurück + + + + &reftitle.description; + + public mixedReflectionProperty::getDefaultValue + + + + Ermittelt den implizit oder explizit deklarierten Standardwert einer Eigenschaft. + + + + + &reftitle.parameters; + &no.function.parameters; + + + + &reftitle.returnvalues; + + Der Standardwert, sofern die Eigenschaft einen Standardwert hat (einschließlich &null;). + Wenn es keinen Standardwert gibt, wird &null; zurückgegeben. Es ist nicht möglich, zwischen + einem Standardwert &null; und einer nicht initialisierten typisierten Eigenschaft zu unterscheiden. + Um den Unterschied zu erkennen, ist ReflectionProperty::hasDefaultValue zu verwenden. + + + + + &reftitle.changelog; + + + + + &Version; + &Description; + + + + + 8.5.0 + + Der Aufruf von ReflectionProperty::getDefaultValue + für Eigenschaften ohne Standardwert wurde als veraltet markiert. + + + + + + + + + &reftitle.examples; + + + Beispiel für <methodname>ReflectionProperty::getDefaultValue</methodname> + +getProperty('bar')->getDefaultValue()); +var_dump($ro->getProperty('baz')->getDefaultValue()); +var_dump($ro->getProperty('boing')->getDefaultValue()); +var_dump($ro->getProperty('bak')->getDefaultValue()); +?> +]]> + + &example.outputs; + + + + + + + + + &reftitle.seealso; + + + ReflectionProperty::hasDefaultValue + + + + + + diff --git a/reference/reflection/reflectionproperty/getdoccomment.xml b/reference/reflection/reflectionproperty/getdoccomment.xml new file mode 100644 index 000000000..161db65ce --- /dev/null +++ b/reference/reflection/reflectionproperty/getdoccomment.xml @@ -0,0 +1,131 @@ + + + + + + ReflectionProperty::getDocComment + Ermittelt den Doc-Kommentar einer Eigenschaft + + + + &reftitle.description; + + public stringfalseReflectionProperty::getDocComment + + + + Ermittelt den Doc-Kommentar einer Eigenschaft. + + + + + &reftitle.parameters; + &no.function.parameters; + + + + &reftitle.returnvalues; + + Der Doc-Kommentar, sofern er existiert, andernfalls &false;. + + + + + &reftitle.examples; + + + Beispiel für <methodname>ReflectionProperty::getDocComment</methodname> + +getDocComment()); + +?> +]]> + + &example.outputs.similar; + + + + + + + + + Mehrere Eigenschaftsdeklarationen + + Wenn mehreren Eigenschaftsdeklarationen ein einzelner Doc-Kommentar vorangestellt ist, + bezieht sich der Doc-Kommentar nur auf die erste Eigenschaft. + + +getProperties() as $property) { + echo $property->getName() . ': ' . var_export($property->getDocComment(), true) . PHP_EOL; +} +?> +]]> + + &example.outputs; + + + + + + + + + &reftitle.seealso; + + + ReflectionProperty::getModifiers + ReflectionProperty::getName + ReflectionProperty::getValue + + + + + +