Kohana v3.3.5
This commit is contained in:
@@ -5,8 +5,8 @@
|
||||
* @package Kohana/Userguide
|
||||
* @category Base
|
||||
* @author Kohana Team
|
||||
* @copyright (c) 2009-2012 Kohana Team
|
||||
* @license http://kohanaphp.com/license
|
||||
* @copyright (c) 2008-2013 Kohana Team
|
||||
* @license http://kohanaframework.org/license
|
||||
*/
|
||||
class Kohana_Kodoc_Class extends Kodoc {
|
||||
|
||||
@@ -45,7 +45,7 @@ class Kohana_Kodoc_Class extends Kodoc {
|
||||
* the class. Reads the class modifiers, constants and comment. Parses the
|
||||
* comment to find the description and tags.
|
||||
*
|
||||
* @param string class name
|
||||
* @param string Class name
|
||||
* @return void
|
||||
*/
|
||||
public function __construct($class)
|
||||
@@ -59,7 +59,7 @@ class Kohana_Kodoc_Class extends Kodoc {
|
||||
|
||||
$this->constants = $this->class->getConstants();
|
||||
|
||||
// If ReflectionClass::getParentClass() won't work if the class in
|
||||
// If ReflectionClass::getParentClass() won't work if the class in
|
||||
// question is an interface
|
||||
if ($this->class->isInterface())
|
||||
{
|
||||
@@ -154,7 +154,7 @@ class Kohana_Kodoc_Class extends Kodoc {
|
||||
|
||||
return $props;
|
||||
}
|
||||
|
||||
|
||||
protected function _prop_sort($a, $b)
|
||||
{
|
||||
// If one property is public, and the other is not, it goes on top
|
||||
@@ -162,13 +162,13 @@ class Kohana_Kodoc_Class extends Kodoc {
|
||||
return -1;
|
||||
if ($b->isPublic() AND ( ! $a->isPublic()))
|
||||
return 1;
|
||||
|
||||
|
||||
// If one property is protected and the other is private, it goes on top
|
||||
if ($a->isProtected() AND $b->isPrivate())
|
||||
return -1;
|
||||
if ($b->isProtected() AND $a->isPrivate())
|
||||
return 1;
|
||||
|
||||
|
||||
// Otherwise just do alphabetical
|
||||
return strcmp($a->name, $b->name);
|
||||
}
|
||||
@@ -191,14 +191,15 @@ class Kohana_Kodoc_Class extends Kodoc {
|
||||
|
||||
return $methods;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Sort methods based on their visibility and declaring class based on:
|
||||
* - methods will be sorted public, protected, then private.
|
||||
* - methods that are declared by an ancestor will be after classes
|
||||
*
|
||||
* * methods will be sorted public, protected, then private.
|
||||
* * methods that are declared by an ancestor will be after classes
|
||||
* declared by the current class
|
||||
* - lastly, they will be sorted alphabetically
|
||||
*
|
||||
* * lastly, they will be sorted alphabetically
|
||||
*
|
||||
*/
|
||||
protected function _method_sort($a, $b)
|
||||
{
|
||||
@@ -207,16 +208,16 @@ class Kohana_Kodoc_Class extends Kodoc {
|
||||
return -1;
|
||||
if ($b->isPublic() AND ( ! $a->isPublic()))
|
||||
return 1;
|
||||
|
||||
|
||||
// If one method is protected and the other is private, it goes on top
|
||||
if ($a->isProtected() AND $b->isPrivate())
|
||||
return -1;
|
||||
if ($b->isProtected() AND $a->isPrivate())
|
||||
return 1;
|
||||
|
||||
|
||||
// The methods have the same visibility, so check the declaring class depth:
|
||||
|
||||
|
||||
|
||||
|
||||
/*
|
||||
echo Debug::vars('a is '.$a->class.'::'.$a->name,'b is '.$b->class.'::'.$b->name,
|
||||
'are the classes the same?', $a->class == $b->class,'if they are, the result is:',strcmp($a->name, $b->name),
|
||||
@@ -276,4 +277,5 @@ class Kohana_Kodoc_Class extends Kodoc {
|
||||
|
||||
return $result;
|
||||
}
|
||||
}
|
||||
|
||||
} // End Kodoc_Class
|
||||
|
Reference in New Issue
Block a user