Generate API documentation alpha

Cloud based service which generates API documentation for your GitHub based project using the great documentation generator ApiGen.

Status of WooCommerce (woothemes/woocommerce)

Command: php -dmemory_limit=1024M /var/www/projects/apigen/apigen/apigen.php -s '/var/www/projects/apigen/repos/woothemes/woocommerce/' -d '/var/www/projects/apigen/doc-progress/woothemes/woocommerce' --charset=auto --download --debug --colors=no --progressbar=yes
PHP Warning:  PHP Startup: Unable to load dynamic library '/usr/lib/php5/20131226/newrelic.so' - /usr/lib/php5/20131226/newrelic.so: cannot open shared object file: No such file or directory in Unknown on line 0
PHP Warning:  PHP Startup: Unable to load dynamic library '/usr/lib/php5/20131226/newrelic.so' - /usr/lib/php5/20131226/newrelic.so: cannot open shared object file: No such file or directory in Unknown on line 0
PHP Deprecated:  iconv_set_encoding(): Use of iconv.internal_encoding is deprecated in .../apigen/vendor/Nette/Nette/loader.php on line 30
ApiGen 3.0dev
-------------
Scanning .../repos/woothemes/woocommerce
[===============================================================>] 100.00% 148MB
Found 28 errors

1. There was an error processing the file .../repos/woothemes/woocommerce/includes/legacy/api/v1/class-wc-api-coupons.php.

There were following reasons for this exception:
Class WC_API_Coupons was redeclared (previously declared in file .../repos/woothemes/woocommerce/includes/legacy/api/v3/class-wc-api-coupons.php).

2. There was an error processing the file .../repos/woothemes/woocommerce/includes/legacy/api/v1/class-wc-api-orders.php.

There were following reasons for this exception:
Class WC_API_Orders was redeclared (previously declared in file .../repos/woothemes/woocommerce/includes/legacy/api/v3/class-wc-api-orders.php).

3. There was an error processing the file .../repos/woothemes/woocommerce/includes/legacy/api/v1/class-wc-api-customers.php.

There were following reasons for this exception:
Class WC_API_Customers was redeclared (previously declared in file .../repos/woothemes/woocommerce/includes/legacy/api/v3/class-wc-api-customers.php).

4. There was an error processing the file .../repos/woothemes/woocommerce/includes/legacy/api/v1/interface-wc-api-handler.php.

There were following reasons for this exception:
Class WC_API_Handler was redeclared (previously declared in file .../repos/woothemes/woocommerce/includes/legacy/api/v3/interface-wc-api-handler.php).

5. There was an error processing the file .../repos/woothemes/woocommerce/includes/legacy/api/v1/class-wc-api-products.php.

There were following reasons for this exception:
Class WC_API_Products was redeclared (previously declared in file .../repos/woothemes/woocommerce/includes/legacy/api/v3/class-wc-api-products.php).

6. There was an error processing the file .../repos/woothemes/woocommerce/includes/legacy/api/v1/class-wc-api-authentication.php.

There were following reasons for this exception:
Class WC_API_Authentication was redeclared (previously declared in file .../repos/woothemes/woocommerce/includes/legacy/api/v3/class-wc-api-authentication.php).

7. There was an error processing the file .../repos/woothemes/woocommerce/includes/legacy/api/v1/class-wc-api-server.php.

There were following reasons for this exception:
Class WC_API_Server was redeclared (previously declared in file .../repos/woothemes/woocommerce/includes/legacy/api/v3/class-wc-api-server.php).

8. There was an error processing the file .../repos/woothemes/woocommerce/includes/legacy/api/v1/class-wc-api-json-handler.php.

There were following reasons for this exception:
Class WC_API_JSON_Handler was redeclared (previously declared in file .../repos/woothemes/woocommerce/includes/legacy/api/v3/class-wc-api-json-handler.php).

9. There was an error processing the file .../repos/woothemes/woocommerce/includes/legacy/api/v1/class-wc-api-resource.php.

There were following reasons for this exception:
Class WC_API_Resource was redeclared (previously declared in file .../repos/woothemes/woocommerce/includes/legacy/api/v3/class-wc-api-resource.php).

10. There was an error processing the file .../repos/woothemes/woocommerce/includes/legacy/api/v1/class-wc-api-reports.php.

There were following reasons for this exception:
Class WC_API_Reports was redeclared (previously declared in file .../repos/woothemes/woocommerce/includes/legacy/api/v3/class-wc-api-reports.php).

11. There was an error processing the file .../repos/woothemes/woocommerce/includes/legacy/api/v2/class-wc-api-authentication.php.

There were following reasons for this exception:
Class WC_API_Authentication was redeclared (previously declared in file .../repos/woothemes/woocommerce/includes/legacy/api/v3/class-wc-api-authentication.php).

12. There was an error processing the file .../repos/woothemes/woocommerce/includes/legacy/api/v2/class-wc-api-json-handler.php.

There were following reasons for this exception:
Class WC_API_JSON_Handler was redeclared (previously declared in file .../repos/woothemes/woocommerce/includes/legacy/api/v3/class-wc-api-json-handler.php).

13. There was an error processing the file .../repos/woothemes/woocommerce/includes/legacy/api/v2/class-wc-api-webhooks.php.

There were following reasons for this exception:
Class WC_API_Webhooks was redeclared (previously declared in file .../repos/woothemes/woocommerce/includes/legacy/api/v3/class-wc-api-webhooks.php).

14. There was an error processing the file .../repos/woothemes/woocommerce/includes/legacy/api/v2/class-wc-api-orders.php.

