|
| 1 | +<?xml version="1.0" encoding="utf-8"?> |
| 2 | +<!-- $Revision$ --> |
| 3 | +<refentry xml:id="reflectiongenerator.isclosed" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink"> |
| 4 | + <refnamediv> |
| 5 | + <refname>ReflectionGenerator::isClosed</refname> |
| 6 | + <refpurpose>Checks if execution finished</refpurpose> |
| 7 | + </refnamediv> |
| 8 | + |
| 9 | + <refsect1 role="description"> |
| 10 | + &reftitle.description; |
| 11 | + <methodsynopsis role="ReflectionGenerator"> |
| 12 | + <modifier>public</modifier> <type>bool</type><methodname>ReflectionGenerator::isClosed</methodname> |
| 13 | + <void/> |
| 14 | + </methodsynopsis> |
| 15 | + <simpara> |
| 16 | + Returns whether the execution reached the end of the function, a return statement or if an exception was thrown. |
| 17 | + </simpara> |
| 18 | + </refsect1> |
| 19 | + |
| 20 | + <refsect1 role="parameters"> |
| 21 | + &reftitle.parameters; |
| 22 | + &no.function.parameters; |
| 23 | + </refsect1> |
| 24 | + |
| 25 | + <refsect1 role="returnvalues"> |
| 26 | + &reftitle.returnvalues; |
| 27 | + <simpara> |
| 28 | + Returns whether the generator finished executing. |
| 29 | + </simpara> |
| 30 | + </refsect1> |
| 31 | + |
| 32 | + <refsect1 role="examples"> |
| 33 | + &reftitle.examples; |
| 34 | + <example> |
| 35 | + <title><methodname>ReflectionGenerator::isClosed</methodname> example</title> |
| 36 | + <programlisting role="php"> |
| 37 | +<![CDATA[ |
| 38 | +<?php |
| 39 | +
|
| 40 | +function gen() |
| 41 | +{ |
| 42 | + yield 'a'; |
| 43 | + yield 'a'; |
| 44 | +} |
| 45 | +
|
| 46 | +$gen = gen(); |
| 47 | +$reflectionGen = new ReflectionGenerator($gen); |
| 48 | +
|
| 49 | +foreach ($gen as $value) { |
| 50 | + echo $value, PHP_EOL; |
| 51 | + var_dump($reflectionGen->isClosed()); |
| 52 | +} |
| 53 | +
|
| 54 | +var_dump($reflectionGen->isClosed()); |
| 55 | +
|
| 56 | +?> |
| 57 | +]]> |
| 58 | + </programlisting> |
| 59 | + &example.outputs; |
| 60 | + <screen> |
| 61 | +<![CDATA[ |
| 62 | +a |
| 63 | +bool(false) |
| 64 | +a |
| 65 | +bool(false) |
| 66 | +bool(true) |
| 67 | +]]> |
| 68 | + </screen> |
| 69 | + </example> |
| 70 | + </refsect1> |
| 71 | + |
| 72 | +</refentry> |
| 73 | +<!-- Keep this comment at the end of the file |
| 74 | +Local variables: |
| 75 | +mode: sgml |
| 76 | +sgml-omittag:t |
| 77 | +sgml-shorttag:t |
| 78 | +sgml-minimize-attributes:nil |
| 79 | +sgml-always-quote-attributes:t |
| 80 | +sgml-indent-step:1 |
| 81 | +sgml-indent-data:t |
| 82 | +indent-tabs-mode:nil |
| 83 | +sgml-parent-document:nil |
| 84 | +sgml-default-dtd-file:"~/.phpdoc/manual.ced" |
| 85 | +sgml-exposed-tags:nil |
| 86 | +sgml-local-catalogs:nil |
| 87 | +sgml-local-ecat-files:nil |
| 88 | +End: |
| 89 | +vim600: syn=xml fen fdm=syntax fdl=2 si |
| 90 | +vim: et tw=78 syn=sgml |
| 91 | +vi: ts=1 sw=1 |
| 92 | +--> |
0 commit comments