woocommerce/apigen/theme-woocommerce/class.latte

463 lines
20 KiB
Plaintext
Raw Normal View History

2015-01-16 16:06:58 +00:00
{layout '@layout.latte'}
{var $active = 'class'}
{block title}{if $class->deprecated}Deprecated {/if}{if $class->interface}Interface{elseif $class->trait}Trait{else}Class{/if} {$class->name}{/block}
{block content}
<div id="content" class="class">
<h1 n:class="$class->deprecated ? deprecated">{if $class->interface}Interface{elseif $class->trait}Trait{else}Class{/if} {$class->shortName}</h1>
{if $class->valid}
<div class="description" n:if="$template->longDescription($class)">
{$class|longDescription|noescape}
</div>
2015-11-20 10:05:33 +00:00
<dl class="tree well" n:if="$class->parentClass || $class->ownInterfaces || $class->ownTraits">
2015-01-16 16:06:58 +00:00
<dd n:foreach="$tree as $item" style="padding-left:{($iterator->counter - 1) * 30}px">
<img src="resources/inherit.png" alt="Extended by" n:if="$iterator->counter > 1">
{if $item->documented}
<a href="{$item|classUrl}" n:tag-if="!$iterator->last">{last}<b>{/last}<span n:class="$item->deprecated ? deprecated, !$item->valid ? invalid">{$item->name}</span>{last}</b>{/last}</a>
{else}{$item->name}{/if}
{var $itemOwnInterfaces = $item->ownInterfaces}
{if $itemOwnInterfaces} implements {foreach $itemOwnInterfaces as $interface}
<a href="{$interface|classUrl}" n:tag-if="$interface->documented"><span n:class="$interface->deprecated ? deprecated, !$interface->valid ? invalid">{$interface->name}</span></a>{sep}, {/sep}
{/foreach}{/if}
{var $itemOwnTraits = $item->ownTraits}
{if $itemOwnTraits} uses {foreach $itemOwnTraits as $trait}
{if is_string($trait)}
{$trait} (not available)
{else}
<a href="{$trait|classUrl}" n:tag-if="$trait->documented"><span n:class="$trait->deprecated ? deprecated, !$trait->valid ? invalid">{$trait->name}</span></a>{sep}, {/sep}
{/}
{/foreach}{/if}
</dd>
</dl>
{define children}
2015-11-20 10:05:33 +00:00
<p class="elementList">
2015-01-16 16:06:58 +00:00
{foreach $children as $child}
2015-11-20 10:05:33 +00:00
<code><a href="{$child|classUrl}" n:tag-if="$child->documented"><span n:tag-if="$child->deprecated" class="deprecated">{$child->name}</span></a></code>{sep}, {/sep}
2015-01-16 16:06:58 +00:00
{/foreach}
2015-11-20 10:05:33 +00:00
</p>
2015-01-16 16:06:58 +00:00
{/define}
<div n:if="$directSubClasses">
2015-11-20 10:05:33 +00:00
<h3>Direct known subclasses</h3>
2015-01-16 16:06:58 +00:00
{include children, children => $directSubClasses}
</div>
<div n:if="$indirectSubClasses">
2015-11-20 10:05:33 +00:00
<h3>Indirect known subclasses</h3>
2015-01-16 16:06:58 +00:00
{include children, children => $indirectSubClasses}
</div>
<div n:if="$directImplementers">
2015-11-20 10:05:33 +00:00
<h3>Direct known implementers</h3>
2015-01-16 16:06:58 +00:00
{include children, children => $directImplementers}
</div>
<div n:if="$indirectImplementers">
2015-11-20 10:05:33 +00:00
<h3>Indirect known implementers</h3>
2015-01-16 16:06:58 +00:00
{include children, children => $indirectImplementers}
</div>
<div n:if="$directUsers">
2015-11-20 10:05:33 +00:00
<h3>Direct Known Users</h3>
2015-01-16 16:06:58 +00:00
{include children, children => $directUsers}
</div>
<div n:if="$indirectUsers">
2015-11-20 10:05:33 +00:00
<h3>Indirect Known Users</h3>
2015-01-16 16:06:58 +00:00
{include children, children => $indirectUsers}
</div>
2015-11-20 10:05:33 +00:00
<div class="alert alert-info">
2015-01-16 16:06:58 +00:00
{if !$class->interface && !$class->trait && ($class->abstract || $class->final)}<b>{if $class->abstract}Abstract{else}Final{/if}</b><br>{/if}
{if $class->internal}<b>PHP Extension:</b> <a href="{$class->extension|manualUrl}" title="Go to PHP documentation">{$class->extension->name|firstUpper}</a><br>{/if}
{if $class->inNamespace()}<b>Namespace:</b> {$class->namespaceName|namespaceLinks|noescape}<br>{/if}
{if $class->inPackage()}<b>Package:</b> {$class->packageName|packageLinks|noescape}<br>{/if}
{foreach $template->annotationSort($template->annotationFilter($class->annotations)) as $annotation => $values}
{foreach $values as $value}
<b>{$annotation|annotationBeautify}{if $value}:{/if}</b>
{$value|annotation:$annotation:$class|noescape}<br>
{/foreach}
{/foreach}
{if $class->internal}
<b>Documented at</b> <a href="{$class|manualUrl}" title="Go to PHP documentation">php.net</a>
{else}
<b>Located at</b> <a n:tag-if="$config->sourceCode" href="{$class|sourceUrl}" title="Go to source code">{$class->fileName|relativePath}</a>
{/if}
<br>
</div>
{var $ownMethods = $class->ownMethods}
2015-11-20 10:05:33 +00:00
{var $inheritedMethods = $class->inheritedMethods}
{var $usedMethods = $class->usedMethods}
2015-01-16 16:06:58 +00:00
{var $ownMagicMethods = $class->ownMagicMethods}
2015-11-20 10:05:33 +00:00
{var $inheritedMagicMethods = $class->inheritedMagicMethods}
{var $usedMagicMethods = $class->usedMagicMethods}
{if $ownMethods || $inheritedMethods || $usedMethods || $ownMagicMethods || $usedMagicMethods}
{define method}
<tr data-order="{$method->name}" id="{if $method->magic}m{/if}_{$method->name}">
{var $annotations = $method->annotations}
<td class="attributes"><code>
{if !$class->interface && $method->abstract}abstract{elseif $method->final}final{/if} {if $method->protected}protected{elseif $method->private}private{else}public{/if} {if $method->static}static{/if}
{ifset $annotations['return']}{$annotations['return'][0]|typeLinks:$method|noescape}{/ifset}
{if $method->returnsReference()}&amp;{/if}
</code>
</td>
<td class="name"><div>
<a class="anchor" href="#{if $method->magic}m{/if}_{$method->name}">#</a>
<code n:class="$method->deprecated ? deprecated">{block|strip}
{if $class->internal}
<a href="{$method|manualUrl}" title="Go to PHP documentation">{$method->name}</a>(
{else}
<a n:tag-if="$config->sourceCode" href="{$method|sourceUrl}" title="Go to source code">{$method->name}</a>(
{/if}
{foreach $method->parameters as $parameter}
<span>{$parameter->typeHint|typeLinks:$method|noescape}
<var>{if $parameter->passedByReference}&amp; {/if}${$parameter->name}</var>{if $parameter->defaultValueAvailable} = {$parameter->defaultValueDefinition|highlightPHP:$class|noescape}{elseif $parameter->unlimited},…{/if}</span>{sep}, {/sep}
{/foreach}
){/block}</code>
2015-01-16 16:06:58 +00:00
2015-11-20 10:05:33 +00:00
{if $config->template['options']['elementDetailsCollapsed']}
<div class="description short">
{$method|shortDescription:true|noescape}
</div>
2015-01-16 16:06:58 +00:00
{/if}
2015-11-20 10:05:33 +00:00
<div n:class="description, detailed, $config->template['options']['elementDetailsCollapsed'] ? hidden">
{$method|longDescription|noescape}
2015-01-16 16:06:58 +00:00
2015-11-20 10:05:33 +00:00
{if !$class->deprecated && $method->deprecated}
<h4>Deprecated</h4>
{ifset $annotations['deprecated']}
<div class="list">
{foreach $annotations['deprecated'] as $description}
{if $description}
{$description|annotation:'deprecated':$method|noescape}<br>
{/if}
{/foreach}
</div>
{/ifset}
{/if}
{if $method->parameters && isset($annotations['param'])}
<h4>Parameters</h4>
<div class="list"><dl>
{foreach $method->parameters as $parameter}
<dt><var>${$parameter->name}</var>{if $parameter->unlimited},…{/if}</dt>
<dd>{$parameter->description|description:$method|noescape}</dd>
{/foreach}
</dl></div>
{/if}
2015-01-16 16:06:58 +00:00
2015-11-20 10:05:33 +00:00
{if isset($annotations['return']) && 'void' !== $annotations['return'][0]}
<h4>Returns</h4>
<div class="list">
{foreach $annotations['return'] as $description}
{$description|annotation:'return':$method|noescape}{sep}<br>{/}
{/foreach}
</div>
{/if}
{ifset $annotations['throws']}
<h4>Throws</h4>
<div class="list">
{foreach $annotations['throws'] as $description}
{$description|annotation:'throws':$method|noescape}{sep}<br>{/}
{/foreach}
</div>
2015-01-16 16:06:58 +00:00
{/ifset}
2015-11-20 10:05:33 +00:00
{foreach $template->annotationSort($template->annotationFilter($annotations, array('deprecated', 'param', 'return', 'throws'))) as $annotation => $descriptions}
<h4>{$annotation|annotationBeautify}</h4>
<div class="list">
{foreach $descriptions as $description}
{if $description}
{$description|annotation:$annotation:$method|noescape}<br>
{/if}
{/foreach}
</div>
2015-01-16 16:06:58 +00:00
{/foreach}
2015-11-20 10:05:33 +00:00
{var $overriddenMethod = $method->overriddenMethod}
{if $overriddenMethod}
<h4>Overrides</h4>
<div class="list"><code><a n:tag-if="$template->getClass($overriddenMethod->declaringClassName)" href="{$overriddenMethod|methodUrl}">{$overriddenMethod->declaringClassName}::{$overriddenMethod->name}</a></code></div>
{/if}
{var $implementedMethod = $method->implementedMethod}
{if $implementedMethod}
<h4>Implementation of</h4>
<div class="list"><code><a n:tag-if="$template->getClass($implementedMethod->declaringClassName)" href="{$implementedMethod|methodUrl}">{$implementedMethod->prettyName}</a></code></div>
{/if}
</div>
</div></td>
</tr>
{/define}
<div class="panel panel-default">
<div class="panel-heading"><h2>Methods summary</h2></div>
<table class="summary table table-bordered table-striped methods" id="methods" n:if="$ownMethods">
{foreach $ownMethods as $method}
{include method, method => $method}
{/foreach}
</table>
</div>
2015-01-16 16:06:58 +00:00
2015-11-20 10:05:33 +00:00
{foreach $inheritedMethods as $parentName => $methods}
<div class="panel panel-default">
<div class="panel-heading"><h3>Methods inherited from <a href="{$parentName|classUrl}#methods" n:tag-if="$template->getClass($parentName)">{$parentName}</a></h3></div>
2015-11-20 10:05:33 +00:00
<p class="elementList">
{foreach $methods as $method}
<code><a href="{$method|methodUrl}" n:tag-if="$template->getClass($parentName)"><span n:tag-if="$method->deprecated" class="deprecated">{$method->name}()</span></a></code>{sep}, {/sep}
2015-01-16 16:06:58 +00:00
{/foreach}
2015-11-20 10:05:33 +00:00
</p>
</div>
{/foreach}
2015-01-16 16:06:58 +00:00
2015-11-20 10:05:33 +00:00
{foreach $usedMethods as $traitName => $methods}
<div class="panel panel-default">
<div class="panel-heading"><h3>Methods used from <a href="{$traitName|classUrl}#methods" n:tag-if="$template->getClass($traitName)">{$traitName}</a></h3></div>
2015-11-20 10:05:33 +00:00
<p class="elementList">
{foreach $methods as $data}
<code><a href="{$data['method']|methodUrl:$data['method']->declaringTrait}" n:tag-if="$template->getClass($traitName)"><span n:tag-if="$data['method']->deprecated" class="deprecated">{$data['method']->name}()</span></a>{if $data['aliases']}(as {foreach $data['aliases'] as $alias}<span n:tag-if="$data['method']->deprecated" class="deprecated">{$alias->name}()</span>{sep}, {/sep}{/foreach}){/if}</code>{sep}, {/sep}
{/foreach}
</p>
</div>
{/foreach}
2015-01-16 16:06:58 +00:00
2015-11-20 10:05:33 +00:00
{if $ownMagicMethods}
<div class="panel panel-default">
<div class="panel-heading"><h3>Magic methods summary</h3></div>
2015-11-20 10:05:33 +00:00
<table class="summary table table-bordered table-striped methods" id="magicMethods" n:if="$ownMagicMethods">
{foreach $ownMagicMethods as $method}
{include method, method => $method}
{/foreach}
</table>
2015-01-16 16:06:58 +00:00
</div>
2015-11-20 10:05:33 +00:00
{/if}
2015-01-16 16:06:58 +00:00
2015-11-20 10:05:33 +00:00
{foreach $inheritedMagicMethods as $parentName => $methods}
<div class="panel panel-default">
<div class="panel-heading"><h3>Magic methods inherited from <a href="{$parentName|classUrl}#methods" n:tag-if="$template->getClass($parentName)">{$parentName}</a></h3></div>
2015-11-20 10:05:33 +00:00
<p class="elementList">
{foreach $methods as $method}
<code><a href="{$method|methodUrl}" n:tag-if="$template->getClass($parentName)"><span n:tag-if="$method->deprecated" class="deprecated">{$method->name}()</span></a></code>{sep}, {/sep}
{/foreach}
</p>
</div>
2015-01-16 16:06:58 +00:00
{/foreach}
2015-11-20 10:05:33 +00:00
{foreach $usedMagicMethods as $traitName => $methods}
<div class="panel panel-default">
<div class="panel-heading"><h3>Magic methods used from <a href="{$traitName|classUrl}#methods" n:tag-if="$template->getClass($traitName)">{$traitName}</a></h3></div>
2015-11-20 10:05:33 +00:00
<p class="elementList">
{foreach $methods as $data}
<code><a href="{$data['method']|methodUrl:$data['method']->declaringTrait}" n:tag-if="$template->getClass($traitName)"><span n:tag-if="$data['method']->deprecated" class="deprecated">{$data['method']->name}()</span></a>{if $data['aliases']}(as {foreach $data['aliases'] as $alias}<span n:tag-if="$data['method']->deprecated" class="deprecated">{$alias->name}()</span>{sep}, {/sep}{/foreach}){/if}</code>{sep}, {/sep}
{/foreach}
</p>
</div>
2015-01-16 16:06:58 +00:00
{/foreach}
2015-11-20 10:05:33 +00:00
{/if}
2015-01-16 16:06:58 +00:00
{var $ownConstants = $class->ownConstants}
2015-11-20 10:05:33 +00:00
{var $inheritedConstants = $class->inheritedConstants}
{if $ownConstants || $inheritedConstants}
<div class="panel panel-default">
<div class="panel-heading"><h2>Constants summary</h2></div>
2015-11-20 10:05:33 +00:00
<table class="summary table table-bordered table-striped constants" id="constants" n:if="$ownConstants">
<tr n:foreach="$ownConstants as $constant" data-order="{$constant->name}" id="{$constant->name}">
{var $annotations = $constant->annotations}
<td class="attributes"><code>{$constant->typeHint|typeLinks:$constant|noescape}</code></td>
<td class="name">
<code>
{if $class->internal}
<a href="{$constant|manualUrl}" title="Go to PHP documentation"><b>{$constant->name}</b></a>
{else}
<a n:tag-if="$config->sourceCode" href="{$constant|sourceUrl}" title="Go to source code"><b>{$constant->name}</b></a>
{/if}
</code>
2015-01-16 16:06:58 +00:00
2015-11-20 10:05:33 +00:00
<div n:if="$config->template['options']['elementDetailsCollapsed']" class="description short">
{$constant|shortDescription:true|noescape}
</div>
2015-01-16 16:06:58 +00:00
2015-11-20 10:05:33 +00:00
<div n:class="description, detailed, $config->template['options']['elementDetailsCollapsed'] ? hidden">
{$constant|longDescription|noescape}
{foreach $template->annotationSort($template->annotationFilter($annotations, array('var'))) as $annotation => $descriptions}
<h4>{$annotation|annotationBeautify}</h4>
<div class="list">
{foreach $descriptions as $description}
{if $description}
{$description|annotation:$annotation:$constant|noescape}<br>
{/if}
{/foreach}
</div>
{/foreach}
2015-01-16 16:06:58 +00:00
</div>
2015-11-20 10:05:33 +00:00
</td>
<td class="value">
<div>
<a href="#{$constant->name}" class="anchor">#</a>
<code>{$constant->valueDefinition|highlightValue:$class|noescape}</code>
</div>
</td>
</tr>
</table>
</div>
{foreach $inheritedConstants as $parentName => $constants}
<div class="panel panel-default">
<div class="panel-heading"><h3>Constants inherited from <a href="{$parentName|classUrl}#constants" n:tag-if="$template->getClass($parentName)">{$parentName}</a></h3></div>
2015-11-20 10:05:33 +00:00
<p class="elementList">
{foreach $constants as $constant}
<code><a href="{$constant|constantUrl}" n:tag-if="$template->getClass($parentName)"><b><span n:tag-if="$constant->deprecated" class"deprecated">{$constant->name}</span></b></a></code>{sep}, {/sep}
{/foreach}
</p>
</div>
2015-01-16 16:06:58 +00:00
{/foreach}
2015-11-20 10:05:33 +00:00
{/if}
2015-01-16 16:06:58 +00:00
2015-11-20 10:05:33 +00:00
{var $ownProperties = $class->ownProperties}
{var $inheritedProperties = $class->inheritedProperties}
{var $usedProperties = $class->usedProperties}
{var $ownMagicProperties = $class->ownMagicProperties}
{var $inheritedMagicProperties = $class->inheritedMagicProperties}
{var $usedMagicProperties = $class->usedMagicProperties}
{if $ownProperties || $inheritedProperties || $usedProperties || $ownMagicProperties || $inheritedMagicProperties || $usedMagicProperties}
{define property}
<tr data-order="{$property->name}" id="{if $property->magic}m{/if}${$property->name}">
<td class="attributes"><code>
{if $property->protected}protected{elseif $property->private}private{else}public{/if} {if $property->static}static{/if} {if $property->readOnly}read-only{elseif $property->writeOnly}write-only{/if}
{$property->typeHint|typeLinks:$property|noescape}
</code></td>
<td class="name">
{if $class->internal}
<a href="{$property|manualUrl}" title="Go to PHP documentation"><var>${$property->name}</var></a>
{else}
<a n:tag-if="$config->sourceCode" href="{$property|sourceUrl}" title="Go to source code"><var>${$property->name}</var></a>
{/if}
2015-01-16 16:06:58 +00:00
2015-11-20 10:05:33 +00:00
<div n:if="$config->template['options']['elementDetailsCollapsed']" class="description short">
{$property|shortDescription:true|noescape}
</div>
2015-01-16 16:06:58 +00:00
2015-11-20 10:05:33 +00:00
<div n:class="description, detailed, $config->template['options']['elementDetailsCollapsed'] ? hidden">
{$property|longDescription|noescape}
{foreach $template->annotationSort($template->annotationFilter($property->annotations, array('var'))) as $annotation => $descriptions}
<h4>{$annotation|annotationBeautify}</h4>
<div class="list">
{foreach $descriptions as $description}
{if $description}
{$description|annotation:$annotation:$property|noescape}<br>
{/if}
{/foreach}
</div>
2015-01-16 16:06:58 +00:00
{/foreach}
2015-11-20 10:05:33 +00:00
</div>
</td>
<td n:if="!$property->magic" class="value">
<div>
<a href="#{if $property->magic}m{/if}${$property->name}" class="anchor">#</a>
<code>{$property->defaultValueDefinition|highlightValue:$class|noescape}</code>
</div>
</td>
</tr>
{/define}
<div class="panel panel-default">
<div class="panel-heading"><h2>Properties summary</h2></div>
2015-11-20 10:05:33 +00:00
<table class="summary table table-bordered table-striped properties" id="properties" n:if="$ownProperties">
{foreach $ownProperties as $property}
{include property, property => $property}
{/foreach}
</table>
</div>
2015-01-16 16:06:58 +00:00
2015-11-20 10:05:33 +00:00
{foreach $inheritedProperties as $parentName => $properties}
<div class="panel panel-default">
<div class="panel-heading"><h3>Properties inherited from <a href="{$parentName|classUrl}#properties" n:tag-if="$template->getClass($parentName)">{$parentName}</a></h3></div>
2015-11-20 10:05:33 +00:00
<p class="elementList">
{foreach $properties as $property}
<code><a href="{$property|propertyUrl}" n:tag-if="$template->getClass($parentName)"><var><span n:tag-if="$property->deprecated" class="deprecated">${$property->name}</span></var></a></code>{sep}, {/sep}
{/foreach}
</p>
</div>
2015-01-16 16:06:58 +00:00
{/foreach}
2015-11-20 10:05:33 +00:00
{foreach $usedProperties as $traitName => $properties}
<div class="panel panel-default">
<div class="panel-heading"><h3>Properties used from <a href="{$traitName|classUrl}#properties" n:tag-if="$template->getClass($traitName)">{$traitName}</a></h3></div>
2015-11-20 10:05:33 +00:00
<p class="elementList">
{foreach $properties as $property}
<code><a href="{$property|propertyUrl:$property->declaringTrait}" n:tag-if="$template->getClass($traitName)"><var><span n:tag-if="$property->deprecated" class="deprecated">${$property->name}</span></var></a></code>{sep}, {/sep}
{/foreach}
</p>
</div>
2015-01-16 16:06:58 +00:00
{/foreach}
2015-11-20 10:05:33 +00:00
{if $ownMagicProperties}
<div class="panel panel-default">
<div class="panel-heading"><h3>Magic properties</h3></div>
2015-11-20 10:05:33 +00:00
<table class="summary table table-bordered table-striped properties" id="magicProperties">
{foreach $ownMagicProperties as $property}
{include property, property => $property}
{/foreach}
</table>
</div>
{/if}
{foreach $inheritedMagicProperties as $parentName => $properties}
<div class="panel panel-default">
<div class="panel-heading"><h3>Magic properties inherited from <a href="{$parentName|classUrl}#properties" n:tag-if="$template->getClass($parentName)">{$parentName}</a></h3></div>
2015-11-20 10:05:33 +00:00
<p class="elementList">
{foreach $properties as $property}
<code><a href="{$property|propertyUrl}" n:tag-if="$template->getClass($parentName)"><var><span n:tag-if="$property->deprecated" class="deprecated">${$property->name}</span></var></a></code>{sep}, {/sep}
{/foreach}
</p>
</div>
2015-01-16 16:06:58 +00:00
{/foreach}
2015-11-20 10:05:33 +00:00
{foreach $usedMagicProperties as $traitName => $properties}
<div class="panel panel-default">
<div class="panel-heading"><h3>Magic properties used from <a href="{$traitName|classUrl}#properties" n:tag-if="$template->getClass($traitName)">{$traitName}</a></h3></div>
2015-11-20 10:05:33 +00:00
<p class="elementList">
{foreach $properties as $property}
<code><a href="{$property|propertyUrl:$property->declaringTrait}" n:tag-if="$template->getClass($traitName)"><var><span n:tag-if="$property->deprecated" class="deprecated">${$property->name}</span></var></a></code>{sep}, {/sep}
{/foreach}
</p>
</div>
2015-01-16 16:06:58 +00:00
{/foreach}
2015-11-20 10:05:33 +00:00
{/if}
2015-01-16 16:06:58 +00:00
{else}
2015-11-20 10:05:33 +00:00
<div class="alert alert-error">
2015-01-16 16:06:58 +00:00
<p>
Documentation of this class could not be generated.
</p>
<p>
Class was originally declared in {$class->fileName|relativePath} and is invalid because of:
</p>
<ul>
<li n:foreach="$class->reasons as $reason">Class was redeclared in {$reason->getSender()->getFileName()|relativePath}.</li>
</ul>
</div>
{/if}
</div>
{/block}