tmpqGlp75/0000700013775000244210000000000012263233104013473 5ustar mparentdomain userstmpqGlp75/package.sig0000644013775000244210000000030612213552462015611 0ustar mparentdomain users-----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.14 (GNU/Linux) iEYEABECAAYFAlIu1TIACgkQaGfFFLhbXWnvRQCgnfQ5omdrv4ZimSPOxSKqQ5dh Ps0AmwWWOvdG7T59diihejIOWf9e7lfq =8h+6 -----END PGP SIGNATURE----- tmpqGlp75/package.xml0000644013775000244210000001643012213552453015634 0ustar mparentdomain users PHP_CodeCoverage pear.phpunit.de Library that provides collection, processing, and rendering functionality for PHP code coverage information. Library that provides collection, processing, and rendering functionality for PHP code coverage information. Sebastian Bergmann sb sb@sebastian-bergmann.de yes 2013-09-10 1.2.13 1.2.11 stable stable The BSD 3-Clause License http://github.com/sebastianbergmann/php-code-coverage/ 5.3.3 1.9.4 File_Iterator pear.phpunit.de 1.3.0 PHP_TokenStream pear.phpunit.de 1.1.3 Text_Template pear.phpunit.de 1.1.1 dom xdebug 2.0.5 tmpqGlp75/PHP_CodeCoverage-1.2.13/0000755013775000244210000000000012263233104017262 5ustar mparentdomain userstmpqGlp75/PHP_CodeCoverage-1.2.13/LICENSE0000644013775000244210000000301712213552453020276 0ustar mparentdomain usersPHP_CodeCoverage Copyright (c) 2009-2013, Sebastian Bergmann . All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. * Neither the name of Sebastian Bergmann nor the names of his contributors may be used to endorse or promote products derived from this software without specific prior written permission. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. tmpqGlp75/PHP_CodeCoverage-1.2.13/PHP/0000755013775000244210000000000012263233104017711 5ustar mparentdomain userstmpqGlp75/PHP_CodeCoverage-1.2.13/PHP/CodeCoverage/0000755013775000244210000000000012263233104022237 5ustar mparentdomain userstmpqGlp75/PHP_CodeCoverage-1.2.13/PHP/CodeCoverage/Report/0000755013775000244210000000000012263233104023512 5ustar mparentdomain userstmpqGlp75/PHP_CodeCoverage-1.2.13/PHP/CodeCoverage/Report/PHP.php0000644013775000244210000000557312213552453024672 0ustar mparentdomain users. * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * * * Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * * * Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in * the documentation and/or other materials provided with the * distribution. * * * Neither the name of Sebastian Bergmann nor the names of his * contributors may be used to endorse or promote products derived * from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * POSSIBILITY OF SUCH DAMAGE. * * @category PHP * @package CodeCoverage * @author Sebastian Bergmann * @copyright 2009-2013 Sebastian Bergmann * @license http://www.opensource.org/licenses/BSD-3-Clause The BSD 3-Clause License * @link http://github.com/sebastianbergmann/php-code-coverage * @since File available since Release 1.1.0 */ /** * Uses serialize() to write a PHP_CodeCoverage object to a file. * * @category PHP * @package CodeCoverage * @author Sebastian Bergmann * @copyright 2009-2013 Sebastian Bergmann * @license http://www.opensource.org/licenses/BSD-3-Clause The BSD 3-Clause License * @link http://github.com/sebastianbergmann/php-code-coverage * @since Class available since Release 1.1.0 */ class PHP_CodeCoverage_Report_PHP { /** * @param PHP_CodeCoverage $coverage * @param string $target * @return string */ public function process(PHP_CodeCoverage $coverage, $target = NULL) { $coverage = serialize($coverage); if ($target !== NULL) { return file_put_contents($target, $coverage); } else { return $coverage; } } } tmpqGlp75/PHP_CodeCoverage-1.2.13/PHP/CodeCoverage/Report/Text.php0000644013775000244210000002546612213552453025172 0ustar mparentdomain users. * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * * * Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * * * Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in * the documentation and/or other materials provided with the * distribution. * * * Neither the name of Sebastian Bergmann nor the names of his * contributors may be used to endorse or promote products derived * from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * POSSIBILITY OF SUCH DAMAGE. * * @category PHP * @package CodeCoverage * @author Sebastian Bergmann * @copyright 2009-2013 Sebastian Bergmann * @license http://www.opensource.org/licenses/BSD-3-Clause The BSD 3-Clause License * @link http://github.com/sebastianbergmann/php-code-coverage * @since File available since Release 1.1.0 */ /** * Generates human readable output from an PHP_CodeCoverage object. * * The output gets put into a text file our written to the CLI. * * @category PHP * @package CodeCoverage * @author Sebastian Bergmann * @copyright 2009-2013 Sebastian Bergmann * @license http://www.opensource.org/licenses/BSD-3-Clause The BSD 3-Clause License * @link http://github.com/sebastianbergmann/php-code-coverage * @since Class available since Release 1.1.0 */ class PHP_CodeCoverage_Report_Text { protected $outputStream; protected $lowUpperBound; protected $highLowerBound; protected $showUncoveredFiles; protected $colors = array( 'green' => "\x1b[30;42m", 'yellow' => "\x1b[30;43m", 'red' => "\x1b[37;41m", 'header' => "\x1b[47;40m", 'reset' => "\x1b[0m", 'eol' => "\x1b[2K", ); public function __construct(PHPUnit_Util_Printer $outputStream, $lowUpperBound, $highLowerBound, $showUncoveredFiles) { $this->outputStream = $outputStream; $this->lowUpperBound = $lowUpperBound; $this->highLowerBound = $highLowerBound; $this->showUncoveredFiles = $showUncoveredFiles; } /** * @param PHP_CodeCoverage $coverage * @param string $target * @param string $name * @return string */ public function process(PHP_CodeCoverage $coverage, $showColors = FALSE) { $output = ''; $report = $coverage->getReport(); unset($coverage); $colors = array( 'header' => '', 'classes' => '', 'methods' => '', 'lines' => '', 'reset' => '', 'eol' => '' ); if ($showColors) { $colors['classes'] = $this->getCoverageColor( $report->getNumTestedClassesAndTraits(), $report->getNumClassesAndTraits() ); $colors['methods'] = $this->getCoverageColor( $report->getNumTestedMethods(), $report->getNumMethods() ); $colors['lines'] = $this->getCoverageColor( $report->getNumExecutedLines(), $report->getNumExecutableLines() ); $colors['reset'] = $this->colors['reset']; $colors['header'] = $this->colors['header']; $colors['eol'] = $this->colors['eol']; } $output .= PHP_EOL . PHP_EOL . $colors['header'] . 'Code Coverage Report '; $output .= PHP_EOL . date(' Y-m-d H:i:s', $_SERVER['REQUEST_TIME']) . PHP_EOL; $output .= PHP_EOL . ' Summary: ' . PHP_EOL . $colors['reset'] . $colors['classes'] . $colors['eol'] . ' Classes: ' . PHP_CodeCoverage_Util::percent($report->getNumTestedClassesAndTraits(), $report->getNumClassesAndTraits(), TRUE) . ' (' . $report->getNumTestedClassesAndTraits() . '/' . $report->getNumClassesAndTraits() . ')' . PHP_EOL . $colors ['eol'] . $colors['methods'] . $colors['eol'] . ' Methods: ' . PHP_CodeCoverage_Util::percent($report->getNumTestedMethods(), $report->getNumMethods(), TRUE) . ' (' . $report->getNumTestedMethods() . '/' . $report->getNumMethods() . ')' . PHP_EOL . $colors ['eol'] . $colors['lines'] . $colors['eol'] . ' Lines: ' . PHP_CodeCoverage_Util::percent($report->getNumExecutedLines(), $report->getNumExecutableLines(), TRUE) . ' (' . $report->getNumExecutedLines() . '/' . $report->getNumExecutableLines() . ')' . PHP_EOL . $colors['reset'] . $colors ['eol']; $classCoverage = array(); foreach ($report as $item) { if (!$item instanceof PHP_CodeCoverage_Report_Node_File) { continue; } $classes = $item->getClassesAndTraits(); $coverage = $item->getCoverageData(); $lines = array(); $ignoredLines = $item->getIgnoredLines(); foreach ($classes as $className => $class) { $classStatements = 0; $coveredClassStatements = 0; $coveredMethods = 0; foreach ($class['methods'] as $method) { $methodCount = 0; $methodLines = 0; $methodLinesCovered = 0; for ($i = $method['startLine']; $i <= $method['endLine']; $i++) { if (isset($ignoredLines[$i])) { continue; } $add = TRUE; $count = 0; if (isset($coverage[$i])) { if ($coverage[$i] !== NULL) { $classStatements++; $methodLines++; } else { $add = FALSE; } $count = count($coverage[$i]); if ($count > 0) { $coveredClassStatements++; $methodLinesCovered++; } } else { $add = FALSE; } $methodCount = max($methodCount, $count); if ($add) { $lines[$i] = array( 'count' => $count, 'type' => 'stmt' ); } } if ($methodCount > 0) { $coveredMethods++; } } if (!empty($class['package']['namespace'])) { $namespace = '\\' . $class['package']['namespace'] . '::'; } else if (!empty($class['package']['fullPackage'])) { $namespace = '@' . $class['package']['fullPackage'] . '::'; } else { $namespace = ''; } $classCoverage[$namespace . $className] = array( 'namespace' => $namespace, 'className ' => $className, 'methodsCovered' => $coveredMethods, 'methodCount' => count($class['methods']), 'statementsCovered' => $coveredClassStatements, 'statementCount' => $classStatements, ); } } ksort($classCoverage); $methodColor = ''; $linesColor = ''; $resetColor = ''; foreach ($classCoverage as $fullQualifiedPath => $classInfo) { if ($classInfo['statementsCovered'] != 0 || $this->showUncoveredFiles) { if ($showColors) { $methodColor = $this->getCoverageColor($classInfo['methodsCovered'], $classInfo['methodCount']); $linesColor = $this->getCoverageColor($classInfo['statementsCovered'], $classInfo['statementCount']); $resetColor = $colors['reset']; } $output .= PHP_EOL . $fullQualifiedPath . PHP_EOL . ' ' . $methodColor . 'Methods: ' . $this->printCoverageCounts($classInfo['methodsCovered'], $classInfo['methodCount'], 2) . $resetColor . ' ' . ' ' . $linesColor . 'Lines: ' . $this->printCoverageCounts($classInfo['statementsCovered'], $classInfo['statementCount'], 3) . $resetColor ; } } $this->outputStream->write($output . PHP_EOL); } protected function getCoverageColor($numberOfCoveredElements, $totalNumberOfElements) { $coverage = PHP_CodeCoverage_Util::percent( $numberOfCoveredElements, $totalNumberOfElements ); if ($coverage > $this->highLowerBound) { return $this->colors['green']; } else if ($coverage > $this->lowUpperBound) { return $this->colors['yellow']; } return $this->colors['red']; } protected function printCoverageCounts($numberOfCoveredElements, $totalNumberOfElements, $presicion) { $format = '%' . $presicion . 's'; return PHP_CodeCoverage_Util::percent( $numberOfCoveredElements, $totalNumberOfElements, TRUE, TRUE ) . ' (' . sprintf($format, $numberOfCoveredElements) . '/' . sprintf($format, $totalNumberOfElements) . ')'; } } tmpqGlp75/PHP_CodeCoverage-1.2.13/PHP/CodeCoverage/Report/Node/0000755013775000244210000000000012263233104024377 5ustar mparentdomain userstmpqGlp75/PHP_CodeCoverage-1.2.13/PHP/CodeCoverage/Report/Node/Iterator.php0000644013775000244210000001042312213552453026707 0ustar mparentdomain users. * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * * * Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * * * Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in * the documentation and/or other materials provided with the * distribution. * * * Neither the name of Sebastian Bergmann nor the names of his * contributors may be used to endorse or promote products derived * from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * POSSIBILITY OF SUCH DAMAGE. * * @category PHP * @package CodeCoverage * @author Sebastian Bergmann * @copyright 2009-2013 Sebastian Bergmann * @license http://www.opensource.org/licenses/BSD-3-Clause The BSD 3-Clause License * @link http://github.com/sebastianbergmann/php-code-coverage * @since File available since Release 1.1.0 */ /** * Recursive iterator for PHP_CodeCoverage_Report_Node object graphs. * * @category PHP * @package CodeCoverage * @author Sebastian Bergmann * @copyright 2009-2013 Sebastian Bergmann * @license http://www.opensource.org/licenses/BSD-3-Clause The BSD 3-Clause License * @link http://github.com/sebastianbergmann/php-code-coverage * @since Class available since Release 1.1.0 */ class PHP_CodeCoverage_Report_Node_Iterator implements RecursiveIterator { /** * @var integer */ protected $position; /** * @var PHP_CodeCoverage_Report_Node[] */ protected $nodes; /** * Constructor. * * @param PHP_CodeCoverage_Report_Node_Directory $node */ public function __construct(PHP_CodeCoverage_Report_Node_Directory $node) { $this->nodes = $node->getChildNodes(); } /** * Rewinds the Iterator to the first element. * */ public function rewind() { $this->position = 0; } /** * Checks if there is a current element after calls to rewind() or next(). * * @return boolean */ public function valid() { return $this->position < count($this->nodes); } /** * Returns the key of the current element. * * @return integer */ public function key() { return $this->position; } /** * Returns the current element. * * @return PHPUnit_Framework_Test */ public function current() { return $this->valid() ? $this->nodes[$this->position] : NULL; } /** * Moves forward to next element. * */ public function next() { $this->position++; } /** * Returns the sub iterator for the current element. * * @return PHP_CodeCoverage_Report_Node_Iterator */ public function getChildren() { return new PHP_CodeCoverage_Report_Node_Iterator( $this->nodes[$this->position] ); } /** * Checks whether the current element has children. * * @return boolean */ public function hasChildren() { return $this->nodes[$this->position] instanceof PHP_CodeCoverage_Report_Node_Directory; } } tmpqGlp75/PHP_CodeCoverage-1.2.13/PHP/CodeCoverage/Report/Node/Directory.php0000644013775000244210000003004312213552453027062 0ustar mparentdomain users. * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * * * Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * * * Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in * the documentation and/or other materials provided with the * distribution. * * * Neither the name of Sebastian Bergmann nor the names of his * contributors may be used to endorse or promote products derived * from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * POSSIBILITY OF SUCH DAMAGE. * * @category PHP * @package CodeCoverage * @author Sebastian Bergmann * @copyright 2009-2013 Sebastian Bergmann * @license http://www.opensource.org/licenses/BSD-3-Clause The BSD 3-Clause License * @link http://github.com/sebastianbergmann/php-code-coverage * @since File available since Release 1.1.0 */ /** * Represents a directory in the code coverage information tree. * * @category PHP * @package CodeCoverage * @author Sebastian Bergmann * @copyright 2009-2013 Sebastian Bergmann * @license http://www.opensource.org/licenses/BSD-3-Clause The BSD 3-Clause License * @link http://github.com/sebastianbergmann/php-code-coverage * @since Class available since Release 1.1.0 */ class PHP_CodeCoverage_Report_Node_Directory extends PHP_CodeCoverage_Report_Node implements IteratorAggregate { /** * @var PHP_CodeCoverage_Report_Node[] */ protected $children = array(); /** * @var PHP_CodeCoverage_Report_Node_Directory[] */ protected $directories = array(); /** * @var PHP_CodeCoverage_Report_Node_File[] */ protected $files = array(); /** * @var array */ protected $classes; /** * @var array */ protected $traits; /** * @var array */ protected $functions; /** * @var array */ protected $linesOfCode = NULL; /** * @var integer */ protected $numFiles = -1; /** * @var integer */ protected $numExecutableLines = -1; /** * @var integer */ protected $numExecutedLines = -1; /** * @var integer */ protected $numClasses = -1; /** * @var integer */ protected $numTestedClasses = -1; /** * @var integer */ protected $numTraits = -1; /** * @var integer */ protected $numTestedTraits = -1; /** * @var integer */ protected $numMethods = -1; /** * @var integer */ protected $numTestedMethods = -1; /** * @var integer */ protected $numFunctions = -1; /** * @var integer */ protected $numTestedFunctions = -1; /** * Returns the number of files in/under this node. * * @return integer */ public function count() { if ($this->numFiles == -1) { $this->numFiles = 0; foreach ($this->children as $child) { $this->numFiles += count($child); } } return $this->numFiles; } /** * Returns an iterator for this node. * * @return RecursiveIteratorIterator */ public function getIterator() { return new RecursiveIteratorIterator( new PHP_CodeCoverage_Report_Node_Iterator($this), RecursiveIteratorIterator::SELF_FIRST ); } /** * Adds a new directory. * * @param string $name * @return PHP_CodeCoverage_Report_Node_Directory */ public function addDirectory($name) { $directory = new PHP_CodeCoverage_Report_Node_Directory($name, $this); $this->children[] = $directory; $this->directories[] = &$this->children[count($this->children) - 1]; return $directory; } /** * Adds a new file. * * @param string $name * @param array $coverageData * @param array $testData * @param boolean $cacheTokens * @return PHP_CodeCoverage_Report_Node_File * @throws PHP_CodeCoverage_Exception */ public function addFile($name, array $coverageData, array $testData, $cacheTokens) { $file = new PHP_CodeCoverage_Report_Node_File( $name, $this, $coverageData, $testData, $cacheTokens ); $this->children[] = $file; $this->files[] = &$this->children[count($this->children) - 1]; $this->numExecutableLines = -1; $this->numExecutedLines = -1; return $file; } /** * Returns the directories in this directory. * * @return array */ public function getDirectories() { return $this->directories; } /** * Returns the files in this directory. * * @return array */ public function getFiles() { return $this->files; } /** * Returns the child nodes of this node. * * @return array */ public function getChildNodes() { return $this->children; } /** * Returns the classes of this node. * * @return array */ public function getClasses() { if ($this->classes === NULL) { $this->classes = array(); foreach ($this->children as $child) { $this->classes = array_merge( $this->classes, $child->getClasses() ); } } return $this->classes; } /** * Returns the traits of this node. * * @return array */ public function getTraits() { if ($this->traits === NULL) { $this->traits = array(); foreach ($this->children as $child) { $this->traits = array_merge( $this->traits, $child->getTraits() ); } } return $this->traits; } /** * Returns the functions of this node. * * @return array */ public function getFunctions() { if ($this->functions === NULL) { $this->functions = array(); foreach ($this->children as $child) { $this->functions = array_merge( $this->functions, $child->getFunctions() ); } } return $this->functions; } /** * Returns the LOC/CLOC/NCLOC of this node. * * @return array */ public function getLinesOfCode() { if ($this->linesOfCode === NULL) { $this->linesOfCode = array('loc' => 0, 'cloc' => 0, 'ncloc' => 0); foreach ($this->children as $child) { $linesOfCode = $child->getLinesOfCode(); $this->linesOfCode['loc'] += $linesOfCode['loc']; $this->linesOfCode['cloc'] += $linesOfCode['cloc']; $this->linesOfCode['ncloc'] += $linesOfCode['ncloc']; } } return $this->linesOfCode; } /** * Returns the number of executable lines. * * @return integer */ public function getNumExecutableLines() { if ($this->numExecutableLines == -1) { $this->numExecutableLines = 0; foreach ($this->children as $child) { $this->numExecutableLines += $child->getNumExecutableLines(); } } return $this->numExecutableLines; } /** * Returns the number of executed lines. * * @return integer */ public function getNumExecutedLines() { if ($this->numExecutedLines == -1) { $this->numExecutedLines = 0; foreach ($this->children as $child) { $this->numExecutedLines += $child->getNumExecutedLines(); } } return $this->numExecutedLines; } /** * Returns the number of classes. * * @return integer */ public function getNumClasses() { if ($this->numClasses == -1) { $this->numClasses = 0; foreach ($this->children as $child) { $this->numClasses += $child->getNumClasses(); } } return $this->numClasses; } /** * Returns the number of tested classes. * * @return integer */ public function getNumTestedClasses() { if ($this->numTestedClasses == -1) { $this->numTestedClasses = 0; foreach ($this->children as $child) { $this->numTestedClasses += $child->getNumTestedClasses(); } } return $this->numTestedClasses; } /** * Returns the number of traits. * * @return integer */ public function getNumTraits() { if ($this->numTraits == -1) { $this->numTraits = 0; foreach ($this->children as $child) { $this->numTraits += $child->getNumTraits(); } } return $this->numTraits; } /** * Returns the number of tested traits. * * @return integer */ public function getNumTestedTraits() { if ($this->numTestedTraits == -1) { $this->numTestedTraits = 0; foreach ($this->children as $child) { $this->numTestedTraits += $child->getNumTestedTraits(); } } return $this->numTestedTraits; } /** * Returns the number of methods. * * @return integer */ public function getNumMethods() { if ($this->numMethods == -1) { $this->numMethods = 0; foreach ($this->children as $child) { $this->numMethods += $child->getNumMethods(); } } return $this->numMethods; } /** * Returns the number of tested methods. * * @return integer */ public function getNumTestedMethods() { if ($this->numTestedMethods == -1) { $this->numTestedMethods = 0; foreach ($this->children as $child) { $this->numTestedMethods += $child->getNumTestedMethods(); } } return $this->numTestedMethods; } /** * Returns the number of functions. * * @return integer */ public function getNumFunctions() { if ($this->numFunctions == -1) { $this->numFunctions = 0; foreach ($this->children as $child) { $this->numFunctions += $child->getNumFunctions(); } } return $this->numFunctions; } /** * Returns the number of tested functions. * * @return integer */ public function getNumTestedFunctions() { if ($this->numTestedFunctions == -1) { $this->numTestedFunctions = 0; foreach ($this->children as $child) { $this->numTestedFunctions += $child->getNumTestedFunctions(); } } return $this->numTestedFunctions; } } tmpqGlp75/PHP_CodeCoverage-1.2.13/PHP/CodeCoverage/Report/Node/File.php0000644013775000244210000005100712213552453026000 0ustar mparentdomain users. * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * * * Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * * * Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in * the documentation and/or other materials provided with the * distribution. * * * Neither the name of Sebastian Bergmann nor the names of his * contributors may be used to endorse or promote products derived * from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * POSSIBILITY OF SUCH DAMAGE. * * @category PHP * @package CodeCoverage * @author Sebastian Bergmann * @copyright 2009-2013 Sebastian Bergmann * @license http://www.opensource.org/licenses/BSD-3-Clause The BSD 3-Clause License * @link http://github.com/sebastianbergmann/php-code-coverage * @since File available since Release 1.1.0 */ /** * Represents a file in the code coverage information tree. * * @category PHP * @package CodeCoverage * @author Sebastian Bergmann * @copyright 2009-2013 Sebastian Bergmann * @license http://www.opensource.org/licenses/BSD-3-Clause The BSD 3-Clause License * @link http://github.com/sebastianbergmann/php-code-coverage * @since Class available since Release 1.1.0 */ class PHP_CodeCoverage_Report_Node_File extends PHP_CodeCoverage_Report_Node { /** * @var array */ protected $coverageData; /** * @var array */ protected $testData; /** * @var array */ protected $ignoredLines; /** * @var integer */ protected $numExecutableLines = 0; /** * @var integer */ protected $numExecutedLines = 0; /** * @var array */ protected $classes = array(); /** * @var array */ protected $traits = array(); /** * @var array */ protected $functions = array(); /** * @var array */ protected $linesOfCode = array(); /** * @var integer */ protected $numTestedTraits = 0; /** * @var integer */ protected $numTestedClasses = 0; /** * @var integer */ protected $numMethods = NULL; /** * @var integer */ protected $numTestedMethods = NULL; /** * @var integer */ protected $numTestedFunctions = NULL; /** * @var array */ protected $startLines = array(); /** * @var array */ protected $endLines = array(); /** * @var boolean */ protected $cacheTokens; /** * Constructor. * * @param string $name * @param PHP_CodeCoverage_Report_Node $parent * @param array $coverageData * @param array $testData * @param boolean $cacheTokens * @throws PHP_CodeCoverage_Exception */ public function __construct($name, PHP_CodeCoverage_Report_Node $parent, array $coverageData, array $testData, $cacheTokens) { if (!is_bool($cacheTokens)) { throw PHP_CodeCoverage_Util_InvalidArgumentHelper::factory( 1, 'boolean' ); } parent::__construct($name, $parent); $this->coverageData = $coverageData; $this->testData = $testData; $this->ignoredLines = PHP_CodeCoverage_Util::getLinesToBeIgnored( $this->getPath(), $cacheTokens ); $this->cacheTokens = $cacheTokens; $this->calculateStatistics(); } /** * Returns the number of files in/under this node. * * @return integer */ public function count() { return 1; } /** * Returns the code coverage data of this node. * * @return array */ public function getCoverageData() { return $this->coverageData; } /** * Returns the test data of this node. * * @return array */ public function getTestData() { return $this->testData; } /** * @return array */ public function getIgnoredLines() { return $this->ignoredLines; } /** * Returns the classes of this node. * * @return array */ public function getClasses() { return $this->classes; } /** * Returns the traits of this node. * * @return array */ public function getTraits() { return $this->traits; } /** * Returns the functions of this node. * * @return array */ public function getFunctions() { return $this->functions; } /** * Returns the LOC/CLOC/NCLOC of this node. * * @return array */ public function getLinesOfCode() { return $this->linesOfCode; } /** * Returns the number of executable lines. * * @return integer */ public function getNumExecutableLines() { return $this->numExecutableLines; } /** * Returns the number of executed lines. * * @return integer */ public function getNumExecutedLines() { return $this->numExecutedLines; } /** * Returns the number of classes. * * @return integer */ public function getNumClasses() { return count($this->classes); } /** * Returns the number of tested classes. * * @return integer */ public function getNumTestedClasses() { return $this->numTestedClasses; } /** * Returns the number of traits. * * @return integer */ public function getNumTraits() { return count($this->traits); } /** * Returns the number of tested traits. * * @return integer */ public function getNumTestedTraits() { return $this->numTestedTraits; } /** * Returns the number of methods. * * @return integer */ public function getNumMethods() { if ($this->numMethods === NULL) { $this->numMethods = 0; foreach ($this->classes as $class) { foreach ($class['methods'] as $method) { if ($method['executableLines'] > 0) { $this->numMethods++; } } } foreach ($this->traits as $trait) { foreach ($trait['methods'] as $method) { if ($method['executableLines'] > 0) { $this->numMethods++; } } } } return $this->numMethods; } /** * Returns the number of tested methods. * * @return integer */ public function getNumTestedMethods() { if ($this->numTestedMethods === NULL) { $this->numTestedMethods = 0; foreach ($this->classes as $class) { foreach ($class['methods'] as $method) { if ($method['executableLines'] > 0 && $method['coverage'] == 100) { $this->numTestedMethods++; } } } foreach ($this->traits as $trait) { foreach ($trait['methods'] as $method) { if ($method['executableLines'] > 0 && $method['coverage'] == 100) { $this->numTestedMethods++; } } } } return $this->numTestedMethods; } /** * Returns the number of functions. * * @return integer */ public function getNumFunctions() { return count($this->functions); } /** * Returns the number of tested functions. * * @return integer */ public function getNumTestedFunctions() { if ($this->numTestedFunctions === NULL) { $this->numTestedFunctions = 0; foreach ($this->functions as $function) { if ($function['executableLines'] > 0 && $function['coverage'] == 100) { $this->numTestedFunctions++; } } } return $this->numTestedFunctions; } /** * Calculates coverage statistics for the file. */ protected function calculateStatistics() { if ($this->cacheTokens) { $tokens = PHP_Token_Stream_CachingFactory::get($this->getPath()); } else { $tokens = new PHP_Token_Stream($this->getPath()); } $this->processClasses($tokens); $this->processTraits($tokens); $this->processFunctions($tokens); $this->linesOfCode = $tokens->getLinesOfCode(); unset($tokens); for ($lineNumber = 1; $lineNumber <= $this->linesOfCode['loc']; $lineNumber++) { if (isset($this->startLines[$lineNumber])) { // Start line of a class. if (isset($this->startLines[$lineNumber]['className'])) { $currentClass = &$this->startLines[$lineNumber]; } // Start line of a trait. else if (isset($this->startLines[$lineNumber]['traitName'])) { $currentTrait = &$this->startLines[$lineNumber]; } // Start line of a method. else if (isset($this->startLines[$lineNumber]['methodName'])) { $currentMethod = &$this->startLines[$lineNumber]; } // Start line of a function. else if (isset($this->startLines[$lineNumber]['functionName'])) { $currentFunction = &$this->startLines[$lineNumber]; } } if (!isset($this->ignoredLines[$lineNumber]) && isset($this->coverageData[$lineNumber]) && $this->coverageData[$lineNumber] !== NULL) { if (isset($currentClass)) { $currentClass['executableLines']++; } if (isset($currentTrait)) { $currentTrait['executableLines']++; } if (isset($currentMethod)) { $currentMethod['executableLines']++; } if (isset($currentFunction)) { $currentFunction['executableLines']++; } $this->numExecutableLines++; if (count($this->coverageData[$lineNumber]) > 0 || isset($this->ignoredLines[$lineNumber])) { if (isset($currentClass)) { $currentClass['executedLines']++; } if (isset($currentTrait)) { $currentTrait['executedLines']++; } if (isset($currentMethod)) { $currentMethod['executedLines']++; } if (isset($currentFunction)) { $currentFunction['executedLines']++; } $this->numExecutedLines++; } } if (isset($this->endLines[$lineNumber])) { // End line of a class. if (isset($this->endLines[$lineNumber]['className'])) { unset($currentClass); } // End line of a trait. else if (isset($this->endLines[$lineNumber]['traitName'])) { unset($currentTrait); } // End line of a method. else if (isset($this->endLines[$lineNumber]['methodName'])) { unset($currentMethod); } // End line of a function. else if (isset($this->endLines[$lineNumber]['functionName'])) { unset($currentFunction); } } } foreach ($this->traits as &$trait) { foreach ($trait['methods'] as &$method) { if ($method['executableLines'] > 0) { $method['coverage'] = ($method['executedLines'] / $method['executableLines']) * 100; } else { $method['coverage'] = 100; } $method['crap'] = $this->crap( $method['ccn'], $method['coverage'] ); $trait['ccn'] += $method['ccn']; } if ($trait['executableLines'] > 0) { $trait['coverage'] = ($trait['executedLines'] / $trait['executableLines']) * 100; } else { $trait['coverage'] = 100; } if ($trait['coverage'] == 100) { $this->numTestedClasses++; } $trait['crap'] = $this->crap( $trait['ccn'], $trait['coverage'] ); } foreach ($this->classes as &$class) { foreach ($class['methods'] as &$method) { if ($method['executableLines'] > 0) { $method['coverage'] = ($method['executedLines'] / $method['executableLines']) * 100; } else { $method['coverage'] = 100; } $method['crap'] = $this->crap( $method['ccn'], $method['coverage'] ); $class['ccn'] += $method['ccn']; } if ($class['executableLines'] > 0) { $class['coverage'] = ($class['executedLines'] / $class['executableLines']) * 100; } else { $class['coverage'] = 100; } if ($class['coverage'] == 100) { $this->numTestedClasses++; } $class['crap'] = $this->crap( $class['ccn'], $class['coverage'] ); } } /** * @param PHP_Token_Stream $tokens */ protected function processClasses(PHP_Token_Stream $tokens) { $classes = $tokens->getClasses(); unset($tokens); $link = $this->getId() . '.html#'; foreach ($classes as $className => $class) { $this->classes[$className] = array( 'className' => $className, 'methods' => array(), 'startLine' => $class['startLine'], 'executableLines' => 0, 'executedLines' => 0, 'ccn' => 0, 'coverage' => 0, 'crap' => 0, 'package' => $class['package'], 'link' => $link . $class['startLine'] ); $this->startLines[$class['startLine']] = &$this->classes[$className]; $this->endLines[$class['endLine']] = &$this->classes[$className]; foreach ($class['methods'] as $methodName => $method) { $this->classes[$className]['methods'][$methodName] = array( 'methodName' => $methodName, 'signature' => $method['signature'], 'startLine' => $method['startLine'], 'endLine' => $method['endLine'], 'executableLines' => 0, 'executedLines' => 0, 'ccn' => $method['ccn'], 'coverage' => 0, 'crap' => 0, 'link' => $link . $method['startLine'] ); $this->startLines[$method['startLine']] = &$this->classes[$className]['methods'][$methodName]; $this->endLines[$method['endLine']] = &$this->classes[$className]['methods'][$methodName]; } } } /** * @param PHP_Token_Stream $tokens */ protected function processTraits(PHP_Token_Stream $tokens) { $traits = $tokens->getTraits(); unset($tokens); $link = $this->getId() . '.html#'; foreach ($traits as $traitName => $trait) { $this->traits[$traitName] = array( 'traitName' => $traitName, 'methods' => array(), 'startLine' => $trait['startLine'], 'executableLines' => 0, 'executedLines' => 0, 'ccn' => 0, 'coverage' => 0, 'crap' => 0, 'package' => $trait['package'], 'link' => $link . $trait['startLine'] ); $this->startLines[$trait['startLine']] = &$this->traits[$traitName]; $this->endLines[$trait['endLine']] = &$this->traits[$traitName]; foreach ($trait['methods'] as $methodName => $method) { $this->traits[$traitName]['methods'][$methodName] = array( 'methodName' => $methodName, 'signature' => $method['signature'], 'startLine' => $method['startLine'], 'endLine' => $method['endLine'], 'executableLines' => 0, 'executedLines' => 0, 'ccn' => $method['ccn'], 'coverage' => 0, 'crap' => 0, 'link' => $link . $method['startLine'] ); $this->startLines[$method['startLine']] = &$this->traits[$traitName]['methods'][$methodName]; $this->endLines[$method['endLine']] = &$this->traits[$traitName]['methods'][$methodName]; } } } /** * @param PHP_Token_Stream $tokens */ protected function processFunctions(PHP_Token_Stream $tokens) { $functions = $tokens->getFunctions(); unset($tokens); $link = $this->getId() . '.html#'; foreach ($functions as $functionName => $function) { $this->functions[$functionName] = array( 'functionName' => $functionName, 'signature' => $function['signature'], 'startLine' => $function['startLine'], 'executableLines' => 0, 'executedLines' => 0, 'ccn' => $function['ccn'], 'coverage' => 0, 'crap' => 0, 'link' => $link . $function['startLine'] ); $this->startLines[$function['startLine']] = &$this->functions[$functionName]; $this->endLines[$function['endLine']] = &$this->functions[$functionName]; } } /** * Calculates the Change Risk Anti-Patterns (CRAP) index for a unit of code * based on its cyclomatic complexity and percentage of code coverage. * * @param integer $ccn * @param float $coverage * @return string * @since Method available since Release 1.2.0 */ protected function crap($ccn, $coverage) { if ($coverage == 0) { return (string)pow($ccn, 2) + $ccn; } if ($coverage >= 95) { return (string)$ccn; } return sprintf( '%01.2F', pow($ccn, 2) * pow(1 - $coverage/100, 3) + $ccn ); } } tmpqGlp75/PHP_CodeCoverage-1.2.13/PHP/CodeCoverage/Report/HTML.php0000644013775000244210000001600212213552453024774 0ustar mparentdomain users. * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * * * Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * * * Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in * the documentation and/or other materials provided with the * distribution. * * * Neither the name of Sebastian Bergmann nor the names of his * contributors may be used to endorse or promote products derived * from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * POSSIBILITY OF SUCH DAMAGE. * * @category PHP * @package CodeCoverage * @author Sebastian Bergmann * @copyright 2009-2013 Sebastian Bergmann * @license http://www.opensource.org/licenses/BSD-3-Clause The BSD 3-Clause License * @link http://github.com/sebastianbergmann/php-code-coverage * @since File available since Release 1.0.0 */ /** * Generates an HTML report from an PHP_CodeCoverage object. * * @category PHP * @package CodeCoverage * @author Sebastian Bergmann * @copyright 2009-2013 Sebastian Bergmann * @license http://www.opensource.org/licenses/BSD-3-Clause The BSD 3-Clause License * @link http://github.com/sebastianbergmann/php-code-coverage * @since Class available since Release 1.0.0 */ class PHP_CodeCoverage_Report_HTML { /** * @var string */ protected $templatePath; /** * @var string */ protected $charset; /** * @var string */ protected $generator; /** * @var integer */ protected $lowUpperBound; /** * @var integer */ protected $highLowerBound; /** * @var boolean */ protected $highlight; /** * Constructor. * * @param array $options */ public function __construct($charset = 'UTF-8', $highlight = FALSE, $lowUpperBound = 35, $highLowerBound = 70, $generator = '') { $this->charset = $charset; $this->generator = $generator; $this->highLowerBound = $highLowerBound; $this->highlight = $highlight; $this->lowUpperBound = $lowUpperBound; $this->templatePath = sprintf( '%s%sHTML%sRenderer%sTemplate%s', dirname(__FILE__), DIRECTORY_SEPARATOR, DIRECTORY_SEPARATOR, DIRECTORY_SEPARATOR, DIRECTORY_SEPARATOR ); } /** * @param PHP_CodeCoverage $coverage * @param string $target */ public function process(PHP_CodeCoverage $coverage, $target) { $target = $this->getDirectory($target); $report = $coverage->getReport(); unset($coverage); if (!isset($_SERVER['REQUEST_TIME'])) { $_SERVER['REQUEST_TIME'] = time(); } $date = date('D M j G:i:s T Y', $_SERVER['REQUEST_TIME']); $dashboard = new PHP_CodeCoverage_Report_HTML_Renderer_Dashboard( $this->templatePath, $this->charset, $this->generator, $date, $this->lowUpperBound, $this->highLowerBound ); $directory = new PHP_CodeCoverage_Report_HTML_Renderer_Directory( $this->templatePath, $this->charset, $this->generator, $date, $this->lowUpperBound, $this->highLowerBound ); $file = new PHP_CodeCoverage_Report_HTML_Renderer_File( $this->templatePath, $this->charset, $this->generator, $date, $this->lowUpperBound, $this->highLowerBound, $this->highlight ); $dashboard->render($report, $target . 'index.dashboard.html'); $directory->render($report, $target . 'index.html'); foreach ($report as $node) { $id = $node->getId(); if ($node instanceof PHP_CodeCoverage_Report_Node_Directory) { $dashboard->render($node, $target . $id . '.dashboard.html'); $directory->render($node, $target . $id . '.html'); } else { $file->render($node, $target . $id . '.html'); } } $this->copyFiles($target); } /** * @param string $target */ protected function copyFiles($target) { $dir = $this->getDirectory($target . 'css'); copy($this->templatePath . 'css/bootstrap.min.css', $dir . 'bootstrap.min.css'); copy($this->templatePath . 'css/bootstrap-responsive.min.css', $dir . 'bootstrap-responsive.min.css'); copy($this->templatePath . 'css/style.css', $dir . 'style.css'); $dir = $this->getDirectory($target . 'js'); copy($this->templatePath . 'js/bootstrap.min.js', $dir . 'bootstrap.min.js'); copy($this->templatePath . 'js/highcharts.js', $dir . 'highcharts.js'); copy($this->templatePath . 'js/jquery.min.js', $dir . 'jquery.min.js'); copy($this->templatePath . 'js/html5shiv.js', $dir . 'html5shiv.js'); $dir = $this->getDirectory($target . 'img'); copy($this->templatePath . 'img/glyphicons-halflings.png', $dir . 'glyphicons-halflings.png'); copy($this->templatePath . 'img/glyphicons-halflings-white.png', $dir . 'glyphicons-halflings-white.png'); } /** * @param string $directory * @return string * @throws PHP_CodeCoverage_Exception * @since Method available since Release 1.2.0 */ protected function getDirectory($directory) { if (substr($directory, -1, 1) != DIRECTORY_SEPARATOR) { $directory .= DIRECTORY_SEPARATOR; } if (is_dir($directory)) { return $directory; } if (@mkdir($directory, 0777, TRUE)) { return $directory; } throw new PHP_CodeCoverage_Exception( sprintf( 'Directory "%s" does not exist.', $directory ) ); } } tmpqGlp75/PHP_CodeCoverage-1.2.13/PHP/CodeCoverage/Report/Factory.php0000644013775000244210000001746212213552453025652 0ustar mparentdomain users. * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * * * Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * * * Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in * the documentation and/or other materials provided with the * distribution. * * * Neither the name of Sebastian Bergmann nor the names of his * contributors may be used to endorse or promote products derived * from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * POSSIBILITY OF SUCH DAMAGE. * * @category PHP * @package CodeCoverage * @author Sebastian Bergmann * @copyright 2009-2013 Sebastian Bergmann * @license http://www.opensource.org/licenses/BSD-3-Clause The BSD 3-Clause License * @link http://github.com/sebastianbergmann/php-code-coverage * @since File available since Release 1.1.0 */ /** * Factory for PHP_CodeCoverage_Report_Node_* object graphs. * * @category PHP * @package CodeCoverage * @author Sebastian Bergmann * @copyright 2009-2013 Sebastian Bergmann * @license http://www.opensource.org/licenses/BSD-3-Clause The BSD 3-Clause License * @link http://github.com/sebastianbergmann/php-code-coverage * @since Class available since Release 1.1.0 */ class PHP_CodeCoverage_Report_Factory { /** * @param PHP_CodeCoverage $coverage */ public function create(PHP_CodeCoverage $coverage) { $files = $coverage->getData(); $commonPath = $this->reducePaths($files); $root = new PHP_CodeCoverage_Report_Node_Directory( $commonPath, NULL ); $this->addItems( $root, $this->buildDirectoryStructure($files), $coverage->getTests(), $coverage->getCacheTokens() ); return $root; } /** * @param PHP_CodeCoverage_Report_Node_Directory $root * @param array $items * @param array $tests * @param boolean $cacheTokens */ protected function addItems(PHP_CodeCoverage_Report_Node_Directory $root, array $items, array $tests, $cacheTokens) { foreach ($items as $key => $value) { if (substr($key, -2) == '/f') { $key = substr($key, 0, -2); if (file_exists($root->getPath() . DIRECTORY_SEPARATOR . $key)) { $root->addFile($key, $value, $tests, $cacheTokens); } } else { $child = $root->addDirectory($key); $this->addItems($child, $value, $tests, $cacheTokens); } } } /** * Builds an array representation of the directory structure. * * For instance, * * * Array * ( * [Money.php] => Array * ( * ... * ) * * [MoneyBag.php] => Array * ( * ... * ) * ) * * * is transformed into * * * Array * ( * [.] => Array * ( * [Money.php] => Array * ( * ... * ) * * [MoneyBag.php] => Array * ( * ... * ) * ) * ) * * * @param array $files * @return array */ protected function buildDirectoryStructure($files) { $result = array(); foreach ($files as $path => $file) { $path = explode('/', $path); $pointer = &$result; $max = count($path); for ($i = 0; $i < $max; $i++) { if ($i == ($max - 1)) { $type = '/f'; } else { $type = ''; } $pointer = &$pointer[$path[$i] . $type]; } $pointer = $file; } return $result; } /** * Reduces the paths by cutting the longest common start path. * * For instance, * * * Array * ( * [/home/sb/Money/Money.php] => Array * ( * ... * ) * * [/home/sb/Money/MoneyBag.php] => Array * ( * ... * ) * ) * * * is reduced to * * * Array * ( * [Money.php] => Array * ( * ... * ) * * [MoneyBag.php] => Array * ( * ... * ) * ) * * * @param array $files * @return string */ protected function reducePaths(&$files) { if (empty($files)) { return '.'; } $commonPath = ''; $paths = array_keys($files); if (count($files) == 1) { $commonPath = dirname($paths[0]) . '/'; $files[basename($paths[0])] = $files[$paths[0]]; unset($files[$paths[0]]); return $commonPath; } $max = count($paths); for ($i = 0; $i < $max; $i++) { // strip phar:// prefixes if (strpos($paths[$i], 'phar://') === 0) { $paths[$i] = substr($paths[$i], 7); } $paths[$i] = explode(DIRECTORY_SEPARATOR, $paths[$i]); if (empty($paths[$i][0])) { $paths[$i][0] = DIRECTORY_SEPARATOR; } } $done = FALSE; $max = count($paths); while (!$done) { for ($i = 0; $i < $max - 1; $i++) { if (!isset($paths[$i][0]) || !isset($paths[$i+1][0]) || $paths[$i][0] != $paths[$i+1][0]) { $done = TRUE; break; } } if (!$done) { $commonPath .= $paths[0][0]; if ($paths[0][0] != DIRECTORY_SEPARATOR) { $commonPath .= DIRECTORY_SEPARATOR; } for ($i = 0; $i < $max; $i++) { array_shift($paths[$i]); } } } $original = array_keys($files); $max = count($original); for ($i = 0; $i < $max; $i++) { $files[join('/', $paths[$i])] = $files[$original[$i]]; unset($files[$original[$i]]); } ksort($files); return substr($commonPath, 0, -1); } } tmpqGlp75/PHP_CodeCoverage-1.2.13/PHP/CodeCoverage/Report/HTML/0000755013775000244210000000000012263233104024256 5ustar mparentdomain userstmpqGlp75/PHP_CodeCoverage-1.2.13/PHP/CodeCoverage/Report/HTML/Renderer.php0000644013775000244210000002161012213552453026543 0ustar mparentdomain users. * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * * * Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * * * Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in * the documentation and/or other materials provided with the * distribution. * * * Neither the name of Sebastian Bergmann nor the names of his * contributors may be used to endorse or promote products derived * from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * POSSIBILITY OF SUCH DAMAGE. * * @category PHP * @package CodeCoverage * @author Sebastian Bergmann * @copyright 2009-2013 Sebastian Bergmann * @license http://www.opensource.org/licenses/BSD-3-Clause The BSD 3-Clause License * @link http://github.com/sebastianbergmann/php-code-coverage * @since File available since Release 1.1.0 */ /** * Base class for PHP_CodeCoverage_Report_Node renderers. * * @category PHP * @package CodeCoverage * @author Sebastian Bergmann * @copyright 2009-2013 Sebastian Bergmann * @license http://www.opensource.org/licenses/BSD-3-Clause The BSD 3-Clause License * @link http://github.com/sebastianbergmann/php-code-coverage * @since Class available since Release 1.1.0 */ abstract class PHP_CodeCoverage_Report_HTML_Renderer { /** * @var string */ protected $templatePath; /** * @var string */ protected $charset; /** * @var string */ protected $generator; /** * @var string */ protected $date; /** * @var integer */ protected $lowUpperBound; /** * @var integer */ protected $highLowerBound; /** * Constructor. * * @param string $templatePath * @param string $charset * @param string $generator * @param string $date * @param integer $lowUpperBound * @param integer $highLowerBound */ public function __construct($templatePath, $charset, $generator, $date, $lowUpperBound, $highLowerBound) { $this->templatePath = $templatePath; $this->charset = $charset; $this->generator = $generator; $this->date = $date; $this->lowUpperBound = $lowUpperBound; $this->highLowerBound = $highLowerBound; } /** * @param Text_Template $template * @param array $data * @return string */ protected function renderItemTemplate(Text_Template $template, array $data) { $numSeperator = ' / '; $classesBar = ' '; $classesLevel = 'None'; $classesNumber = ' '; if (isset($data['numClasses']) && $data['numClasses'] > 0) { $classesLevel = $this->getColorLevel($data['testedClassesPercent']); $classesNumber = $data['numTestedClasses'] . $numSeperator . $data['numClasses']; $classesBar = $this->getCoverageBar( $data['testedClassesPercent'] ); } $methodsBar = ' '; $methodsLevel = 'None'; $methodsNumber = ' '; if ($data['numMethods'] > 0) { $methodsLevel = $this->getColorLevel($data['testedMethodsPercent']); $methodsNumber = $data['numTestedMethods'] . $numSeperator . $data['numMethods']; $methodsBar = $this->getCoverageBar( $data['testedMethodsPercent'] ); } $linesBar = ' '; $linesLevel = 'None'; $linesNumber = ' '; if ($data['numExecutableLines'] > 0) { $linesLevel = $this->getColorLevel($data['linesExecutedPercent']); $linesNumber = $data['numExecutedLines'] . $numSeperator . $data['numExecutableLines']; $linesBar = $this->getCoverageBar( $data['linesExecutedPercent'] ); } $template->setVar( array( 'icon' => isset($data['icon']) ? $data['icon'] : '', 'crap' => isset($data['crap']) ? $data['crap'] : '', 'name' => $data['name'], 'lines_bar' => $linesBar, 'lines_executed_percent' => $data['linesExecutedPercentAsString'], 'lines_level' => $linesLevel, 'lines_number' => $linesNumber, 'methods_bar' => $methodsBar, 'methods_tested_percent' => $data['testedMethodsPercentAsString'], 'methods_level' => $methodsLevel, 'methods_number' => $methodsNumber, 'classes_bar' => $classesBar, 'classes_tested_percent' => isset($data['testedClassesPercentAsString']) ? $data['testedClassesPercentAsString'] : '', 'classes_level' => $classesLevel, 'classes_number' => $classesNumber ) ); return $template->render(); } /** * @param Text_Template $template * @param PHP_CodeCoverage_Report_Node $node */ protected function setCommonTemplateVariables(Text_Template $template, PHP_CodeCoverage_Report_Node $node) { $template->setVar( array( 'id' => $node->getId(), 'full_path' => $node->getPath(), 'breadcrumbs' => $this->getBreadcrumbs($node), 'charset' => $this->charset, 'date' => $this->date, 'version' => PHP_CodeCoverage_Version::id(), 'php_version' => PHP_VERSION, 'generator' => $this->generator, 'low_upper_bound' => $this->lowUpperBound, 'high_lower_bound' => $this->highLowerBound ) ); } protected function getBreadcrumbs(PHP_CodeCoverage_Report_Node $node) { $breadcrumbs = ''; $path = $node->getPathAsArray(); foreach ($path as $step) { if ($step !== $node) { $breadcrumbs .= $this->getInactiveBreadcrumb($step); } else { $breadcrumbs .= $this->getActiveBreadcrumb( $step, $node instanceof PHP_CodeCoverage_Report_Node_Directory ); } } return $breadcrumbs; } protected function getActiveBreadcrumb(PHP_CodeCoverage_Report_Node $node, $isDirectory) { $buffer = sprintf( '
  • %s
  • ' . "\n", $node->getName() ); if ($isDirectory) { $buffer .= sprintf( '
  • (Dashboard)
  • ' . "\n", $node->getId() ); } return $buffer; } protected function getInactiveBreadcrumb(PHP_CodeCoverage_Report_Node $node) { return sprintf( '
  • %s /
  • ' . "\n", $node->getId(), $node->getName() ); } protected function getCoverageBar($percent) { $level = $this->getColorLevel($percent); $template = new Text_Template( $this->templatePath . 'coverage_bar.html' ); $template->setVar(array('level' => $level, 'percent' => sprintf("%.2F", $percent))); return $template->render(); } /** * @param integer $percent * @return string */ protected function getColorLevel($percent) { if ($percent < $this->lowUpperBound) { return 'danger'; } else if ($percent >= $this->lowUpperBound && $percent < $this->highLowerBound) { return 'warning'; } else { return 'success'; } } } tmpqGlp75/PHP_CodeCoverage-1.2.13/PHP/CodeCoverage/Report/HTML/Renderer/0000755013775000244210000000000012263233104026024 5ustar mparentdomain userstmpqGlp75/PHP_CodeCoverage-1.2.13/PHP/CodeCoverage/Report/HTML/Renderer/Directory.php0000644013775000244210000001221612213552453030511 0ustar mparentdomain users. * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * * * Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * * * Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in * the documentation and/or other materials provided with the * distribution. * * * Neither the name of Sebastian Bergmann nor the names of his * contributors may be used to endorse or promote products derived * from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * POSSIBILITY OF SUCH DAMAGE. * * @category PHP * @package CodeCoverage * @author Sebastian Bergmann * @copyright 2009-2013 Sebastian Bergmann * @license http://www.opensource.org/licenses/BSD-3-Clause The BSD 3-Clause License * @link http://github.com/sebastianbergmann/php-code-coverage * @since File available since Release 1.1.0 */ /** * Renders a PHP_CodeCoverage_Report_Node_Directory node. * * @category PHP * @package CodeCoverage * @author Sebastian Bergmann * @copyright 2009-2013 Sebastian Bergmann * @license http://www.opensource.org/licenses/BSD-3-Clause The BSD 3-Clause License * @link http://github.com/sebastianbergmann/php-code-coverage * @since Class available since Release 1.1.0 */ class PHP_CodeCoverage_Report_HTML_Renderer_Directory extends PHP_CodeCoverage_Report_HTML_Renderer { /** * @param PHP_CodeCoverage_Report_Node_Directory $node * @param string $file */ public function render(PHP_CodeCoverage_Report_Node_Directory $node, $file) { $template = new Text_Template($this->templatePath . 'directory.html'); $this->setCommonTemplateVariables($template, $node); $items = $this->renderItem($node, TRUE); foreach ($node->getDirectories() as $item) { $items .= $this->renderItem($item); } foreach ($node->getFiles() as $item) { $items .= $this->renderItem($item); } $template->setVar( array( 'id' => $node->getId(), 'items' => $items ) ); $template->renderTo($file); } /** * @param PHP_CodeCoverage_Report_Node $item * @param boolean $total * @return string */ protected function renderItem(PHP_CodeCoverage_Report_Node $item, $total = FALSE) { $data = array( 'numClasses' => $item->getNumClassesAndTraits(), 'numTestedClasses' => $item->getNumTestedClassesAndTraits(), 'numMethods' => $item->getNumMethods(), 'numTestedMethods' => $item->getNumTestedMethods(), 'linesExecutedPercent' => $item->getLineExecutedPercent(FALSE), 'linesExecutedPercentAsString' => $item->getLineExecutedPercent(), 'numExecutedLines' => $item->getNumExecutedLines(), 'numExecutableLines' => $item->getNumExecutableLines(), 'testedMethodsPercent' => $item->getTestedMethodsPercent(FALSE), 'testedMethodsPercentAsString' => $item->getTestedMethodsPercent(), 'testedClassesPercent' => $item->getTestedClassesAndTraitsPercent(FALSE), 'testedClassesPercentAsString' => $item->getTestedClassesAndTraitsPercent() ); if ($total) { $data['name'] = 'Total'; } else { $data['name'] = sprintf( '%s', $item->getId(), $item->getName() ); if ($item instanceof PHP_CodeCoverage_Report_Node_Directory) { $data['icon'] = ' '; } else { $data['icon'] = ' '; } } return $this->renderItemTemplate( new Text_Template($this->templatePath . 'directory_item.html'), $data ); } } tmpqGlp75/PHP_CodeCoverage-1.2.13/PHP/CodeCoverage/Report/HTML/Renderer/Template/0000755013775000244210000000000012263233104027577 5ustar mparentdomain users././@LongLink0000000000000000000000000000015000000000000011561 Lustar rootroottmpqGlp75/PHP_CodeCoverage-1.2.13/PHP/CodeCoverage/Report/HTML/Renderer/Template/coverage_bar.html.disttmpqGlp75/PHP_CodeCoverage-1.2.13/PHP/CodeCoverage/Report/HTML/Renderer/Template/coverage_bar.html.d0000644013775000244210000000021612213552453033333 0ustar mparentdomain users
    tmpqGlp75/PHP_CodeCoverage-1.2.13/PHP/CodeCoverage/Report/HTML/Renderer/Template/js/0000755013775000244210000000000012263233104030213 5ustar mparentdomain userstmpqGlp75/PHP_CodeCoverage-1.2.13/PHP/CodeCoverage/Report/HTML/Renderer/Template/js/html5shiv.js0000644013775000244210000000451012213552453032502 0ustar mparentdomain users/* HTML5 Shiv v3.6.2pre | @afarkas @jdalton @jon_neal @rem | MIT/GPL2 Licensed */ (function(l,f){function m(){var a=e.elements;return"string"==typeof a?a.split(" "):a}function i(a){var b=n[a[o]];b||(b={},h++,a[o]=h,n[h]=b);return b}function p(a,b,c){b||(b=f);if(g)return b.createElement(a);c||(c=i(b));b=c.cache[a]?c.cache[a].cloneNode():r.test(a)?(c.cache[a]=c.createElem(a)).cloneNode():c.createElem(a);return b.canHaveChildren&&!s.test(a)?c.frag.appendChild(b):b}function t(a,b){if(!b.cache)b.cache={},b.createElem=a.createElement,b.createFrag=a.createDocumentFragment,b.frag=b.createFrag(); a.createElement=function(c){return!e.shivMethods?b.createElem(c):p(c,a,b)};a.createDocumentFragment=Function("h,f","return function(){var n=f.cloneNode(),c=n.createElement;h.shivMethods&&("+m().join().replace(/\w+/g,function(a){b.createElem(a);b.frag.createElement(a);return'c("'+a+'")'})+");return n}")(e,b.frag)}function q(a){a||(a=f);var b=i(a);if(e.shivCSS&&!j&&!b.hasCSS){var c,d=a;c=d.createElement("p");d=d.getElementsByTagName("head")[0]||d.documentElement;c.innerHTML="x"; c=d.insertBefore(c.lastChild,d.firstChild);b.hasCSS=!!c}g||t(a,b);return a}var k=l.html5||{},s=/^<|^(?:button|map|select|textarea|object|iframe|option|optgroup)$/i,r=/^(?:a|b|code|div|fieldset|h1|h2|h3|h4|h5|h6|i|label|li|ol|p|q|span|strong|style|table|tbody|td|th|tr|ul)$/i,j,o="_html5shiv",h=0,n={},g;(function(){try{var a=f.createElement("a");a.innerHTML="";j="hidden"in a;var b;if(!(b=1==a.childNodes.length)){f.createElement("a");var c=f.createDocumentFragment();b="undefined"==typeof c.cloneNode|| "undefined"==typeof c.createDocumentFragment||"undefined"==typeof c.createElement}g=b}catch(d){g=j=!0}})();var e={elements:k.elements||"abbr article aside audio bdi canvas data datalist details figcaption figure footer header hgroup mark meter nav output progress section summary time video",version:"3.6.2pre",shivCSS:!1!==k.shivCSS,supportsUnknownElements:g,shivMethods:!1!==k.shivMethods,type:"default",shivDocument:q,createElement:p,createDocumentFragment:function(a,b){a||(a=f);if(g)return a.createDocumentFragment(); for(var b=b||i(a),c=b.frag.cloneNode(),d=0,e=m(),h=e.length;dchildren.length-1||0>pos))return this.sliding?this.$element.one("slid",function(){that.to(pos)}):activePos==pos?this.pause().cycle():this.slide(pos>activePos?"next":"prev",$(children[pos]))},pause:function(e){return e||(this.paused=!0),this.$element.find(".next, .prev").length&&$.support.transition.end&&(this.$element.trigger($.support.transition.end),this.cycle()),clearInterval(this.interval),this.interval=null,this},next:function(){return this.sliding?void 0:this.slide("next")},prev:function(){return this.sliding?void 0:this.slide("prev")},slide:function(type,next){var e,$active=this.$element.find(".item.active"),$next=next||$active[type](),isCycling=this.interval,direction="next"==type?"left":"right",fallback="next"==type?"first":"last",that=this;if(this.sliding=!0,isCycling&&this.pause(),$next=$next.length?$next:this.$element.find(".item")[fallback](),e=$.Event("slide",{relatedTarget:$next[0]}),!$next.hasClass("active")){if($.support.transition&&this.$element.hasClass("slide")){if(this.$element.trigger(e),e.isDefaultPrevented())return;$next.addClass(type),$next[0].offsetWidth,$active.addClass(direction),$next.addClass(direction),this.$element.one($.support.transition.end,function(){$next.removeClass([type,direction].join(" ")).addClass("active"),$active.removeClass(["active",direction].join(" ")),that.sliding=!1,setTimeout(function(){that.$element.trigger("slid")},0)})}else{if(this.$element.trigger(e),e.isDefaultPrevented())return;$active.removeClass("active"),$next.addClass("active"),this.sliding=!1,this.$element.trigger("slid")}return isCycling&&this.cycle(),this}}};var old=$.fn.carousel;$.fn.carousel=function(option){return this.each(function(){var $this=$(this),data=$this.data("carousel"),options=$.extend({},$.fn.carousel.defaults,"object"==typeof option&&option),action="string"==typeof option?option:options.slide;data||$this.data("carousel",data=new Carousel(this,options)),"number"==typeof option?data.to(option):action?data[action]():options.interval&&data.cycle()})},$.fn.carousel.defaults={interval:5e3,pause:"hover"},$.fn.carousel.Constructor=Carousel,$.fn.carousel.noConflict=function(){return $.fn.carousel=old,this},$(document).on("click.carousel.data-api","[data-slide]",function(e){var href,$this=$(this),$target=$($this.attr("data-target")||(href=$this.attr("href"))&&href.replace(/.*(?=#[^\s]+$)/,"")),options=$.extend({},$target.data(),$this.data());$target.carousel(options),e.preventDefault()})}(window.jQuery),!function($){"use strict";var Collapse=function(element,options){this.$element=$(element),this.options=$.extend({},$.fn.collapse.defaults,options),this.options.parent&&(this.$parent=$(this.options.parent)),this.options.toggle&&this.toggle()};Collapse.prototype={constructor:Collapse,dimension:function(){var hasWidth=this.$element.hasClass("width");return hasWidth?"width":"height"},show:function(){var dimension,scroll,actives,hasData;if(!this.transitioning){if(dimension=this.dimension(),scroll=$.camelCase(["scroll",dimension].join("-")),actives=this.$parent&&this.$parent.find("> .accordion-group > .in"),actives&&actives.length){if(hasData=actives.data("collapse"),hasData&&hasData.transitioning)return;actives.collapse("hide"),hasData||actives.data("collapse",null)}this.$element[dimension](0),this.transition("addClass",$.Event("show"),"shown"),$.support.transition&&this.$element[dimension](this.$element[0][scroll])}},hide:function(){var dimension;this.transitioning||(dimension=this.dimension(),this.reset(this.$element[dimension]()),this.transition("removeClass",$.Event("hide"),"hidden"),this.$element[dimension](0))},reset:function(size){var dimension=this.dimension();return this.$element.removeClass("collapse")[dimension](size||"auto")[0].offsetWidth,this.$element[null!==size?"addClass":"removeClass"]("collapse"),this},transition:function(method,startEvent,completeEvent){var that=this,complete=function(){"show"==startEvent.type&&that.reset(),that.transitioning=0,that.$element.trigger(completeEvent)};this.$element.trigger(startEvent),startEvent.isDefaultPrevented()||(this.transitioning=1,this.$element[method]("in"),$.support.transition&&this.$element.hasClass("collapse")?this.$element.one($.support.transition.end,complete):complete())},toggle:function(){this[this.$element.hasClass("in")?"hide":"show"]()}};var old=$.fn.collapse;$.fn.collapse=function(option){return this.each(function(){var $this=$(this),data=$this.data("collapse"),options="object"==typeof option&&option;data||$this.data("collapse",data=new Collapse(this,options)),"string"==typeof option&&data[option]()})},$.fn.collapse.defaults={toggle:!0},$.fn.collapse.Constructor=Collapse,$.fn.collapse.noConflict=function(){return $.fn.collapse=old,this},$(document).on("click.collapse.data-api","[data-toggle=collapse]",function(e){var href,$this=$(this),target=$this.attr("data-target")||e.preventDefault()||(href=$this.attr("href"))&&href.replace(/.*(?=#[^\s]+$)/,""),option=$(target).data("collapse")?"toggle":$this.data();$this[$(target).hasClass("in")?"addClass":"removeClass"]("collapsed"),$(target).collapse(option)})}(window.jQuery),!function($){"use strict";function clearMenus(){$(toggle).each(function(){getParent($(this)).removeClass("open")})}function getParent($this){var $parent,selector=$this.attr("data-target");return selector||(selector=$this.attr("href"),selector=selector&&/#/.test(selector)&&selector.replace(/.*(?=#[^\s]*$)/,"")),$parent=$(selector),$parent.length||($parent=$this.parent()),$parent}var toggle="[data-toggle=dropdown]",Dropdown=function(element){var $el=$(element).on("click.dropdown.data-api",this.toggle);$("html").on("click.dropdown.data-api",function(){$el.parent().removeClass("open")})};Dropdown.prototype={constructor:Dropdown,toggle:function(){var $parent,isActive,$this=$(this);if(!$this.is(".disabled, :disabled"))return $parent=getParent($this),isActive=$parent.hasClass("open"),clearMenus(),isActive||$parent.toggleClass("open"),$this.focus(),!1},keydown:function(e){var $this,$items,$parent,isActive,index;if(/(38|40|27)/.test(e.keyCode)&&($this=$(this),e.preventDefault(),e.stopPropagation(),!$this.is(".disabled, :disabled"))){if($parent=getParent($this),isActive=$parent.hasClass("open"),!isActive||isActive&&27==e.keyCode)return $this.click();$items=$("[role=menu] li:not(.divider):visible a",$parent),$items.length&&(index=$items.index($items.filter(":focus")),38==e.keyCode&&index>0&&index--,40==e.keyCode&&$items.length-1>index&&index++,~index||(index=0),$items.eq(index).focus())}}};var old=$.fn.dropdown;$.fn.dropdown=function(option){return this.each(function(){var $this=$(this),data=$this.data("dropdown");data||$this.data("dropdown",data=new Dropdown(this)),"string"==typeof option&&data[option].call($this)})},$.fn.dropdown.Constructor=Dropdown,$.fn.dropdown.noConflict=function(){return $.fn.dropdown=old,this},$(document).on("click.dropdown.data-api touchstart.dropdown.data-api",clearMenus).on("click.dropdown touchstart.dropdown.data-api",".dropdown form",function(e){e.stopPropagation()}).on("touchstart.dropdown.data-api",".dropdown-menu",function(e){e.stopPropagation()}).on("click.dropdown.data-api touchstart.dropdown.data-api",toggle,Dropdown.prototype.toggle).on("keydown.dropdown.data-api touchstart.dropdown.data-api",toggle+", [role=menu]",Dropdown.prototype.keydown)}(window.jQuery),!function($){"use strict";var Modal=function(element,options){this.options=options,this.$element=$(element).delegate('[data-dismiss="modal"]',"click.dismiss.modal",$.proxy(this.hide,this)),this.options.remote&&this.$element.find(".modal-body").load(this.options.remote)};Modal.prototype={constructor:Modal,toggle:function(){return this[this.isShown?"hide":"show"]()},show:function(){var that=this,e=$.Event("show");this.$element.trigger(e),this.isShown||e.isDefaultPrevented()||(this.isShown=!0,this.escape(),this.backdrop(function(){var transition=$.support.transition&&that.$element.hasClass("fade");that.$element.parent().length||that.$element.appendTo(document.body),that.$element.show(),transition&&that.$element[0].offsetWidth,that.$element.addClass("in").attr("aria-hidden",!1),that.enforceFocus(),transition?that.$element.one($.support.transition.end,function(){that.$element.focus().trigger("shown")}):that.$element.focus().trigger("shown")}))},hide:function(e){e&&e.preventDefault(),e=$.Event("hide"),this.$element.trigger(e),this.isShown&&!e.isDefaultPrevented()&&(this.isShown=!1,this.escape(),$(document).off("focusin.modal"),this.$element.removeClass("in").attr("aria-hidden",!0),$.support.transition&&this.$element.hasClass("fade")?this.hideWithTransition():this.hideModal())},enforceFocus:function(){var that=this;$(document).on("focusin.modal",function(e){that.$element[0]===e.target||that.$element.has(e.target).length||that.$element.focus()})},escape:function(){var that=this;this.isShown&&this.options.keyboard?this.$element.on("keyup.dismiss.modal",function(e){27==e.which&&that.hide()}):this.isShown||this.$element.off("keyup.dismiss.modal")},hideWithTransition:function(){var that=this,timeout=setTimeout(function(){that.$element.off($.support.transition.end),that.hideModal()},500);this.$element.one($.support.transition.end,function(){clearTimeout(timeout),that.hideModal()})},hideModal:function(){this.$element.hide().trigger("hidden"),this.backdrop()},removeBackdrop:function(){this.$backdrop.remove(),this.$backdrop=null},backdrop:function(callback){var animate=this.$element.hasClass("fade")?"fade":"";if(this.isShown&&this.options.backdrop){var doAnimate=$.support.transition&&animate;this.$backdrop=$('