Skip to content

Commit

Permalink
WiP
Browse files Browse the repository at this point in the history
  • Loading branch information
JoshyPHP committed Nov 26, 2017
1 parent fa9e938 commit 5726ebe
Showing 1 changed file with 11 additions and 90 deletions.
101 changes: 11 additions & 90 deletions src/Configurator/Helpers/TemplateInspector.php
Expand Up @@ -151,6 +151,17 @@ public function __construct($template)
$this->analyseContent();
}

/**
* Return the value of a boolean property
*
* @param string $k
* @return bool
*/
public function __get($k)
{
return (isset($this->$propName) && is_bool($this->$propName)) ? $this->$propName : false;
}

/**
* Return whether this template allows a given child
*
Expand Down Expand Up @@ -197,26 +208,6 @@ public function allowsDescendant(TemplateInspector $descendant)
return ($this->allowsChildElements || !$descendant->hasElements);
}

/**
* Return whether this template allows elements as children
*
* @return bool
*/
public function allowsChildElements()
{
return $this->allowsChildElements;
}

/**
* Return whether this template allows text nodes as children
*
* @return bool
*/
public function allowsText()
{
return $this->allowsText;
}

/**
* Return whether this template automatically closes given parent template
*
Expand Down Expand Up @@ -258,76 +249,6 @@ public function evaluate($expr, DOMElement $node = null)
return $this->xpath->evaluate($expr, $node);
}

/**
* Return whether this template should be considered a block-level element
*
* @return bool
*/
public function isBlock()
{
return $this->isBlock;
}

/**
* Return whether this template adds to the list of active formatting elements
*
* @return bool
*/
public function isFormattingElement()
{
return $this->isFormattingElement;
}

/**
* Return whether this template uses the "empty" content model
*
* @return bool
*/
public function isEmpty()
{
return $this->isEmpty;
}

/**
* Return whether this template lets content through via an xsl:apply-templates element
*
* @return bool
*/
public function isPassthrough()
{
return $this->isPassthrough;
}

/**
* Return whether this template uses the "transparent" content model
*
* @return bool
*/
public function isTransparent()
{
return $this->isTransparent;
}

/**
* Return whether all branches have an ancestor that is a void element
*
* @return bool
*/
public function isVoid()
{
return $this->isVoid;
}

/**
* Return whether this template preserves the whitespace in its descendants
*
* @return bool
*/
public function preservesNewLines()
{
return $this->preservesNewLines;
}

/**
* Analyses the content of the whole template and set $this->contentBitfield accordingly
*/
Expand Down

0 comments on commit 5726ebe

Please sign in to comment.