Skip to content

Commit

Permalink
updated ApiGen to 2.6.1
Browse files Browse the repository at this point in the history
  • Loading branch information
dg committed May 16, 2012
1 parent 4eb6346 commit 8537107
Show file tree
Hide file tree
Showing 84 changed files with 165 additions and 157 deletions.
16 changes: 10 additions & 6 deletions tools/ApiGen/ApiGen/Backend.php
@@ -1,7 +1,7 @@
<?php

/**
* ApiGen 2.6.0 - API documentation generator for PHP 5.3+
* ApiGen 2.6.1 - API documentation generator for PHP 5.3+
*
* Copyright (c) 2010-2011 David Grudl (http://davidgrudl.com)
* Copyright (c) 2011-2012 Jaroslav Hanslík (https://github.com/kukulich)
Expand All @@ -13,7 +13,7 @@

namespace ApiGen;

use TokenReflection, TokenReflection\IReflectionConstant, TokenReflection\IReflectionFunction, TokenReflection\Broker;
use TokenReflection, TokenReflection\IReflectionConstant, TokenReflection\IReflectionFunction, TokenReflection\Broker, TokenReflection\Resolver;
use InvalidArgumentException, RuntimeException;

/**
Expand Down Expand Up @@ -179,8 +179,10 @@ protected function parseClassLists()

foreach ($annotations['var'] as $doc) {
foreach (explode('|', preg_replace('~\\s.*~', '', $doc)) as $name) {
$name = rtrim($name, '[]');
$allClasses = $this->addClass($declared, $allClasses, $name);
if ($name = rtrim($name, '[]')) {
$name = Resolver::resolveClassFQN($name, $class->getNamespaceAliases(), $class->getNamespaceName());
$allClasses = $this->addClass($declared, $allClasses, $name);
}
}
}
}
Expand Down Expand Up @@ -221,8 +223,10 @@ private function processFunction(array $declared, array $allClasses, $function)

foreach ($annotations[$annotation] as $doc) {
foreach (explode('|', preg_replace('~\\s.*~', '', $doc)) as $name) {
$name = rtrim($name, '[]');
$allClasses = $this->addClass($declared, $allClasses, $name);
if ($name) {
$name = Resolver::resolveClassFQN(rtrim($name, '[]'), $function->getNamespaceAliases(), $function->getNamespaceName());
$allClasses = $this->addClass($declared, $allClasses, $name);
}
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion tools/ApiGen/ApiGen/Config.php
@@ -1,7 +1,7 @@
<?php

/**
* ApiGen 2.6.0 - API documentation generator for PHP 5.3+
* ApiGen 2.6.1 - API documentation generator for PHP 5.3+
*
* Copyright (c) 2010-2011 David Grudl (http://davidgrudl.com)
* Copyright (c) 2011-2012 Jaroslav Hanslík (https://github.com/kukulich)
Expand Down
2 changes: 1 addition & 1 deletion tools/ApiGen/ApiGen/ConfigException.php
@@ -1,7 +1,7 @@
<?php

/**
* ApiGen 2.6.0 - API documentation generator for PHP 5.3+
* ApiGen 2.6.1 - API documentation generator for PHP 5.3+
*
* Copyright (c) 2010-2011 David Grudl (http://davidgrudl.com)
* Copyright (c) 2011-2012 Jaroslav Hanslík (https://github.com/kukulich)
Expand Down
16 changes: 10 additions & 6 deletions tools/ApiGen/ApiGen/Generator.php
@@ -1,7 +1,7 @@
<?php

/**
* ApiGen 2.6.0 - API documentation generator for PHP 5.3+
* ApiGen 2.6.1 - API documentation generator for PHP 5.3+
*
* Copyright (c) 2010-2011 David Grudl (http://davidgrudl.com)
* Copyright (c) 2011-2012 Jaroslav Hanslík (https://github.com/kukulich)
Expand Down Expand Up @@ -34,7 +34,7 @@ class Generator extends Nette\Object
*
* @var string
*/
const VERSION = '2.6.0';
const VERSION = '2.6.1';