There were following reasons for this exception:
Class WC_API_Orders was redeclared (previously declared in file .../repos/woothemes/woocommerce/includes/legacy/api/v3/class-wc-api-orders.php).

15. There was an error processing the file .../repos/woothemes/woocommerce/includes/legacy/api/v2/class-wc-api-reports.php.

There were following reasons for this exception:
Class WC_API_Reports was redeclared (previously declared in file .../repos/woothemes/woocommerce/includes/legacy/api/v3/class-wc-api-reports.php).

16. There was an error processing the file .../repos/woothemes/woocommerce/includes/legacy/api/v2/interface-wc-api-handler.php.

There were following reasons for this exception:
Class WC_API_Handler was redeclared (previously declared in file .../repos/woothemes/woocommerce/includes/legacy/api/v3/interface-wc-api-handler.php).

17. There was an error processing the file .../repos/woothemes/woocommerce/includes/legacy/api/v2/class-wc-api-resource.php.

There were following reasons for this exception:
Class WC_API_Resource was redeclared (previously declared in file .../repos/woothemes/woocommerce/includes/legacy/api/v3/class-wc-api-resource.php).

18. There was an error processing the file .../repos/woothemes/woocommerce/includes/legacy/api/v2/class-wc-api-server.php.

There were following reasons for this exception:
Class WC_API_Server was redeclared (previously declared in file .../repos/woothemes/woocommerce/includes/legacy/api/v3/class-wc-api-server.php).

19. There was an error processing the file .../repos/woothemes/woocommerce/includes/legacy/api/v2/class-wc-api-coupons.php.

There were following reasons for this exception:
Class WC_API_Coupons was redeclared (previously declared in file .../repos/woothemes/woocommerce/includes/legacy/api/v3/class-wc-api-coupons.php).

20. There was an error processing the file .../repos/woothemes/woocommerce/includes/legacy/api/v2/class-wc-api-products.php.

There were following reasons for this exception:
Class WC_API_Products was redeclared (previously declared in file .../repos/woothemes/woocommerce/includes/legacy/api/v3/class-wc-api-products.php).

21. There was an error processing the file .../repos/woothemes/woocommerce/includes/legacy/api/v2/class-wc-api-exception.php.

There were following reasons for this exception:
Class WC_API_Exception was redeclared (previously declared in file .../repos/woothemes/woocommerce/includes/legacy/api/v3/class-wc-api-exception.php).

22. There was an error processing the file .../repos/woothemes/woocommerce/includes/legacy/api/v2/class-wc-api-customers.php.

There were following reasons for this exception:
Class WC_API_Customers was redeclared (previously declared in file .../repos/woothemes/woocommerce/includes/legacy/api/v3/class-wc-api-customers.php).

23. The TokenReflection library threw an exception while parsing the file .../repos/woothemes/woocommerce/tests/Tools/CodeHacking/CodeHackerTestHook.php.

This can have two reasons: a) the source code in the file is not valid or b) you have just found a bug in the TokenReflection library.

If the license allows it please send the whole file or at least the following fragment describing where exacly is the problem along with the backtrace to apigen@apigen.org. Thank you!

The cause of the exception "Unexpected token found." was the : token (line 28) in the following part of Automattic\WooCommerce\Testing\Tools\CodeHacking\CodeHackerTestHook::executeBeforeTest() source code:

  1: <?php
  2: /**
  3:  * CodeHackerTestHook class file.
  4:  *
  5:  * @package WooCommerce\Testing
  6:  */
  7:
  8: namespace Automattic\WooCommerce\Testing\Tools\CodeHacking;
  9:
 10: use PHPUnit\Runner\BeforeTestHook;
 11:
 12: /**
 13:  * Helper to use the CodeHacker class in PHPUnit. To use, add this to phpunit.xml:
 14:  *
 15:  *    <extensions>
 16:  *      <extension class="CodeHackerTestHook" />
 17:  *    </extensions>
 18:  */
 19: final class CodeHackerTestHook implements BeforeTestHook {
 20:
 21: 	/**
 22: 	 * Runs before each test.
 23: 	 *
 24: 	 * @param string $test "TestClass::TestMethod".
 25: 	 *
 26: 	 * @throws \ReflectionException Thrown by execute_before_methods.
 27: 	 */
*28: 	public function executeBeforeTest( string $test ): void {
 29: 		CodeHacker::reset_hacks();
 30: 	}
 31: }
 32:
 33:

The exception backtrace is following:

