+ * Array
+ * (
+ * [Money.php] => Array
+ * (
+ * ...
+ * )
+ *
+ * [MoneyBag.php] => Array
+ * (
+ * ...
+ * )
+ * )
+ *
+ *
+ * is transformed into
+ *
+ *
+ * Array
+ * (
+ * [.] => Array
+ * (
+ * [Money.php] => Array
+ * (
+ * ...
+ * )
+ *
+ * [MoneyBag.php] => Array
+ * (
+ * ...
+ * )
+ * )
+ * )
+ *
+ */
+ private function buildDirectoryStructure(array $files): array
+ {
+ $result = [];
+
+ foreach ($files as $path => $file) {
+ $path = \explode(\DIRECTORY_SEPARATOR, $path);
+ $pointer = &$result;
+ $max = \count($path);
+
+ for ($i = 0; $i < $max; $i++) {
+ $type = '';
+
+ if ($i === ($max - 1)) {
+ $type = '/f';
+ }
+
+ $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
+ * (
+ * ...
+ * )
+ * )
+ *
+ */
+ private function reducePaths(array &$files): string
+ {
+ if (empty($files)) {
+ return '.';
+ }
+
+ $commonPath = '';
+ $paths = \array_keys($files);
+
+ if (\count($files) === 1) {
+ $commonPath = \dirname($paths[0]) . \DIRECTORY_SEPARATOR;
+ $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] = \str_replace('/', \DIRECTORY_SEPARATOR, $paths[$i]);
+ }
+ $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[\implode(\DIRECTORY_SEPARATOR, $paths[$i])] = $files[$original[$i]];
+ unset($files[$original[$i]]);
+ }
+
+ \ksort($files);
+
+ return \substr($commonPath, 0, -1);
+ }
+}
diff --git a/app/assets/zxcvbn-php-master/vendor/phpunit/php-code-coverage/src/Node/Directory.php b/app/assets/zxcvbn-php-master/vendor/phpunit/php-code-coverage/src/Node/Directory.php
new file mode 100644
index 0000000..7f1b5b2
--- /dev/null
+++ b/app/assets/zxcvbn-php-master/vendor/phpunit/php-code-coverage/src/Node/Directory.php
@@ -0,0 +1,427 @@
+
+ *
+ * For the full copyright and license information, please view the LICENSE
+ * file that was distributed with this source code.
+ */
+namespace SebastianBergmann\CodeCoverage\Node;
+
+use SebastianBergmann\CodeCoverage\InvalidArgumentException;
+
+/**
+ * Represents a directory in the code coverage information tree.
+ */
+final class Directory extends AbstractNode implements \IteratorAggregate
+{
+ /**
+ * @var AbstractNode[]
+ */
+ private $children = [];
+
+ /**
+ * @var Directory[]
+ */
+ private $directories = [];
+
+ /**
+ * @var File[]
+ */
+ private $files = [];
+
+ /**
+ * @var array
+ */
+ private $classes;
+
+ /**
+ * @var array
+ */
+ private $traits;
+
+ /**
+ * @var array
+ */
+ private $functions;
+
+ /**
+ * @var array
+ */
+ private $linesOfCode;
+
+ /**
+ * @var int
+ */
+ private $numFiles = -1;
+
+ /**
+ * @var int
+ */
+ private $numExecutableLines = -1;
+
+ /**
+ * @var int
+ */
+ private $numExecutedLines = -1;
+
+ /**
+ * @var int
+ */
+ private $numClasses = -1;
+
+ /**
+ * @var int
+ */
+ private $numTestedClasses = -1;
+
+ /**
+ * @var int
+ */
+ private $numTraits = -1;
+
+ /**
+ * @var int
+ */
+ private $numTestedTraits = -1;
+
+ /**
+ * @var int
+ */
+ private $numMethods = -1;
+
+ /**
+ * @var int
+ */
+ private $numTestedMethods = -1;
+
+ /**
+ * @var int
+ */
+ private $numFunctions = -1;
+
+ /**
+ * @var int
+ */
+ private $numTestedFunctions = -1;
+
+ /**
+ * Returns the number of files in/under this node.
+ */
+ public function count(): int
+ {
+ 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.
+ */
+ public function getIterator(): \RecursiveIteratorIterator
+ {
+ return new \RecursiveIteratorIterator(
+ new Iterator($this),
+ \RecursiveIteratorIterator::SELF_FIRST
+ );
+ }
+
+ /**
+ * Adds a new directory.
+ */
+ public function addDirectory(string $name): self
+ {
+ $directory = new self($name, $this);
+
+ $this->children[] = $directory;
+ $this->directories[] = &$this->children[\count($this->children) - 1];
+
+ return $directory;
+ }
+
+ /**
+ * Adds a new file.
+ *
+ * @throws InvalidArgumentException
+ */
+ public function addFile(string $name, array $coverageData, array $testData, bool $cacheTokens): File
+ {
+ $file = new 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.
+ */
+ public function getDirectories(): array
+ {
+ return $this->directories;
+ }
+
+ /**
+ * Returns the files in this directory.
+ */
+ public function getFiles(): array
+ {
+ return $this->files;
+ }
+
+ /**
+ * Returns the child nodes of this node.
+ */
+ public function getChildNodes(): array
+ {
+ return $this->children;
+ }
+
+ /**
+ * Returns the classes of this node.
+ */
+ public function getClasses(): array
+ {
+ if ($this->classes === null) {
+ $this->classes = [];
+
+ foreach ($this->children as $child) {
+ $this->classes = \array_merge(
+ $this->classes,
+ $child->getClasses()
+ );
+ }
+ }
+
+ return $this->classes;
+ }
+
+ /**
+ * Returns the traits of this node.
+ */
+ public function getTraits(): array
+ {
+ if ($this->traits === null) {
+ $this->traits = [];
+
+ foreach ($this->children as $child) {
+ $this->traits = \array_merge(
+ $this->traits,
+ $child->getTraits()
+ );
+ }
+ }
+
+ return $this->traits;
+ }
+
+ /**
+ * Returns the functions of this node.
+ */
+ public function getFunctions(): array
+ {
+ if ($this->functions === null) {
+ $this->functions = [];
+
+ foreach ($this->children as $child) {
+ $this->functions = \array_merge(
+ $this->functions,
+ $child->getFunctions()
+ );
+ }
+ }
+
+ return $this->functions;
+ }
+
+ /**
+ * Returns the LOC/CLOC/NCLOC of this node.
+ */
+ public function getLinesOfCode(): array
+ {
+ if ($this->linesOfCode === null) {
+ $this->linesOfCode = ['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.
+ */
+ public function getNumExecutableLines(): int
+ {
+ 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.
+ */
+ public function getNumExecutedLines(): int
+ {
+ if ($this->numExecutedLines === -1) {
+ $this->numExecutedLines = 0;
+
+ foreach ($this->children as $child) {
+ $this->numExecutedLines += $child->getNumExecutedLines();
+ }
+ }
+
+ return $this->numExecutedLines;
+ }
+
+ /**
+ * Returns the number of classes.
+ */
+ public function getNumClasses(): int
+ {
+ 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.
+ */
+ public function getNumTestedClasses(): int
+ {
+ if ($this->numTestedClasses === -1) {
+ $this->numTestedClasses = 0;
+
+ foreach ($this->children as $child) {
+ $this->numTestedClasses += $child->getNumTestedClasses();
+ }
+ }
+
+ return $this->numTestedClasses;
+ }
+
+ /**
+ * Returns the number of traits.
+ */
+ public function getNumTraits(): int
+ {
+ 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.
+ */
+ public function getNumTestedTraits(): int
+ {
+ if ($this->numTestedTraits === -1) {
+ $this->numTestedTraits = 0;
+
+ foreach ($this->children as $child) {
+ $this->numTestedTraits += $child->getNumTestedTraits();
+ }
+ }
+
+ return $this->numTestedTraits;
+ }
+
+ /**
+ * Returns the number of methods.
+ */
+ public function getNumMethods(): int
+ {
+ 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.
+ */
+ public function getNumTestedMethods(): int
+ {
+ if ($this->numTestedMethods === -1) {
+ $this->numTestedMethods = 0;
+
+ foreach ($this->children as $child) {
+ $this->numTestedMethods += $child->getNumTestedMethods();
+ }
+ }
+
+ return $this->numTestedMethods;
+ }
+
+ /**
+ * Returns the number of functions.
+ */
+ public function getNumFunctions(): int
+ {
+ 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.
+ */
+ public function getNumTestedFunctions(): int
+ {
+ if ($this->numTestedFunctions === -1) {
+ $this->numTestedFunctions = 0;
+
+ foreach ($this->children as $child) {
+ $this->numTestedFunctions += $child->getNumTestedFunctions();
+ }
+ }
+
+ return $this->numTestedFunctions;
+ }
+}
diff --git a/app/assets/zxcvbn-php-master/vendor/phpunit/php-code-coverage/src/Node/File.php b/app/assets/zxcvbn-php-master/vendor/phpunit/php-code-coverage/src/Node/File.php
new file mode 100644
index 0000000..840d119
--- /dev/null
+++ b/app/assets/zxcvbn-php-master/vendor/phpunit/php-code-coverage/src/Node/File.php
@@ -0,0 +1,611 @@
+
+ *
+ * For the full copyright and license information, please view the LICENSE
+ * file that was distributed with this source code.
+ */
+namespace SebastianBergmann\CodeCoverage\Node;
+
+/**
+ * Represents a file in the code coverage information tree.
+ */
+final class File extends AbstractNode
+{
+ /**
+ * @var array
+ */
+ private $coverageData;
+
+ /**
+ * @var array
+ */
+ private $testData;
+
+ /**
+ * @var int
+ */
+ private $numExecutableLines = 0;
+
+ /**
+ * @var int
+ */
+ private $numExecutedLines = 0;
+
+ /**
+ * @var array
+ */
+ private $classes = [];
+
+ /**
+ * @var array
+ */
+ private $traits = [];
+
+ /**
+ * @var array
+ */
+ private $functions = [];
+
+ /**
+ * @var array
+ */
+ private $linesOfCode = [];
+
+ /**
+ * @var int
+ */
+ private $numClasses;
+
+ /**
+ * @var int
+ */
+ private $numTestedClasses = 0;
+
+ /**
+ * @var int
+ */
+ private $numTraits;
+
+ /**
+ * @var int
+ */
+ private $numTestedTraits = 0;
+
+ /**
+ * @var int
+ */
+ private $numMethods;
+
+ /**
+ * @var int
+ */
+ private $numTestedMethods;
+
+ /**
+ * @var int
+ */
+ private $numTestedFunctions;
+
+ /**
+ * @var bool
+ */
+ private $cacheTokens;
+
+ /**
+ * @var array
+ */
+ private $codeUnitsByLine = [];
+
+ public function __construct(string $name, AbstractNode $parent, array $coverageData, array $testData, bool $cacheTokens)
+ {
+ parent::__construct($name, $parent);
+
+ $this->coverageData = $coverageData;
+ $this->testData = $testData;
+ $this->cacheTokens = $cacheTokens;
+
+ $this->calculateStatistics();
+ }
+
+ /**
+ * Returns the number of files in/under this node.
+ */
+ public function count(): int
+ {
+ return 1;
+ }
+
+ /**
+ * Returns the code coverage data of this node.
+ */
+ public function getCoverageData(): array
+ {
+ return $this->coverageData;
+ }
+
+ /**
+ * Returns the test data of this node.
+ */
+ public function getTestData(): array
+ {
+ return $this->testData;
+ }
+
+ /**
+ * Returns the classes of this node.
+ */
+ public function getClasses(): array
+ {
+ return $this->classes;
+ }
+
+ /**
+ * Returns the traits of this node.
+ */
+ public function getTraits(): array
+ {
+ return $this->traits;
+ }
+
+ /**
+ * Returns the functions of this node.
+ */
+ public function getFunctions(): array
+ {
+ return $this->functions;
+ }
+
+ /**
+ * Returns the LOC/CLOC/NCLOC of this node.
+ */
+ public function getLinesOfCode(): array
+ {
+ return $this->linesOfCode;
+ }
+
+ /**
+ * Returns the number of executable lines.
+ */
+ public function getNumExecutableLines(): int
+ {
+ return $this->numExecutableLines;
+ }
+
+ /**
+ * Returns the number of executed lines.
+ */
+ public function getNumExecutedLines(): int
+ {
+ return $this->numExecutedLines;
+ }
+
+ /**
+ * Returns the number of classes.
+ */
+ public function getNumClasses(): int
+ {
+ if ($this->numClasses === null) {
+ $this->numClasses = 0;
+
+ foreach ($this->classes as $class) {
+ foreach ($class['methods'] as $method) {
+ if ($method['executableLines'] > 0) {
+ $this->numClasses++;
+
+ continue 2;
+ }
+ }
+ }
+ }
+
+ return $this->numClasses;
+ }
+
+ /**
+ * Returns the number of tested classes.
+ */
+ public function getNumTestedClasses(): int
+ {
+ return $this->numTestedClasses;
+ }
+
+ /**
+ * Returns the number of traits.
+ */
+ public function getNumTraits(): int
+ {
+ if ($this->numTraits === null) {
+ $this->numTraits = 0;
+
+ foreach ($this->traits as $trait) {
+ foreach ($trait['methods'] as $method) {
+ if ($method['executableLines'] > 0) {
+ $this->numTraits++;
+
+ continue 2;
+ }
+ }
+ }
+ }
+
+ return $this->numTraits;
+ }
+
+ /**
+ * Returns the number of tested traits.
+ */
+ public function getNumTestedTraits(): int
+ {
+ return $this->numTestedTraits;
+ }
+
+ /**
+ * Returns the number of methods.
+ */
+ public function getNumMethods(): int
+ {
+ 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.
+ */
+ public function getNumTestedMethods(): int
+ {
+ 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.
+ */
+ public function getNumFunctions(): int
+ {
+ return \count($this->functions);
+ }
+
+ /**
+ * Returns the number of tested functions.
+ */
+ public function getNumTestedFunctions(): int
+ {
+ if ($this->numTestedFunctions === null) {
+ $this->numTestedFunctions = 0;
+
+ foreach ($this->functions as $function) {
+ if ($function['executableLines'] > 0 &&
+ $function['coverage'] === 100) {
+ $this->numTestedFunctions++;
+ }
+ }
+ }
+
+ return $this->numTestedFunctions;
+ }
+
+ private function calculateStatistics(): void
+ {
+ if ($this->cacheTokens) {
+ $tokens = \PHP_Token_Stream_CachingFactory::get($this->getPath());
+ } else {
+ $tokens = new \PHP_Token_Stream($this->getPath());
+ }
+
+ $this->linesOfCode = $tokens->getLinesOfCode();
+
+ foreach (\range(1, $this->linesOfCode['loc']) as $lineNumber) {
+ $this->codeUnitsByLine[$lineNumber] = [];
+ }
+
+ try {
+ $this->processClasses($tokens);
+ $this->processTraits($tokens);
+ $this->processFunctions($tokens);
+ } catch (\OutOfBoundsException $e) {
+ // This can happen with PHP_Token_Stream if the file is syntactically invalid,
+ // and probably affects a file that wasn't executed.
+ }
+ unset($tokens);
+
+ foreach (\range(1, $this->linesOfCode['loc']) as $lineNumber) {
+ if (isset($this->coverageData[$lineNumber])) {
+ foreach ($this->codeUnitsByLine[$lineNumber] as &$codeUnit) {
+ $codeUnit['executableLines']++;
+ }
+
+ unset($codeUnit);
+
+ $this->numExecutableLines++;
+
+ if (\count($this->coverageData[$lineNumber]) > 0) {
+ foreach ($this->codeUnitsByLine[$lineNumber] as &$codeUnit) {
+ $codeUnit['executedLines']++;
+ }
+
+ unset($codeUnit);
+
+ $this->numExecutedLines++;
+ }
+ }
+ }
+
+ 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'];
+ }
+
+ unset($method);
+
+ if ($trait['executableLines'] > 0) {
+ $trait['coverage'] = ($trait['executedLines'] /
+ $trait['executableLines']) * 100;
+
+ if ($trait['coverage'] === 100) {
+ $this->numTestedClasses++;
+ }
+ } else {
+ $trait['coverage'] = 100;
+ }
+
+ $trait['crap'] = $this->crap(
+ $trait['ccn'],
+ $trait['coverage']
+ );
+ }
+
+ unset($trait);
+
+ 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'];
+ }
+
+ unset($method);
+
+ if ($class['executableLines'] > 0) {
+ $class['coverage'] = ($class['executedLines'] /
+ $class['executableLines']) * 100;
+
+ if ($class['coverage'] === 100) {
+ $this->numTestedClasses++;
+ }
+ } else {
+ $class['coverage'] = 100;
+ }
+
+ $class['crap'] = $this->crap(
+ $class['ccn'],
+ $class['coverage']
+ );
+ }
+
+ unset($class);
+
+ foreach ($this->functions as &$function) {
+ if ($function['executableLines'] > 0) {
+ $function['coverage'] = ($function['executedLines'] /
+ $function['executableLines']) * 100;
+ } else {
+ $function['coverage'] = 100;
+ }
+
+ if ($function['coverage'] === 100) {
+ $this->numTestedFunctions++;
+ }
+
+ $function['crap'] = $this->crap(
+ $function['ccn'],
+ $function['coverage']
+ );
+ }
+ }
+
+ private function processClasses(\PHP_Token_Stream $tokens): void
+ {
+ $classes = $tokens->getClasses();
+ $link = $this->getId() . '.html#';
+
+ foreach ($classes as $className => $class) {
+ if (\strpos($className, 'anonymous') === 0) {
+ continue;
+ }
+
+ if (!empty($class['package']['namespace'])) {
+ $className = $class['package']['namespace'] . '\\' . $className;
+ }
+
+ $this->classes[$className] = [
+ 'className' => $className,
+ 'methods' => [],
+ 'startLine' => $class['startLine'],
+ 'executableLines' => 0,
+ 'executedLines' => 0,
+ 'ccn' => 0,
+ 'coverage' => 0,
+ 'crap' => 0,
+ 'package' => $class['package'],
+ 'link' => $link . $class['startLine'],
+ ];
+
+ foreach ($class['methods'] as $methodName => $method) {
+ if (\strpos($methodName, 'anonymous') === 0) {
+ continue;
+ }
+
+ $this->classes[$className]['methods'][$methodName] = $this->newMethod($methodName, $method, $link);
+
+ foreach (\range($method['startLine'], $method['endLine']) as $lineNumber) {
+ $this->codeUnitsByLine[$lineNumber] = [
+ &$this->classes[$className],
+ &$this->classes[$className]['methods'][$methodName],
+ ];
+ }
+ }
+ }
+ }
+
+ private function processTraits(\PHP_Token_Stream $tokens): void
+ {
+ $traits = $tokens->getTraits();
+ $link = $this->getId() . '.html#';
+
+ foreach ($traits as $traitName => $trait) {
+ $this->traits[$traitName] = [
+ 'traitName' => $traitName,
+ 'methods' => [],
+ 'startLine' => $trait['startLine'],
+ 'executableLines' => 0,
+ 'executedLines' => 0,
+ 'ccn' => 0,
+ 'coverage' => 0,
+ 'crap' => 0,
+ 'package' => $trait['package'],
+ 'link' => $link . $trait['startLine'],
+ ];
+
+ foreach ($trait['methods'] as $methodName => $method) {
+ if (\strpos($methodName, 'anonymous') === 0) {
+ continue;
+ }
+
+ $this->traits[$traitName]['methods'][$methodName] = $this->newMethod($methodName, $method, $link);
+
+ foreach (\range($method['startLine'], $method['endLine']) as $lineNumber) {
+ $this->codeUnitsByLine[$lineNumber] = [
+ &$this->traits[$traitName],
+ &$this->traits[$traitName]['methods'][$methodName],
+ ];
+ }
+ }
+ }
+ }
+
+ private function processFunctions(\PHP_Token_Stream $tokens): void
+ {
+ $functions = $tokens->getFunctions();
+ $link = $this->getId() . '.html#';
+
+ foreach ($functions as $functionName => $function) {
+ if (\strpos($functionName, 'anonymous') === 0) {
+ continue;
+ }
+
+ $this->functions[$functionName] = [
+ 'functionName' => $functionName,
+ 'signature' => $function['signature'],
+ 'startLine' => $function['startLine'],
+ 'executableLines' => 0,
+ 'executedLines' => 0,
+ 'ccn' => $function['ccn'],
+ 'coverage' => 0,
+ 'crap' => 0,
+ 'link' => $link . $function['startLine'],
+ ];
+
+ foreach (\range($function['startLine'], $function['endLine']) as $lineNumber) {
+ $this->codeUnitsByLine[$lineNumber] = [&$this->functions[$functionName]];
+ }
+ }
+ }
+
+ private function crap(int $ccn, float $coverage): string
+ {
+ if ($coverage === 0.0) {
+ return (string) ($ccn ** 2 + $ccn);
+ }
+
+ if ($coverage >= 95) {
+ return (string) $ccn;
+ }
+
+ return \sprintf(
+ '%01.2F',
+ $ccn ** 2 * (1 - $coverage / 100) ** 3 + $ccn
+ );
+ }
+
+ private function newMethod(string $methodName, array $method, string $link): array
+ {
+ return [
+ 'methodName' => $methodName,
+ 'visibility' => $method['visibility'],
+ 'signature' => $method['signature'],
+ 'startLine' => $method['startLine'],
+ 'endLine' => $method['endLine'],
+ 'executableLines' => 0,
+ 'executedLines' => 0,
+ 'ccn' => $method['ccn'],
+ 'coverage' => 0,
+ 'crap' => 0,
+ 'link' => $link . $method['startLine'],
+ ];
+ }
+}
diff --git a/app/assets/zxcvbn-php-master/vendor/phpunit/php-code-coverage/src/Node/Iterator.php b/app/assets/zxcvbn-php-master/vendor/phpunit/php-code-coverage/src/Node/Iterator.php
new file mode 100644
index 0000000..f2dd9a7
--- /dev/null
+++ b/app/assets/zxcvbn-php-master/vendor/phpunit/php-code-coverage/src/Node/Iterator.php
@@ -0,0 +1,89 @@
+
+ *
+ * For the full copyright and license information, please view the LICENSE
+ * file that was distributed with this source code.
+ */
+namespace SebastianBergmann\CodeCoverage\Node;
+
+/**
+ * Recursive iterator for node object graphs.
+ */
+final class Iterator implements \RecursiveIterator
+{
+ /**
+ * @var int
+ */
+ private $position;
+
+ /**
+ * @var AbstractNode[]
+ */
+ private $nodes;
+
+ public function __construct(Directory $node)
+ {
+ $this->nodes = $node->getChildNodes();
+ }
+
+ /**
+ * Rewinds the Iterator to the first element.
+ */
+ public function rewind(): void
+ {
+ $this->position = 0;
+ }
+
+ /**
+ * Checks if there is a current element after calls to rewind() or next().
+ */
+ public function valid(): bool
+ {
+ return $this->position < \count($this->nodes);
+ }
+
+ /**
+ * Returns the key of the current element.
+ */
+ public function key(): int
+ {
+ return $this->position;
+ }
+
+ /**
+ * Returns the current element.
+ */
+ public function current(): AbstractNode
+ {
+ return $this->valid() ? $this->nodes[$this->position] : null;
+ }
+
+ /**
+ * Moves forward to next element.
+ */
+ public function next(): void
+ {
+ $this->position++;
+ }
+
+ /**
+ * Returns the sub iterator for the current element.
+ *
+ * @return Iterator
+ */
+ public function getChildren(): self
+ {
+ return new self($this->nodes[$this->position]);
+ }
+
+ /**
+ * Checks whether the current element has children.
+ */
+ public function hasChildren(): bool
+ {
+ return $this->nodes[$this->position] instanceof Directory;
+ }
+}
diff --git a/app/assets/zxcvbn-php-master/vendor/phpunit/php-code-coverage/src/Report/Clover.php b/app/assets/zxcvbn-php-master/vendor/phpunit/php-code-coverage/src/Report/Clover.php
new file mode 100644
index 0000000..e0f893c
--- /dev/null
+++ b/app/assets/zxcvbn-php-master/vendor/phpunit/php-code-coverage/src/Report/Clover.php
@@ -0,0 +1,258 @@
+
+ *
+ * For the full copyright and license information, please view the LICENSE
+ * file that was distributed with this source code.
+ */
+namespace SebastianBergmann\CodeCoverage\Report;
+
+use SebastianBergmann\CodeCoverage\CodeCoverage;
+use SebastianBergmann\CodeCoverage\Node\File;
+use SebastianBergmann\CodeCoverage\RuntimeException;
+
+/**
+ * Generates a Clover XML logfile from a code coverage object.
+ */
+final class Clover
+{
+ /**
+ * @throws \RuntimeException
+ */
+ public function process(CodeCoverage $coverage, ?string $target = null, ?string $name = null): string
+ {
+ $xmlDocument = new \DOMDocument('1.0', 'UTF-8');
+ $xmlDocument->formatOutput = true;
+
+ $xmlCoverage = $xmlDocument->createElement('coverage');
+ $xmlCoverage->setAttribute('generated', (string) $_SERVER['REQUEST_TIME']);
+ $xmlDocument->appendChild($xmlCoverage);
+
+ $xmlProject = $xmlDocument->createElement('project');
+ $xmlProject->setAttribute('timestamp', (string) $_SERVER['REQUEST_TIME']);
+
+ if (\is_string($name)) {
+ $xmlProject->setAttribute('name', $name);
+ }
+
+ $xmlCoverage->appendChild($xmlProject);
+
+ $packages = [];
+ $report = $coverage->getReport();
+
+ foreach ($report as $item) {
+ if (!$item instanceof File) {
+ continue;
+ }
+
+ /* @var File $item */
+
+ $xmlFile = $xmlDocument->createElement('file');
+ $xmlFile->setAttribute('name', $item->getPath());
+
+ $classes = $item->getClassesAndTraits();
+ $coverageData = $item->getCoverageData();
+ $lines = [];
+ $namespace = 'global';
+
+ foreach ($classes as $className => $class) {
+ $classStatements = 0;
+ $coveredClassStatements = 0;
+ $coveredMethods = 0;
+ $classMethods = 0;
+
+ foreach ($class['methods'] as $methodName => $method) {
+ if ($method['executableLines'] == 0) {
+ continue;
+ }
+
+ $classMethods++;
+ $classStatements += $method['executableLines'];
+ $coveredClassStatements += $method['executedLines'];
+
+ if ($method['coverage'] == 100) {
+ $coveredMethods++;
+ }
+
+ $methodCount = 0;
+
+ foreach (\range($method['startLine'], $method['endLine']) as $line) {
+ if (isset($coverageData[$line]) && ($coverageData[$line] !== null)) {
+ $methodCount = \max($methodCount, \count($coverageData[$line]));
+ }
+ }
+
+ $lines[$method['startLine']] = [
+ 'ccn' => $method['ccn'],
+ 'count' => $methodCount,
+ 'crap' => $method['crap'],
+ 'type' => 'method',
+ 'visibility' => $method['visibility'],
+ 'name' => $methodName,
+ ];
+ }
+
+ if (!empty($class['package']['namespace'])) {
+ $namespace = $class['package']['namespace'];
+ }
+
+ $xmlClass = $xmlDocument->createElement('class');
+ $xmlClass->setAttribute('name', $className);
+ $xmlClass->setAttribute('namespace', $namespace);
+
+ if (!empty($class['package']['fullPackage'])) {
+ $xmlClass->setAttribute(
+ 'fullPackage',
+ $class['package']['fullPackage']
+ );
+ }
+
+ if (!empty($class['package']['category'])) {
+ $xmlClass->setAttribute(
+ 'category',
+ $class['package']['category']
+ );
+ }
+
+ if (!empty($class['package']['package'])) {
+ $xmlClass->setAttribute(
+ 'package',
+ $class['package']['package']
+ );
+ }
+
+ if (!empty($class['package']['subpackage'])) {
+ $xmlClass->setAttribute(
+ 'subpackage',
+ $class['package']['subpackage']
+ );
+ }
+
+ $xmlFile->appendChild($xmlClass);
+
+ $xmlMetrics = $xmlDocument->createElement('metrics');
+ $xmlMetrics->setAttribute('complexity', (string) $class['ccn']);
+ $xmlMetrics->setAttribute('methods', (string) $classMethods);
+ $xmlMetrics->setAttribute('coveredmethods', (string) $coveredMethods);
+ $xmlMetrics->setAttribute('conditionals', '0');
+ $xmlMetrics->setAttribute('coveredconditionals', '0');
+ $xmlMetrics->setAttribute('statements', (string) $classStatements);
+ $xmlMetrics->setAttribute('coveredstatements', (string) $coveredClassStatements);
+ $xmlMetrics->setAttribute('elements', (string) ($classMethods + $classStatements /* + conditionals */));
+ $xmlMetrics->setAttribute('coveredelements', (string) ($coveredMethods + $coveredClassStatements /* + coveredconditionals */));
+ $xmlClass->appendChild($xmlMetrics);
+ }
+
+ foreach ($coverageData as $line => $data) {
+ if ($data === null || isset($lines[$line])) {
+ continue;
+ }
+
+ $lines[$line] = [
+ 'count' => \count($data), 'type' => 'stmt',
+ ];
+ }
+
+ \ksort($lines);
+
+ foreach ($lines as $line => $data) {
+ $xmlLine = $xmlDocument->createElement('line');
+ $xmlLine->setAttribute('num', (string) $line);
+ $xmlLine->setAttribute('type', $data['type']);
+
+ if (isset($data['name'])) {
+ $xmlLine->setAttribute('name', $data['name']);
+ }
+
+ if (isset($data['visibility'])) {
+ $xmlLine->setAttribute('visibility', $data['visibility']);
+ }
+
+ if (isset($data['ccn'])) {
+ $xmlLine->setAttribute('complexity', (string) $data['ccn']);
+ }
+
+ if (isset($data['crap'])) {
+ $xmlLine->setAttribute('crap', (string) $data['crap']);
+ }
+
+ $xmlLine->setAttribute('count', (string) $data['count']);
+ $xmlFile->appendChild($xmlLine);
+ }
+
+ $linesOfCode = $item->getLinesOfCode();
+
+ $xmlMetrics = $xmlDocument->createElement('metrics');
+ $xmlMetrics->setAttribute('loc', (string) $linesOfCode['loc']);
+ $xmlMetrics->setAttribute('ncloc', (string) $linesOfCode['ncloc']);
+ $xmlMetrics->setAttribute('classes', (string) $item->getNumClassesAndTraits());
+ $xmlMetrics->setAttribute('methods', (string) $item->getNumMethods());
+ $xmlMetrics->setAttribute('coveredmethods', (string) $item->getNumTestedMethods());
+ $xmlMetrics->setAttribute('conditionals', '0');
+ $xmlMetrics->setAttribute('coveredconditionals', '0');
+ $xmlMetrics->setAttribute('statements', (string) $item->getNumExecutableLines());
+ $xmlMetrics->setAttribute('coveredstatements', (string) $item->getNumExecutedLines());
+ $xmlMetrics->setAttribute('elements', (string) ($item->getNumMethods() + $item->getNumExecutableLines() /* + conditionals */));
+ $xmlMetrics->setAttribute('coveredelements', (string) ($item->getNumTestedMethods() + $item->getNumExecutedLines() /* + coveredconditionals */));
+ $xmlFile->appendChild($xmlMetrics);
+
+ if ($namespace === 'global') {
+ $xmlProject->appendChild($xmlFile);
+ } else {
+ if (!isset($packages[$namespace])) {
+ $packages[$namespace] = $xmlDocument->createElement(
+ 'package'
+ );
+
+ $packages[$namespace]->setAttribute('name', $namespace);
+ $xmlProject->appendChild($packages[$namespace]);
+ }
+
+ $packages[$namespace]->appendChild($xmlFile);
+ }
+ }
+
+ $linesOfCode = $report->getLinesOfCode();
+
+ $xmlMetrics = $xmlDocument->createElement('metrics');
+ $xmlMetrics->setAttribute('files', (string) \count($report));
+ $xmlMetrics->setAttribute('loc', (string) $linesOfCode['loc']);
+ $xmlMetrics->setAttribute('ncloc', (string) $linesOfCode['ncloc']);
+ $xmlMetrics->setAttribute('classes', (string) $report->getNumClassesAndTraits());
+ $xmlMetrics->setAttribute('methods', (string) $report->getNumMethods());
+ $xmlMetrics->setAttribute('coveredmethods', (string) $report->getNumTestedMethods());
+ $xmlMetrics->setAttribute('conditionals', '0');
+ $xmlMetrics->setAttribute('coveredconditionals', '0');
+ $xmlMetrics->setAttribute('statements', (string) $report->getNumExecutableLines());
+ $xmlMetrics->setAttribute('coveredstatements', (string) $report->getNumExecutedLines());
+ $xmlMetrics->setAttribute('elements', (string) ($report->getNumMethods() + $report->getNumExecutableLines() /* + conditionals */));
+ $xmlMetrics->setAttribute('coveredelements', (string) ($report->getNumTestedMethods() + $report->getNumExecutedLines() /* + coveredconditionals */));
+ $xmlProject->appendChild($xmlMetrics);
+
+ $buffer = $xmlDocument->saveXML();
+
+ if ($target !== null) {
+ if (!$this->createDirectory(\dirname($target))) {
+ throw new \RuntimeException(\sprintf('Directory "%s" was not created', \dirname($target)));
+ }
+
+ if (@\file_put_contents($target, $buffer) === false) {
+ throw new RuntimeException(
+ \sprintf(
+ 'Could not write to "%s',
+ $target
+ )
+ );
+ }
+ }
+
+ return $buffer;
+ }
+
+ private function createDirectory(string $directory): bool
+ {
+ return !(!\is_dir($directory) && !@\mkdir($directory, 0777, true) && !\is_dir($directory));
+ }
+}
diff --git a/app/assets/zxcvbn-php-master/vendor/phpunit/php-code-coverage/src/Report/Crap4j.php b/app/assets/zxcvbn-php-master/vendor/phpunit/php-code-coverage/src/Report/Crap4j.php
new file mode 100644
index 0000000..6713be0
--- /dev/null
+++ b/app/assets/zxcvbn-php-master/vendor/phpunit/php-code-coverage/src/Report/Crap4j.php
@@ -0,0 +1,165 @@
+
+ *
+ * For the full copyright and license information, please view the LICENSE
+ * file that was distributed with this source code.
+ */
+namespace SebastianBergmann\CodeCoverage\Report;
+
+use SebastianBergmann\CodeCoverage\CodeCoverage;
+use SebastianBergmann\CodeCoverage\Node\File;
+use SebastianBergmann\CodeCoverage\RuntimeException;
+
+final class Crap4j
+{
+ /**
+ * @var int
+ */
+ private $threshold;
+
+ public function __construct(int $threshold = 30)
+ {
+ $this->threshold = $threshold;
+ }
+
+ /**
+ * @throws \RuntimeException
+ */
+ public function process(CodeCoverage $coverage, ?string $target = null, ?string $name = null): string
+ {
+ $document = new \DOMDocument('1.0', 'UTF-8');
+ $document->formatOutput = true;
+
+ $root = $document->createElement('crap_result');
+ $document->appendChild($root);
+
+ $project = $document->createElement('project', \is_string($name) ? $name : '');
+ $root->appendChild($project);
+ $root->appendChild($document->createElement('timestamp', \date('Y-m-d H:i:s', $_SERVER['REQUEST_TIME'])));
+
+ $stats = $document->createElement('stats');
+ $methodsNode = $document->createElement('methods');
+
+ $report = $coverage->getReport();
+ unset($coverage);
+
+ $fullMethodCount = 0;
+ $fullCrapMethodCount = 0;
+ $fullCrapLoad = 0;
+ $fullCrap = 0;
+
+ foreach ($report as $item) {
+ $namespace = 'global';
+
+ if (!$item instanceof File) {
+ continue;
+ }
+
+ $file = $document->createElement('file');
+ $file->setAttribute('name', $item->getPath());
+
+ $classes = $item->getClassesAndTraits();
+
+ foreach ($classes as $className => $class) {
+ foreach ($class['methods'] as $methodName => $method) {
+ $crapLoad = $this->getCrapLoad($method['crap'], $method['ccn'], $method['coverage']);
+
+ $fullCrap += $method['crap'];
+ $fullCrapLoad += $crapLoad;
+ $fullMethodCount++;
+
+ if ($method['crap'] >= $this->threshold) {
+ $fullCrapMethodCount++;
+ }
+
+ $methodNode = $document->createElement('method');
+
+ if (!empty($class['package']['namespace'])) {
+ $namespace = $class['package']['namespace'];
+ }
+
+ $methodNode->appendChild($document->createElement('package', $namespace));
+ $methodNode->appendChild($document->createElement('className', $className));
+ $methodNode->appendChild($document->createElement('methodName', $methodName));
+ $methodNode->appendChild($document->createElement('methodSignature', \htmlspecialchars($method['signature'])));
+ $methodNode->appendChild($document->createElement('fullMethod', \htmlspecialchars($method['signature'])));
+ $methodNode->appendChild($document->createElement('crap', (string) $this->roundValue($method['crap'])));
+ $methodNode->appendChild($document->createElement('complexity', (string) $method['ccn']));
+ $methodNode->appendChild($document->createElement('coverage', (string) $this->roundValue($method['coverage'])));
+ $methodNode->appendChild($document->createElement('crapLoad', (string) \round($crapLoad)));
+
+ $methodsNode->appendChild($methodNode);
+ }
+ }
+ }
+
+ $stats->appendChild($document->createElement('name', 'Method Crap Stats'));
+ $stats->appendChild($document->createElement('methodCount', (string) $fullMethodCount));
+ $stats->appendChild($document->createElement('crapMethodCount', (string) $fullCrapMethodCount));
+ $stats->appendChild($document->createElement('crapLoad', (string) \round($fullCrapLoad)));
+ $stats->appendChild($document->createElement('totalCrap', (string) $fullCrap));
+
+ $crapMethodPercent = 0;
+
+ if ($fullMethodCount > 0) {
+ $crapMethodPercent = $this->roundValue((100 * $fullCrapMethodCount) / $fullMethodCount);
+ }
+
+ $stats->appendChild($document->createElement('crapMethodPercent', (string) $crapMethodPercent));
+
+ $root->appendChild($stats);
+ $root->appendChild($methodsNode);
+
+ $buffer = $document->saveXML();
+
+ if ($target !== null) {
+ if (!$this->createDirectory(\dirname($target))) {
+ throw new \RuntimeException(\sprintf('Directory "%s" was not created', \dirname($target)));
+ }
+
+ if (@\file_put_contents($target, $buffer) === false) {
+ throw new RuntimeException(
+ \sprintf(
+ 'Could not write to "%s',
+ $target
+ )
+ );
+ }
+ }
+
+ return $buffer;
+ }
+
+ /**
+ * @param float $crapValue
+ * @param int $cyclomaticComplexity
+ * @param float $coveragePercent
+ */
+ private function getCrapLoad($crapValue, $cyclomaticComplexity, $coveragePercent): float
+ {
+ $crapLoad = 0;
+
+ if ($crapValue >= $this->threshold) {
+ $crapLoad += $cyclomaticComplexity * (1.0 - $coveragePercent / 100);
+ $crapLoad += $cyclomaticComplexity / $this->threshold;
+ }
+
+ return $crapLoad;
+ }
+
+ /**
+ * @param float $value
+ */
+ private function roundValue($value): float
+ {
+ return \round($value, 2);
+ }
+
+ private function createDirectory(string $directory): bool
+ {
+ return !(!\is_dir($directory) && !@\mkdir($directory, 0777, true) && !\is_dir($directory));
+ }
+}
diff --git a/app/assets/zxcvbn-php-master/vendor/phpunit/php-code-coverage/src/Report/Html/Facade.php b/app/assets/zxcvbn-php-master/vendor/phpunit/php-code-coverage/src/Report/Html/Facade.php
new file mode 100644
index 0000000..318b49a
--- /dev/null
+++ b/app/assets/zxcvbn-php-master/vendor/phpunit/php-code-coverage/src/Report/Html/Facade.php
@@ -0,0 +1,167 @@
+
+ *
+ * For the full copyright and license information, please view the LICENSE
+ * file that was distributed with this source code.
+ */
+namespace SebastianBergmann\CodeCoverage\Report\Html;
+
+use SebastianBergmann\CodeCoverage\CodeCoverage;
+use SebastianBergmann\CodeCoverage\Node\Directory as DirectoryNode;
+use SebastianBergmann\CodeCoverage\RuntimeException;
+
+/**
+ * Generates an HTML report from a code coverage object.
+ */
+final class Facade
+{
+ /**
+ * @var string
+ */
+ private $templatePath;
+
+ /**
+ * @var string
+ */
+ private $generator;
+
+ /**
+ * @var int
+ */
+ private $lowUpperBound;
+
+ /**
+ * @var int
+ */
+ private $highLowerBound;
+
+ public function __construct(int $lowUpperBound = 50, int $highLowerBound = 90, string $generator = '')
+ {
+ $this->generator = $generator;
+ $this->highLowerBound = $highLowerBound;
+ $this->lowUpperBound = $lowUpperBound;
+ $this->templatePath = __DIR__ . '/Renderer/Template/';
+ }
+
+ /**
+ * @throws RuntimeException
+ * @throws \InvalidArgumentException
+ * @throws \RuntimeException
+ */
+ public function process(CodeCoverage $coverage, string $target): void
+ {
+ $target = $this->getDirectory($target);
+ $report = $coverage->getReport();
+
+ if (!isset($_SERVER['REQUEST_TIME'])) {
+ $_SERVER['REQUEST_TIME'] = \time();
+ }
+
+ $date = \date('D M j G:i:s T Y', $_SERVER['REQUEST_TIME']);
+
+ $dashboard = new Dashboard(
+ $this->templatePath,
+ $this->generator,
+ $date,
+ $this->lowUpperBound,
+ $this->highLowerBound
+ );
+
+ $directory = new Directory(
+ $this->templatePath,
+ $this->generator,
+ $date,
+ $this->lowUpperBound,
+ $this->highLowerBound
+ );
+
+ $file = new File(
+ $this->templatePath,
+ $this->generator,
+ $date,
+ $this->lowUpperBound,
+ $this->highLowerBound
+ );
+
+ $directory->render($report, $target . 'index.html');
+ $dashboard->render($report, $target . 'dashboard.html');
+
+ foreach ($report as $node) {
+ $id = $node->getId();
+
+ if ($node instanceof DirectoryNode) {
+ if (!$this->createDirectory($target . $id)) {
+ throw new \RuntimeException(\sprintf('Directory "%s" was not created', $target . $id));
+ }
+
+ $directory->render($node, $target . $id . '/index.html');
+ $dashboard->render($node, $target . $id . '/dashboard.html');
+ } else {
+ $dir = \dirname($target . $id);
+
+ if (!$this->createDirectory($dir)) {
+ throw new \RuntimeException(\sprintf('Directory "%s" was not created', $dir));
+ }
+
+ $file->render($node, $target . $id . '.html');
+ }
+ }
+
+ $this->copyFiles($target);
+ }
+
+ /**
+ * @throws RuntimeException
+ */
+ private function copyFiles(string $target): void
+ {
+ $dir = $this->getDirectory($target . '_css');
+
+ \copy($this->templatePath . 'css/bootstrap.min.css', $dir . 'bootstrap.min.css');
+ \copy($this->templatePath . 'css/nv.d3.min.css', $dir . 'nv.d3.min.css');
+ \copy($this->templatePath . 'css/style.css', $dir . 'style.css');
+ \copy($this->templatePath . 'css/custom.css', $dir . 'custom.css');
+ \copy($this->templatePath . 'css/octicons.css', $dir . 'octicons.css');
+
+ $dir = $this->getDirectory($target . '_icons');
+ \copy($this->templatePath . 'icons/file-code.svg', $dir . 'file-code.svg');
+ \copy($this->templatePath . 'icons/file-directory.svg', $dir . 'file-directory.svg');
+
+ $dir = $this->getDirectory($target . '_js');
+ \copy($this->templatePath . 'js/bootstrap.min.js', $dir . 'bootstrap.min.js');
+ \copy($this->templatePath . 'js/popper.min.js', $dir . 'popper.min.js');
+ \copy($this->templatePath . 'js/d3.min.js', $dir . 'd3.min.js');
+ \copy($this->templatePath . 'js/jquery.min.js', $dir . 'jquery.min.js');
+ \copy($this->templatePath . 'js/nv.d3.min.js', $dir . 'nv.d3.min.js');
+ \copy($this->templatePath . 'js/file.js', $dir . 'file.js');
+ }
+
+ /**
+ * @throws RuntimeException
+ */
+ private function getDirectory(string $directory): string
+ {
+ if (\substr($directory, -1, 1) != \DIRECTORY_SEPARATOR) {
+ $directory .= \DIRECTORY_SEPARATOR;
+ }
+
+ if (!$this->createDirectory($directory)) {
+ throw new RuntimeException(
+ \sprintf(
+ 'Directory "%s" does not exist.',
+ $directory
+ )
+ );
+ }
+
+ return $directory;
+ }
+
+ private function createDirectory(string $directory): bool
+ {
+ return !(!\is_dir($directory) && !@\mkdir($directory, 0777, true) && !\is_dir($directory));
+ }
+}
diff --git a/app/assets/zxcvbn-php-master/vendor/phpunit/php-code-coverage/src/Report/Html/Renderer.php b/app/assets/zxcvbn-php-master/vendor/phpunit/php-code-coverage/src/Report/Html/Renderer.php
new file mode 100644
index 0000000..2a9024c
--- /dev/null
+++ b/app/assets/zxcvbn-php-master/vendor/phpunit/php-code-coverage/src/Report/Html/Renderer.php
@@ -0,0 +1,277 @@
+
+ *
+ * For the full copyright and license information, please view the LICENSE
+ * file that was distributed with this source code.
+ */
+namespace SebastianBergmann\CodeCoverage\Report\Html;
+
+use SebastianBergmann\CodeCoverage\Node\AbstractNode;
+use SebastianBergmann\CodeCoverage\Node\Directory as DirectoryNode;
+use SebastianBergmann\CodeCoverage\Node\File as FileNode;
+use SebastianBergmann\CodeCoverage\Version;
+use SebastianBergmann\Environment\Runtime;
+
+/**
+ * Base class for node renderers.
+ */
+abstract class Renderer
+{
+ /**
+ * @var string
+ */
+ protected $templatePath;
+
+ /**
+ * @var string
+ */
+ protected $generator;
+
+ /**
+ * @var string
+ */
+ protected $date;
+
+ /**
+ * @var int
+ */
+ protected $lowUpperBound;
+
+ /**
+ * @var int
+ */
+ protected $highLowerBound;
+
+ /**
+ * @var string
+ */
+ protected $version;
+
+ public function __construct(string $templatePath, string $generator, string $date, int $lowUpperBound, int $highLowerBound)
+ {
+ $this->templatePath = $templatePath;
+ $this->generator = $generator;
+ $this->date = $date;
+ $this->lowUpperBound = $lowUpperBound;
+ $this->highLowerBound = $highLowerBound;
+ $this->version = Version::id();
+ }
+
+ protected function renderItemTemplate(\Text_Template $template, array $data): string
+ {
+ $numSeparator = ' / ';
+
+ if (isset($data['numClasses']) && $data['numClasses'] > 0) {
+ $classesLevel = $this->getColorLevel($data['testedClassesPercent']);
+
+ $classesNumber = $data['numTestedClasses'] . $numSeparator .
+ $data['numClasses'];
+
+ $classesBar = $this->getCoverageBar(
+ $data['testedClassesPercent']
+ );
+ } else {
+ $classesLevel = '';
+ $classesNumber = '0' . $numSeparator . '0';
+ $classesBar = '';
+ $data['testedClassesPercentAsString'] = 'n/a';
+ }
+
+ if ($data['numMethods'] > 0) {
+ $methodsLevel = $this->getColorLevel($data['testedMethodsPercent']);
+
+ $methodsNumber = $data['numTestedMethods'] . $numSeparator .
+ $data['numMethods'];
+
+ $methodsBar = $this->getCoverageBar(
+ $data['testedMethodsPercent']
+ );
+ } else {
+ $methodsLevel = '';
+ $methodsNumber = '0' . $numSeparator . '0';
+ $methodsBar = '';
+ $data['testedMethodsPercentAsString'] = 'n/a';
+ }
+
+ if ($data['numExecutableLines'] > 0) {
+ $linesLevel = $this->getColorLevel($data['linesExecutedPercent']);
+
+ $linesNumber = $data['numExecutedLines'] . $numSeparator .
+ $data['numExecutableLines'];
+
+ $linesBar = $this->getCoverageBar(
+ $data['linesExecutedPercent']
+ );
+ } else {
+ $linesLevel = '';
+ $linesNumber = '0' . $numSeparator . '0';
+ $linesBar = '';
+ $data['linesExecutedPercentAsString'] = 'n/a';
+ }
+
+ $template->setVar(
+ [
+ 'icon' => $data['icon'] ?? '',
+ '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' => $data['testedClassesPercentAsString'] ?? '',
+ 'classes_level' => $classesLevel,
+ 'classes_number' => $classesNumber,
+ ]
+ );
+
+ return $template->render();
+ }
+
+ protected function setCommonTemplateVariables(\Text_Template $template, AbstractNode $node): void
+ {
+ $template->setVar(
+ [
+ 'id' => $node->getId(),
+ 'full_path' => $node->getPath(),
+ 'path_to_root' => $this->getPathToRoot($node),
+ 'breadcrumbs' => $this->getBreadcrumbs($node),
+ 'date' => $this->date,
+ 'version' => $this->version,
+ 'runtime' => $this->getRuntimeString(),
+ 'generator' => $this->generator,
+ 'low_upper_bound' => $this->lowUpperBound,
+ 'high_lower_bound' => $this->highLowerBound,
+ ]
+ );
+ }
+
+ protected function getBreadcrumbs(AbstractNode $node): string
+ {
+ $breadcrumbs = '';
+ $path = $node->getPathAsArray();
+ $pathToRoot = [];
+ $max = \count($path);
+
+ if ($node instanceof FileNode) {
+ $max--;
+ }
+
+ for ($i = 0; $i < $max; $i++) {
+ $pathToRoot[] = \str_repeat('../', $i);
+ }
+
+ foreach ($path as $step) {
+ if ($step !== $node) {
+ $breadcrumbs .= $this->getInactiveBreadcrumb(
+ $step,
+ \array_pop($pathToRoot)
+ );
+ } else {
+ $breadcrumbs .= $this->getActiveBreadcrumb($step);
+ }
+ }
+
+ return $breadcrumbs;
+ }
+
+ protected function getActiveBreadcrumb(AbstractNode $node): string
+ {
+ $buffer = \sprintf(
+ ' | Class | +Coverage | +
|---|
| Class | +CRAP | +
|---|
| Method | +Coverage | +
|---|
| Method | +CRAP | +
|---|
| + | Code Coverage |
+ ||||||||
| + | Lines |
+ Functions and Methods |
+ Classes and Traits |
+ ||||||
| + | Code Coverage |
+ |||||||||
| + | Classes and Traits |
+ Functions and Methods |
+ Lines |
+ |||||||