/**
* Configuration.
Expand Down Expand Up @@ -1438,9 +1438,10 @@ public function getFunction($functionName, $namespace = '')
*
* @param string $definition Definition
* @param \ApiGen\ReflectionElement $context Link context
* @param string $expectedName Expected element name
* @return \ApiGen\ReflectionElement|null
*/
public function resolveElement($definition, ReflectionElement $context)
public function resolveElement($definition, ReflectionElement $context, &$expectedName = null)
{
// No simple type resolving
static $types = array(
Expand All @@ -1464,9 +1465,12 @@ public function resolveElement($definition, ReflectionElement $context)
$context = $this->getClass($context->getDeclaringClassName());
}

if (($class = $this->getClass(\TokenReflection\Resolver::resolveClassFQN($definition, $context->getNamespaceAliases(), $context->getNamespaceName()), $context->getNamespaceName()))
|| ($class = $this->getClass($definition, $context->getNamespaceName()))
) {
$namespaceAliases = $context->getNamespaceAliases();
if (isset($namespaceAliases[$definition]) && $definition !== ($className = \TokenReflection\Resolver::resolveClassFQN($definition, $namespaceAliases, $context->getNamespaceName()))) {
// Aliased class
$expectedName = $className;
return $this->getClass($className, $context->getNamespaceName());
} elseif ($class = $this->getClass($definition, $context->getNamespaceName())) {
// Class
return $class;
} elseif ($constant = $this->getConstant($definition, $context->getNamespaceName())) {
Expand Down
2 changes: 1 addition & 1 deletion tools/ApiGen/ApiGen/ReflectionBase.php
@@ -1,7 +1,7 @@
<?php

/**
* ApiGen 2.6.0 - API documentation generator for PHP 5.3+
* ApiGen 2.6.1 - API documentation generator for PHP 5.3+
*
* Copyright (c) 2010-2011 David Grudl (http://davidgrudl.com)
* Copyright (c) 2011-2012 Jaroslav Hanslík (https://github.com/kukulich)
Expand Down
2 changes: 1 addition & 1 deletion tools/ApiGen/ApiGen/ReflectionClass.php
@@ -1,7 +1,7 @@
<?php

/**
* ApiGen 2.6.0 - API documentation generator for PHP 5.3+
* ApiGen 2.6.1 - API documentation generator for PHP 5.3+
*
* Copyright (c) 2010-2011 David Grudl (http://davidgrudl.com)
* Copyright (c) 2011-2012 Jaroslav Hanslík (https://github.com/kukulich)
Expand Down
2 changes: 1 addition & 1 deletion tools/ApiGen/ApiGen/ReflectionConstant.php
@@ -1,7 +1,7 @@
<?php

/**
* ApiGen 2.6.0 - API documentation generator for PHP 5.3+
* ApiGen 2.6.1 - API documentation generator for PHP 5.3+
*
* Copyright (c) 2010-2011 David Grudl (http://davidgrudl.com)
* Copyright (c) 2011-2012 Jaroslav Hanslík (https://github.com/kukulich)
Expand Down
2 changes: 1 addition & 1 deletion tools/ApiGen/ApiGen/ReflectionElement.php
@@ -1,7 +1,7 @@
<?php

/**
* ApiGen 2.6.0 - API documentation generator for PHP 5.3+
* ApiGen 2.6.1 - API documentation generator for PHP 5.3+
*
* Copyright (c) 2010-2011 David Grudl (http://davidgrudl.com)
* Copyright (c) 2011-2012 Jaroslav Hanslík (https://github.com/kukulich)
Expand Down
2 changes: 1 addition & 1 deletion tools/ApiGen/ApiGen/ReflectionExtension.php
@@ -1,7 +1,7 @@
<?php

/**
* ApiGen 2.6.0 - API documentation generator for PHP 5.3+
* ApiGen 2.6.1 - API documentation generator for PHP 5.3+
*
* Copyright (c) 2010-2011 David Grudl (http://davidgrudl.com)
* Copyright (c) 2011-2012 Jaroslav Hanslík (https://github.com/kukulich)
Expand Down
2 changes: 1 addition & 1 deletion tools/ApiGen/ApiGen/ReflectionFunction.php
@@ -1,7 +1,7 @@
<?php

/**
* ApiGen 2.6.0 - API documentation generator for PHP 5.3+
* ApiGen 2.6.1 - API documentation generator for PHP 5.3+
*
* Copyright (c) 2010-2011 David Grudl (http://davidgrudl.com)
* Copyright (c) 2011-2012 Jaroslav Hanslík (https://github.com/kukulich)
Expand Down
2 changes: 1 addition & 1 deletion tools/ApiGen/ApiGen/ReflectionFunctionBase.php
@@ -1,7 +1,7 @@
<?php

/**
* ApiGen 2.6.0 - API documentation generator for PHP 5.3+
* ApiGen 2.6.1 - API documentation generator for PHP 5.3+
*
* Copyright (c) 2010-2011 David Grudl (http://davidgrudl.com)
* Copyright (c) 2011-2012 Jaroslav Hanslík (https://github.com/kukulich)
Expand Down
2 changes: 1 addition & 1 deletion tools/ApiGen/ApiGen/ReflectionMethod.php
@@ -1,7 +1,7 @@
<?php

/**
* ApiGen 2.6.0 - API documentation generator for PHP 5.3+
* ApiGen 2.6.1 - API documentation generator for PHP 5.3+
*
* Copyright (c) 2010-2011 David Grudl (http://davidgrudl.com)
* Copyright (c) 2011-2012 Jaroslav Hanslík (https://github.com/kukulich)
Expand Down
2 changes: 1 addition & 1 deletion tools/ApiGen/ApiGen/ReflectionParameter.php
@@ -1,7 +1,7 @@
<?php

/**
* ApiGen 2.6.0 - API documentation generator for PHP 5.3+
* ApiGen 2.6.1 - API documentation generator for PHP 5.3+
*
* Copyright (c) 2010-2011 David Grudl (http://davidgrudl.com)
* Copyright (c) 2011-2012 Jaroslav Hanslík (https://github.com/kukulich)
Expand Down
2 changes: 1 addition & 1 deletion tools/ApiGen/ApiGen/ReflectionProperty.php
@@ -1,7 +1,7 @@
<?php

/**
* ApiGen 2.6.0 - API documentation generator for PHP 5.3+
* ApiGen 2.6.1 - API documentation generator for PHP 5.3+
*
* Copyright (c) 2010-2011 David Grudl (http://davidgrudl.com)
* Copyright (c) 2011-2012 Jaroslav Hanslík (https://github.com/kukulich)
Expand Down
6 changes: 3 additions & 3 deletions tools/ApiGen/ApiGen/Template.php
@@ -1,7 +1,7 @@
<?php

/**
* ApiGen 2.6.0 - API documentation generator for PHP 5.3+
* ApiGen 2.6.1 - API documentation generator for PHP 5.3+
*
* Copyright (c) 2010-2011 David Grudl (http://davidgrudl.com)
* Copyright (c) 2011-2012 Jaroslav Hanslík (https://github.com/kukulich)
Expand Down Expand Up @@ -638,9 +638,9 @@ public function resolveLink($definition, ReflectionElement $context)
$suffix = '[]';
}

$element = $this->generator->resolveElement($definition, $context);
$element = $this->generator->resolveElement($definition, $context, $expectedName);
if (null === $element) {
return null;
return $expectedName;
}

$classes = array();
Expand Down
2 changes: 1 addition & 1 deletion tools/ApiGen/ApiGen/Tree.php
@@ -1,6 +1,6 @@
<?php
/**
* ApiGen 2.6.0 - API documentation generator for PHP 5.3+
* ApiGen 2.6.1 - API documentation generator for PHP 5.3+
*
* Copyright (c) 2010-2011 David Grudl (http://davidgrudl.com)
* Copyright (c) 2011-2012 Jaroslav Hanslík (https://github.com/kukulich)
Expand Down
2 changes: 1 addition & 1 deletion tools/ApiGen/apigen.php
Expand Up @@ -2,7 +2,7 @@
<?php

/**
* ApiGen 2.6.0 - API documentation generator for PHP 5.3+
* ApiGen 2.6.1 - API documentation generator for PHP 5.3+
*
* Copyright (c) 2010-2011 David Grudl (http://davidgrudl.com)
* Copyright (c) 2011-2012 Jaroslav Hanslík (https://github.com/kukulich)
Expand Down
Expand Up @@ -2,7 +2,7 @@
/**
* PHP Token Reflection
*
* Version 1.2
* Version 1.2.2
*
* LICENSE
*
Expand Down
Expand Up @@ -2,7 +2,7 @@
/**
* PHP Token Reflection
*
* Version 1.2
* Version 1.2.2
*
* LICENSE
*
Expand Down
Expand Up @@ -2,7 +2,7 @@
/**
* PHP Token Reflection
*
* Version 1.2
* Version 1.2.2
*
* LICENSE
*
Expand Down
Expand Up @@ -2,7 +2,7 @@
/**
* PHP Token Reflection
*
* Version 1.2
* Version 1.2.2
*
* LICENSE
*
Expand Down Expand Up @@ -102,6 +102,16 @@ public function inNamespace()
return false !== strrpos($this->name, '\\');
}

/**
* Returns imported namespaces and aliases from the declaring namespace.
*
* @return array
*/
public function getNamespaceAliases()
{
return array();
}

/**
* Returns the PHP extension reflection.
*
Expand Down
Expand Up @@ -2,7 +2,7 @@
/**
* PHP Token Reflection
*
* Version 1.2
* Version 1.2.2
*
* LICENSE
*
Expand Down
Expand Up @@ -2,7 +2,7 @@
/**
* PHP Token Reflection
*
* Version 1.2
* Version 1.2.2
*
* LICENSE
*
Expand Down
Expand Up @@ -2,7 +2,7 @@
/**
* PHP Token Reflection
*
* Version 1.2
* Version 1.2.2
*
* LICENSE
*
Expand Down
Expand Up @@ -2,7 +2,7 @@
/**
* PHP Token Reflection
*
* Version 1.2
* Version 1.2.2
*
* LICENSE
*
Expand Down
Expand Up @@ -2,7 +2,7 @@
/**
* PHP Token Reflection
*
* Version 1.2
* Version 1.2.2
*
* LICENSE
*
Expand Down
Expand Up @@ -2,7 +2,7 @@
/**
* PHP Token Reflection
*
* Version 1.2
* Version 1.2.2
*
* LICENSE
*
Expand Down
Expand Up @@ -2,7 +2,7 @@
/**
* PHP Token Reflection
*
* Version 1.2
* Version 1.2.2
*
* LICENSE
*
Expand Down
Expand Up @@ -2,7 +2,7 @@
/**
* PHP Token Reflection
*
* Version 1.2
* Version 1.2.2
*
* LICENSE
*
Expand Down Expand Up @@ -41,6 +41,13 @@ public function getNamespaceName();
*/
public function inNamespace();

/**
* Returns imported namespaces and aliases from the declaring namespace.
*
* @return array
*/
public function getNamespaceAliases();

/**
* Returns the PHP extension reflection.
*
Expand Down
Expand Up @@ -2,7 +2,7 @@
/**
* PHP Token Reflection
*
* Version 1.2
* Version 1.2.2
*
* LICENSE
*
Expand Down Expand Up @@ -55,6 +55,13 @@ public function getNamespaceName();
*/
public function inNamespace();

/**
* Returns imported namespaces and aliases from the declaring namespace.
*
* @return array
*/
public function getNamespaceAliases();

/**
* Returns the file name the reflection object is defined in.
*
Expand Down

0 comments on commit 8537107

Please sign in to comment.