#0 .../apigen/vendor/TokenReflection/TokenReflection/ReflectionFunctionBase.php(302): TokenReflection\ReflectionFunctionBase->parseStaticVariables(Object(TokenReflection\Stream\StringStream))
#1 .../apigen/vendor/TokenReflection/TokenReflection/ReflectionElement.php(122): TokenReflection\ReflectionFunctionBase->parseChildren(Object(TokenReflection\Stream\StringStream), Object(TokenReflection\ReflectionClass))
#2 .../apigen/vendor/TokenReflection/TokenReflection/ReflectionBase.php(73): TokenReflection\ReflectionElement->parseStream(Object(TokenReflection\Stream\StringStream), Object(TokenReflection\ReflectionClass))
#3 .../apigen/vendor/TokenReflection/TokenReflection/ReflectionElement.php(104): TokenReflection\ReflectionBase->__construct(Object(TokenReflection\Stream\StringStream), Object(TokenReflection\Broker), Object(TokenReflection\ReflectionClass))
#4 .../apigen/vendor/TokenReflection/TokenReflection/ReflectionClass.php(1839): TokenReflection\ReflectionElement->__construct(Object(TokenReflection\Stream\StringStream), Object(TokenReflection\Broker), Object(TokenReflection\ReflectionClass))
#5 .../apigen/vendor/TokenReflection/TokenReflection/ReflectionElement.php(122): TokenReflection\ReflectionClass->parseChildren(Object(TokenReflection\Stream\StringStream), Object(TokenReflection\ReflectionFileNamespace))
#6 .../apigen/vendor/TokenReflection/TokenReflection/ReflectionBase.php(73): TokenReflection\ReflectionElement->parseStream(Object(TokenReflection\Stream\StringStream), Object(TokenReflection\ReflectionFileNamespace))
#7 .../apigen/vendor/TokenReflection/TokenReflection/ReflectionElement.php(104): TokenReflection\ReflectionBase->__construct(Object(TokenReflection\Stream\StringStream), Object(TokenReflection\Broker), Object(TokenReflection\ReflectionFileNamespace))
#8 .../apigen/vendor/TokenReflection/TokenReflection/ReflectionFileNamespace.php(299): TokenReflection\ReflectionElement->__construct(Object(TokenReflection\Stream\StringStream), Object(TokenReflection\Broker), Object(TokenReflection\ReflectionFileNamespace))
#9 .../apigen/vendor/TokenReflection/TokenReflection/ReflectionElement.php(122): TokenReflection\ReflectionFileNamespace->parseChildren(Object(TokenReflection\Stream\StringStream), Object(TokenReflection\ReflectionFile))
#10 .../apigen/vendor/TokenReflection/TokenReflection/ReflectionBase.php(73): TokenReflection\ReflectionElement->parseStream(Object(TokenReflection\Stream\StringStream), Object(TokenReflection\ReflectionFile))
#11 .../apigen/vendor/TokenReflection/TokenReflection/ReflectionElement.php(104): TokenReflection\ReflectionBase->__construct(Object(TokenReflection\Stream\StringStream), Object(TokenReflection\Broker), Object(TokenReflection\ReflectionFile))
#12 .../apigen/vendor/TokenReflection/TokenReflection/ReflectionFile.php(130): TokenReflection\ReflectionElement->__construct(Object(TokenReflection\Stream\StringStream), Object(TokenReflection\Broker), Object(TokenReflection\ReflectionFile))
#13 .../apigen/vendor/TokenReflection/TokenReflection/ReflectionBase.php(73): TokenReflection\ReflectionFile->parseStream(Object(TokenReflection\Stream\StringStream), NULL)
#14 .../apigen/vendor/TokenReflection/TokenReflection/Broker.php(168): TokenReflection\ReflectionBase->__construct(Object(TokenReflection\Stream\StringStream), Object(TokenReflection\Broker))
#15 .../apigen/ApiGen/Generator.php(216): TokenReflection\Broker->processString('<?php\n/**\n * Co...', '/var/www/projec...')
#16 .../apigen/ApiGen/Application.php(125): ApiGen\Generator->parse()
#17 .../apigen/ApiGen/Application.php(84): ApiGen\Application->parse()
#18 .../apigen/apigen.php(50): ApiGen\Application->run()
#19 {main}

24. The TokenReflection library threw an exception while parsing the file .../repos/woothemes/woocommerce/tests/Tools/DependencyManagement/DependencyManagementTestHook.php.

This can have two reasons: a) the source code in the file is not valid or b) you have just found a bug in the TokenReflection library.

If the license allows it please send the whole file or at least the following fragment describing where exacly is the problem along with the backtrace to apigen@apigen.org. Thank you!

The cause of the exception "Unexpected token found." was the : token (line 27) in the following part of Automattic\WooCommerce\Testing\Tools\DependencyManagement\DependencyManagementTestHook::executeBeforeTest() source code:

  6:
  7:
  8: namespace Automattic\WooCommerce\Testing\Tools\DependencyManagement;
  9:
 10: use Automattic\WooCommerce\Proxies\LegacyProxy;
 11: use PHPUnit\Runner\BeforeTestHook;
 12:
 13: /**
 14:  * Hook to perform dependency management related setup in PHPUnit. To use, add this to phpunit.xml:
 15:  *
 16:  *    <extensions>
 17:  *      <extension class="DependencyManagementTestHook" />
 18:  *    </extensions>
 19:  */
 20: final class DependencyManagementTestHook implements BeforeTestHook {
 21:
 22: 	/**
 23: 	 * Runs before each test.
 24: 	 *
 25: 	 * @param string $test "TestClass::TestMethod".
 26: 	 */
*27: 	public function executeBeforeTest( string $test ): void {
 28: 		// Reset the instance of MockableLegacyProxy that was registered during bootstrap,
 29: 		// in order to start the test in a clean state (without anything mocked).
 30: 		wc_get_container()->get( LegacyProxy::class )->reset();
 31: 	}
 32: }
 33:
 34:

The exception backtrace is following:

#0 .../apigen/vendor/TokenReflection/TokenReflection/ReflectionFunctionBase.php(302): TokenReflection\ReflectionFunctionBase->parseStaticVariables(Object(TokenReflection\Stream\StringStream))
#1 .../apigen/vendor/TokenReflection/TokenReflection/ReflectionElement.php(122): TokenReflection\ReflectionFunctionBase->parseChildren(Object(TokenReflection\Stream\StringStream), Object(TokenReflection\ReflectionClass))
#2 .../apigen/vendor/TokenReflection/TokenReflection/ReflectionBase.php(73): TokenReflection\ReflectionElement->parseStream(Object(TokenReflection\Stream\StringStream), Object(TokenReflection\ReflectionClass))
#3 .../apigen/vendor/TokenReflection/TokenReflection/ReflectionElement.php(104): TokenReflection\ReflectionBase->__construct(Object(TokenReflection\Stream\StringStream), Object(TokenReflection\Broker), Object(TokenReflection\ReflectionClass))
#4 .../apigen/vendor/TokenReflection/TokenReflection/ReflectionClass.php(1839): TokenReflection\ReflectionElement->__construct(Object(TokenReflection\Stream\StringStream), Object(TokenReflection\Broker), Object(TokenReflection\ReflectionClass))
#5 .../apigen/vendor/TokenReflection/TokenReflection/ReflectionElement.php(122): TokenReflection\ReflectionClass->parseChildren(Object(TokenReflection\Stream\StringStream), Object(TokenReflection\ReflectionFileNamespace))
#6 .../apigen/vendor/TokenReflection/TokenReflection/ReflectionBase.php(73): TokenReflection\ReflectionElement->parseStream(Object(TokenReflection\Stream\StringStream), Object(TokenReflection\ReflectionFileNamespace))
#7 .../apigen/vendor/TokenReflection/TokenReflection/ReflectionElement.php(104): TokenReflection\ReflectionBase->__construct(Object(TokenReflection\Stream\StringStream), Object(TokenReflection\Broker), Object(TokenReflection\ReflectionFileNamespace))
#8 .../apigen/vendor/TokenReflection/TokenReflection/ReflectionFileNamespace.php(299): TokenReflection\ReflectionElement->__construct(Object(TokenReflection\Stream\StringStream), Object(TokenReflection\Broker), Object(TokenReflection\ReflectionFileNamespace))
#9 .../apigen/vendor/TokenReflection/TokenReflection/ReflectionElement.php(122): TokenReflection\ReflectionFileNamespace->parseChildren(Object(TokenReflection\Stream\StringStream), Object(TokenReflection\ReflectionFile))
#10 .../apigen/vendor/TokenReflection/TokenReflection/ReflectionBase.php(73): TokenReflection\ReflectionElement->parseStream(Object(TokenReflection\Stream\StringStream), Object(TokenReflection\ReflectionFile))
#11 .../apigen/vendor/TokenReflection/TokenReflection/ReflectionElement.php(104): TokenReflection\ReflectionBase->__construct(Object(TokenReflection\Stream\StringStream), Object(TokenReflection\Broker), Object(TokenReflection\ReflectionFile))
#12 .../apigen/vendor/TokenReflection/TokenReflection/ReflectionFile.php(130): TokenReflection\ReflectionElement->__construct(Object(TokenReflection\Stream\StringStream), Object(TokenReflection\Broker), Object(TokenReflection\ReflectionFile))
#13 .../apigen/vendor/TokenReflection/TokenReflection/ReflectionBase.php(73): TokenReflection\ReflectionFile->parseStream(Object(TokenReflection\Stream\StringStream), NULL)
#14 .../apigen/vendor/TokenReflection/TokenReflection/Broker.php(168): TokenReflection\ReflectionBase->__construct(Object(TokenReflection\Stream\StringStream), Object(TokenReflection\Broker))
#15 .../apigen/ApiGen/Generator.php(216): TokenReflection\Broker->processString('<?php\n/**\n * De...', '/var/www/projec...')
#16 .../apigen/ApiGen/Application.php(125): ApiGen\Generator->parse()
#17 .../apigen/ApiGen/Application.php(84): ApiGen\Application->parse()
#18 .../apigen/apigen.php(50): ApiGen\Application->run()
#19 {main}

25. The TokenReflection library threw an exception while parsing the file .../repos/woothemes/woocommerce/src/Internal/DependencyManagement/AbstractServiceProvider.php.

This can have two reasons: a) the source code in the file is not valid or b) you have just found a bug in the TokenReflection library.

If the license allows it please send the whole file or at least the following fragment describing where exacly is the problem along with the backtrace to apigen@apigen.org. Thank you!

The cause of the exception "Unexpected token found." was the : token (line 36) in the following part of Automattic\WooCommerce\Internal\DependencyManagement\AbstractServiceProvider::add_with_auto_arguments() source code:

  4:
  5:
  6: namespace Automattic\WooCommerce\Internal\DependencyManagement;
  7:
  8: use League\Container\Argument\RawArgument;
  9: use League\Container\Definition\DefinitionInterface;
 10:
 11: /**
 12:  * Base class for the service providers used to register classes in the container.
 13:  *
 14:  * See the documentation of the original class this one is based on (https://container.thephpleague.com/3.x/service-providers)
 15:  * for basic usage details. What this class adds is:
 16:  *
 17:  * - The `add_with_auto_arguments` method that allows to register classes without having to specify the injection method arguments.
 18:  * - The `share_with_auto_arguments` method, sibling of the above.
 19:  * - Convenience `add` and `share` methods that are just proxies for the same methods in `$this->getContainer()`.
 20:  */
 21: abstract class AbstractServiceProvider extends \League\Container\ServiceProvider\AbstractServiceProvider {
 22:
 23: 	/**
 24: 	 * Register a class in the container and use reflection to guess the injection method arguments.
 25: 	 *
 26: 	 * WARNING: this method uses reflection, so please have performance in mind when using it.
 27: 	 *
 28: 	 * @param string $class_name Class name to register.
 29: 	 * @param mixed  $concrete   The concrete to register. Can be a shared instance, a factory callback, or a class name.
 30: 	 * @param bool   $shared Whether to register the class as shared (`get` always returns the same instance) or not.
 31: 	 *
 32: 	 * @return DefinitionInterface The generated container definition.
 33: 	 *
 34: 	 * @throws ContainerException Error when reflecting the class, or class injection method is not public, or an argument has no valid type hint.
 35: 	 */
*36: 	protected function add_with_auto_arguments( string $class_name, $concrete = null, bool $shared = false ) : DefinitionInterface {
 37: 		$definition = new Definition( $class_name, $concrete );
 38:
 39: 		$function = $this->reflect_class_or_callable( $class_name, $concrete );
 40:
 41: 		if ( ! is_null( $function ) ) {
 42: 			$arguments = $function->getParameters();
 43: 			foreach

The exception backtrace is following:

#0 .../apigen/vendor/TokenReflection/TokenReflection/ReflectionFunctionBase.php(302): TokenReflection\ReflectionFunctionBase->parseStaticVariables(Object(TokenReflection\Stream\StringStream))
#1 .../apigen/vendor/TokenReflection/TokenReflection/ReflectionElement.php(122): TokenReflection\ReflectionFunctionBase->parseChildren(Object(TokenReflection\Stream\StringStream), Object(TokenReflection\ReflectionClass))
#2 .../apigen/vendor/TokenReflection/TokenReflection/ReflectionBase.php(73): TokenReflection\ReflectionElement->parseStream(Object(TokenReflection\Stream\StringStream), Object(TokenReflection\ReflectionClass))
#3 .../apigen/vendor/TokenReflection/TokenReflection/ReflectionElement.php(104): TokenReflection\ReflectionBase->__construct(Object(TokenReflection\Stream\StringStream), Object(TokenReflection\Broker), Object(TokenReflection\ReflectionClass))
#4 .../apigen/vendor/TokenReflection/TokenReflection/ReflectionClass.php(1839): TokenReflection\ReflectionElement->__construct(Object(TokenReflection\Stream\StringStream), Object(TokenReflection\Broker), Object(TokenReflection\ReflectionClass))
#5 .../apigen/vendor/TokenReflection/TokenReflection/ReflectionElement.php(122): TokenReflection\ReflectionClass->parseChildren(Object(TokenReflection\Stream\StringStream), Object(TokenReflection\ReflectionFileNamespace))
#6 .../apigen/vendor/TokenReflection/TokenReflection/ReflectionBase.php(73): TokenReflection\ReflectionElement->parseStream(Object(TokenReflection\Stream\StringStream), Object(TokenReflection\ReflectionFileNamespace))
#7 .../apigen/vendor/TokenReflection/TokenReflection/ReflectionElement.php(104): TokenReflection\ReflectionBase->__construct(Object(TokenReflection\Stream\StringStream), Object(TokenReflection\Broker), Object(TokenReflection\ReflectionFileNamespace))
#8 .../apigen/vendor/TokenReflection/TokenReflection/ReflectionFileNamespace.php(299): TokenReflection\ReflectionElement->__construct(Object(TokenReflection\Stream\StringStream), Object(TokenReflection\Broker), Object(TokenReflection\ReflectionFileNamespace))
#9 .../apigen/vendor/TokenReflection/TokenReflection/ReflectionElement.php(122): TokenReflection\ReflectionFileNamespace->parseChildren(Object(TokenReflection\Stream\StringStream), Object(TokenReflection\ReflectionFile))
#10 .../apigen/vendor/TokenReflection/TokenReflection/ReflectionBase.php(73): TokenReflection\ReflectionElement->parseStream(Object(TokenReflection\Stream\StringStream), Object(TokenReflection\ReflectionFile))
#11 .../apigen/vendor/TokenReflection/TokenReflection/ReflectionElement.php(104): TokenReflection\ReflectionBase->__construct(Object(TokenReflection\Stream\StringStream), Object(TokenReflection\Broker), Object(TokenReflection\ReflectionFile))
#12 .../apigen/vendor/TokenReflection/TokenReflection/ReflectionFile.php(130): TokenReflection\ReflectionElement->__construct(Object(TokenReflection\Stream\StringStream), Object(TokenReflection\Broker), Object(TokenReflection\ReflectionFile))
#13 .../apigen/vendor/TokenReflection/TokenReflection/ReflectionBase.php(73): TokenReflection\ReflectionFile->parseStream(Object(TokenReflection\Stream\StringStream), NULL)
#14 .../apigen/vendor/TokenReflection/TokenReflection/Broker.php(168): TokenReflection\ReflectionBase->__construct(Object(TokenReflection\Stream\StringStream), Object(TokenReflection\Broker))
#15 .../apigen/ApiGen/Generator.php(216): TokenReflection\Broker->processString('<?php\n/**\n * Ab...', '/var/www/projec...')
#16 .../apigen/ApiGen/Application.php(125): ApiGen\Generator->parse()
#17 .../apigen/ApiGen/Application.php(84): ApiGen\Application->parse()
#18 .../apigen/apigen.php(50): ApiGen\Application->run()
#19 {main}

26. The TokenReflection library threw an exception while parsing the file .../repos/woothemes/woocommerce/src/Internal/DependencyManagement/ExtendedContainer.php.

This can have two reasons: a) the source code in the file is not valid or b) you have just found a bug in the TokenReflection library.

If the license allows it please send the whole file or at least the following fragment describing where exacly is the problem along with the backtrace to apigen@apigen.org. Thank you!

The cause of the exception "Unexpected token found." was the : token (line 51) in the following part of Automattic\WooCommerce\Internal\DependencyManagement\ExtendedContainer::add() source code:

 22:
 23: 	private $woocommerce_namespace = 'Automattic\\WooCommerce\\';
 24:
 25: 	/**
 26: 	 * Whitelist of classes that we can register using the container
 27: 	 * despite not belonging to the WooCommerce root namespace.
 28: 	 *
 29: 	 * In general we allow only the registration of classes in the
 30: 	 * WooCommerce root namespace to prevent registering 3rd party code
 31: 	 * (which doesn't really belong to this container) or old classes
 32: 	 * (which may be eventually deprecated, also the LegacyProxy
 33: 	 * should be used for those).
 34: 	 *
 35: 	 * @var string[]
 36: 	 */
 37: 	private $registration_whitelist = array(
 38: 		\Psr\Container\ContainerInterface::class,
 39: 	);
 40:
 41: 	/**
 42: 	 * Register a class in the container.
 43: 	 *
 44: 	 * @param string    $class_name Class name.
 45: 	 * @param mixed     $concrete How to resolve the class with `get`: a factory callback, a concrete instance, another class name, or null to just create an instance of the class.
 46: 	 * @param bool|null $shared Whether the resolution should be performed only once and cached.
 47: 	 *
 48: 	 * @return DefinitionInterface The generated definition for the container.
 49: 	 * @throws ContainerException Invalid parameters.
 50: 	 */
*51: 	public function add( string $class_name, $concrete = null, bool $shared = null ) : DefinitionInterface {
 52: 		if ( ! $this->is_class_allowed( $class_name ) ) {
 53: 			throw new ContainerException( "You cannot add '$class_name', only classes in the {$this->woocommerce_namespace} namespace are allowed." );
 54: 		}
 55:
 56: 		$concrete_class = $this->get_class_from_concrete( $concrete );
 57: 		if

The exception backtrace is following:

#0 .../apigen/vendor/TokenReflection/TokenReflection/ReflectionFunctionBase.php(302): TokenReflection\ReflectionFunctionBase->parseStaticVariables(Object(TokenReflection\Stream\StringStream))
#1 .../apigen/vendor/TokenReflection/TokenReflection/ReflectionElement.php(122): TokenReflection\ReflectionFunctionBase->parseChildren(Object(TokenReflection\Stream\StringStream), Object(TokenReflection\ReflectionClass))
#2 .../apigen/vendor/TokenReflection/TokenReflection/ReflectionBase.php(73): TokenReflection\ReflectionElement->parseStream(Object(TokenReflection\Stream\StringStream), Object(TokenReflection\ReflectionClass))
#3 .../apigen/vendor/TokenReflection/TokenReflection/ReflectionElement.php(104): TokenReflection\ReflectionBase->__construct(Object(TokenReflection\Stream\StringStream), Object(TokenReflection\Broker), Object(TokenReflection\ReflectionClass))
#4 .../apigen/vendor/TokenReflection/TokenReflection/ReflectionClass.php(1839): TokenReflection\ReflectionElement->__construct(Object(TokenReflection\Stream\StringStream), Object(TokenReflection\Broker), Object(TokenReflection\ReflectionClass))
#5 .../apigen/vendor/TokenReflection/TokenReflection/ReflectionElement.php(122): TokenReflection\ReflectionClass->parseChildren(Object(TokenReflection\Stream\StringStream), Object(TokenReflection\ReflectionFileNamespace))
#6 .../apigen/vendor/TokenReflection/TokenReflection/ReflectionBase.php(73): TokenReflection\ReflectionElement->parseStream(Object(TokenReflection\Stream\StringStream), Object(TokenReflection\ReflectionFileNamespace))
#7 .../apigen/vendor/TokenReflection/TokenReflection/ReflectionElement.php(104): TokenReflection\ReflectionBase->__construct(Object(TokenReflection\Stream\StringStream), Object(TokenReflection\Broker), Object(TokenReflection\ReflectionFileNamespace))
#8 .../apigen/vendor/TokenReflection/TokenReflection/ReflectionFileNamespace.php(299): TokenReflection\ReflectionElement->__construct(Object(TokenReflection\Stream\StringStream), Object(TokenReflection\Broker), Object(TokenReflection\ReflectionFileNamespace))
#9 .../apigen/vendor/TokenReflection/TokenReflection/ReflectionElement.php(122): TokenReflection\ReflectionFileNamespace->parseChildren(Object(TokenReflection\Stream\StringStream), Object(TokenReflection\ReflectionFile))
#10 .../apigen/vendor/TokenReflection/TokenReflection/ReflectionBase.php(73): TokenReflection\ReflectionElement->parseStream(Object(TokenReflection\Stream\StringStream), Object(TokenReflection\ReflectionFile))
#11 .../apigen/vendor/TokenReflection/TokenReflection/ReflectionElement.php(104): TokenReflection\ReflectionBase->__construct(Object(TokenReflection\Stream\StringStream), Object(TokenReflection\Broker), Object(TokenReflection\ReflectionFile))
#12 .../apigen/vendor/TokenReflection/TokenReflection/ReflectionFile.php(130): TokenReflection\ReflectionElement->__construct(Object(TokenReflection\Stream\StringStream), Object(TokenReflection\Broker), Object(TokenReflection\ReflectionFile))
#13 .../apigen/vendor/TokenReflection/TokenReflection/ReflectionBase.php(73): TokenReflection\ReflectionFile->parseStream(Object(TokenReflection\Stream\StringStream), NULL)
#14 .../apigen/vendor/TokenReflection/TokenReflection/Broker.php(168): TokenReflection\ReflectionBase->__construct(Object(TokenReflection\Stream\StringStream), Object(TokenReflection\Broker))
#15 .../apigen/ApiGen/Generator.php(216): TokenReflection\Broker->processString('<?php\n/**\n * Ex...', '/var/www/projec...')
#16 .../apigen/ApiGen/Application.php(125): ApiGen\Generator->parse()
#17 .../apigen/ApiGen/Application.php(84): ApiGen\Application->parse()
#18 .../apigen/apigen.php(50): ApiGen\Application->run()
#19 {main}

27. The TokenReflection library threw an exception while parsing the file .../repos/woothemes/woocommerce/src/Utilities/StringUtil.php.

This can have two reasons: a) the source code in the file is not valid or b) you have just found a bug in the TokenReflection library.

If the license allows it please send the whole file or at least the following fragment describing where exacly is the problem along with the backtrace to apigen@apigen.org. Thank you!

The cause of the exception "Unexpected token found." was the : token (line 22) in the following part of Automattic\WooCommerce\Utilities\StringUtil::starts_with() source code:

  1: <?php
  2: /**
  3:  * A class of utilities for dealing with strings.
  4:  */
  5:
  6: namespace Automattic\WooCommerce\Utilities;
  7:
  8: /**
  9:  * A class of utilities for dealing with strings.
 10:  */
 11: final class StringUtil {
 12:
 13: 	/**
 14: 	 * Checks to see whether or not a string starts with another.
 15: 	 *
 16: 	 * @param string $string The string we want to check.
 17: 	 * @param string $starts_with The string we're looking for at the start of $string.
 18: 	 * @param bool   $case_sensitive Indicates whether the comparison should be case-sensitive.
 19: 	 *
 20: 	 * @return bool True if the $string starts with $starts_with, false otherwise.
 21: 	 */
*22: 	public static function starts_with( string $string, string $starts_with, bool $case_sensitive = true ): bool {
 23: 		$len = strlen( $starts_with );
 24: 		if ( $len > strlen( $string ) ) {
 25: 			return false;
 26: 		}
 27:
 28: 		$string

The exception backtrace is following:

#0 .../apigen/vendor/TokenReflection/TokenReflection/ReflectionFunctionBase.php(302): TokenReflection\ReflectionFunctionBase->parseStaticVariables(Object(TokenReflection\Stream\StringStream))
#1 .../apigen/vendor/TokenReflection/TokenReflection/ReflectionElement.php(122): TokenReflection\ReflectionFunctionBase->parseChildren(Object(TokenReflection\Stream\StringStream), Object(TokenReflection\ReflectionClass))
#2 .../apigen/vendor/TokenReflection/TokenReflection/ReflectionBase.php(73): TokenReflection\ReflectionElement->parseStream(Object(TokenReflection\Stream\StringStream), Object(TokenReflection\ReflectionClass))
#3 .../apigen/vendor/TokenReflection/TokenReflection/ReflectionElement.php(104): TokenReflection\ReflectionBase->__construct(Object(TokenReflection\Stream\StringStream), Object(TokenReflection\Broker), Object(TokenReflection\ReflectionClass))
#4 .../apigen/vendor/TokenReflection/TokenReflection/ReflectionClass.php(1839): TokenReflection\ReflectionElement->__construct(Object(TokenReflection\Stream\StringStream), Object(TokenReflection\Broker), Object(TokenReflection\ReflectionClass))
#5 .../apigen/vendor/TokenReflection/TokenReflection/ReflectionElement.php(122): TokenReflection\ReflectionClass->parseChildren(Object(TokenReflection\Stream\StringStream), Object(TokenReflection\ReflectionFileNamespace))
#6 .../apigen/vendor/TokenReflection/TokenReflection/ReflectionBase.php(73): TokenReflection\ReflectionElement->parseStream(Object(TokenReflection\Stream\StringStream), Object(TokenReflection\ReflectionFileNamespace))
#7 .../apigen/vendor/TokenReflection/TokenReflection/ReflectionElement.php(104): TokenReflection\ReflectionBase->__construct(Object(TokenReflection\Stream\StringStream), Object(TokenReflection\Broker), Object(TokenReflection\ReflectionFileNamespace))
#8 .../apigen/vendor/TokenReflection/TokenReflection/ReflectionFileNamespace.php(299): TokenReflection\ReflectionElement->__construct(Object(TokenReflection\Stream\StringStream), Object(TokenReflection\Broker), Object(TokenReflection\ReflectionFileNamespace))
#9 .../apigen/vendor/TokenReflection/TokenReflection/ReflectionElement.php(122): TokenReflection\ReflectionFileNamespace->parseChildren(Object(TokenReflection\Stream\StringStream), Object(TokenReflection\ReflectionFile))
#10 .../apigen/vendor/TokenReflection/TokenReflection/ReflectionBase.php(73): TokenReflection\ReflectionElement->parseStream(Object(TokenReflection\Stream\StringStream), Object(TokenReflection\ReflectionFile))
#11 .../apigen/vendor/TokenReflection/TokenReflection/ReflectionElement.php(104): TokenReflection\ReflectionBase->__construct(Object(TokenReflection\Stream\StringStream), Object(TokenReflection\Broker), Object(TokenReflection\ReflectionFile))
#12 .../apigen/vendor/TokenReflection/TokenReflection/ReflectionFile.php(130): TokenReflection\ReflectionElement->__construct(Object(TokenReflection\Stream\StringStream), Object(TokenReflection\Broker), Object(TokenReflection\ReflectionFile))
#13 .../apigen/vendor/TokenReflection/TokenReflection/ReflectionBase.php(73): TokenReflection\ReflectionFile->parseStream(Object(TokenReflection\Stream\StringStream), NULL)
#14 .../apigen/vendor/TokenReflection/TokenReflection/Broker.php(168): TokenReflection\ReflectionBase->__construct(Object(TokenReflection\Stream\StringStream), Object(TokenReflection\Broker))
#15 .../apigen/ApiGen/Generator.php(216): TokenReflection\Broker->processString('<?php\n/**\n * A ...', '/var/www/projec...')
#16 .../apigen/ApiGen/Application.php(125): ApiGen\Generator->parse()
#17 .../apigen/ApiGen/Application.php(84): ApiGen\Application->parse()
#18 .../apigen/apigen.php(50): ApiGen\Application->run()
#19 {main}

28. The TokenReflection library threw an exception while parsing the file .../repos/woothemes/woocommerce/woocommerce.php.

This can have two reasons: a) the source code in the file is not valid or b) you have just found a bug in the TokenReflection library.

If the license allows it please send the whole file or at least the following fragment describing where exacly is the problem along with the backtrace to apigen@apigen.org. Thank you!

The cause of the exception "Unexpected token found." was the : token (line 56) in the following part of wc_get_container() source code:

 37: // Initialize dependency injection.
 38: $GLOBALS['wc_container'] = new Automattic\WooCommerce\Container();
 39:
 40: /**
 41:  * Returns the main instance of WC.
 42:  *
 43:  * @since  2.1
 44:  * @return WooCommerce
 45:  */
 46: function WC() { // phpcs:ignore WordPress.NamingConventions.ValidFunctionName.FunctionNameInvalid
 47: 	return WooCommerce::instance();
 48: }
 49:
 50: /**
 51:  * Returns the WooCommerce PSR11-compatible object container.
 52:  * Code in the `includes` directory should use the container to get instances of classes in the `src` directory.
 53:  *
 54:  * @return \Psr\Container\ContainerInterface The WooCommerce PSR11 container.
 55:  */
*56: function wc_get_container() : \Psr\Container\ContainerInterface {
 57: 	return $GLOBALS['wc_container'];
 58: }
 59:
 60: // Global for backwards compatibility.
 61: $GLOBALS['woocommerce'] = WC();
 62:

The exception backtrace is following:

#0 .../apigen/vendor/TokenReflection/TokenReflection/ReflectionFunctionBase.php(302): TokenReflection\ReflectionFunctionBase->parseStaticVariables(Object(TokenReflection\Stream\StringStream))
#1 .../apigen/vendor/TokenReflection/TokenReflection/ReflectionElement.php(122): TokenReflection\ReflectionFunctionBase->parseChildren(Object(TokenReflection\Stream\StringStream), Object(TokenReflection\ReflectionFileNamespace))
#2 .../apigen/vendor/TokenReflection/TokenReflection/ReflectionBase.php(73): TokenReflection\ReflectionElement->parseStream(Object(TokenReflection\Stream\StringStream), Object(TokenReflection\ReflectionFileNamespace))
#3 .../apigen/vendor/TokenReflection/TokenReflection/ReflectionElement.php(104): TokenReflection\ReflectionBase->__construct(Object(TokenReflection\Stream\StringStream), Object(TokenReflection\Broker), Object(TokenReflection\ReflectionFileNamespace))
#4 .../apigen/vendor/TokenReflection/TokenReflection/ReflectionFileNamespace.php(378): TokenReflection\ReflectionElement->__construct(Object(TokenReflection\Stream\StringStream), Object(TokenReflection\Broker), Object(TokenReflection\ReflectionFileNamespace))
#5 .../apigen/vendor/TokenReflection/TokenReflection/ReflectionElement.php(122): TokenReflection\ReflectionFileNamespace->parseChildren(Object(TokenReflection\Stream\StringStream), Object(TokenReflection\ReflectionFile))
#6 .../apigen/vendor/TokenReflection/TokenReflection/ReflectionBase.php(73): TokenReflection\ReflectionElement->parseStream(Object(TokenReflection\Stream\StringStream), Object(TokenReflection\ReflectionFile))
#7 .../apigen/vendor/TokenReflection/TokenReflection/ReflectionElement.php(104): TokenReflection\ReflectionBase->__construct(Object(TokenReflection\Stream\StringStream), Object(TokenReflection\Broker), Object(TokenReflection\ReflectionFile))
#8 .../apigen/vendor/TokenReflection/TokenReflection/ReflectionFile.php(121): TokenReflection\ReflectionElement->__construct(Object(TokenReflection\Stream\StringStream), Object(TokenReflection\Broker), Object(TokenReflection\ReflectionFile))
#9 .../apigen/vendor/TokenReflection/TokenReflection/ReflectionBase.php(73): TokenReflection\ReflectionFile->parseStream(Object(TokenReflection\Stream\StringStream), NULL)
#10 .../apigen/vendor/TokenReflection/TokenReflection/Broker.php(168): TokenReflection\ReflectionBase->__construct(Object(TokenReflection\Stream\StringStream), Object(TokenReflection\Broker))
#11 .../apigen/ApiGen/Generator.php(216): TokenReflection\Broker->processString('<?php\n/**\n * Pl...', '/var/www/projec...')
#12 .../apigen/ApiGen/Application.php(125): ApiGen\Generator->parse()
#13 .../apigen/ApiGen/Application.php(84): ApiGen\Application->parse()
#14 .../apigen/apigen.php(50): ApiGen\Application->run()
#15 {main}

Found 684 classes, 0 constants, 870 functions and other 10 used PHP internal classes
Documentation for 673 classes, 0 constants, 762 functions and other 10 used PHP internal classes will be generated
Generating to directory .../doc-progress/woothemes/woocommerce
[===============================================================>] 100.00% 320MB
Done. Total time: 7 min 55 sec, used: 323 MB RAM