X-Git-Url: http://www.aleph1.co.uk/gitweb/?p=yaffs-website;a=blobdiff_plain;f=vendor%2Fbehat%2Fbehat%2Fsrc%2FBehat%2FTestwork%2FCounter%2FMemory.php;fp=vendor%2Fbehat%2Fbehat%2Fsrc%2FBehat%2FTestwork%2FCounter%2FMemory.php;h=0000000000000000000000000000000000000000;hp=f7d8605c1394921c62ca713d8cde1e79ef7eb5b4;hb=af6d1fb995500ae68849458ee10d66abbdcfb252;hpb=680c79a86e3ed402f263faeac92e89fb6d9edcc0 diff --git a/vendor/behat/behat/src/Behat/Testwork/Counter/Memory.php b/vendor/behat/behat/src/Behat/Testwork/Counter/Memory.php deleted file mode 100644 index f7d8605c1..000000000 --- a/vendor/behat/behat/src/Behat/Testwork/Counter/Memory.php +++ /dev/null @@ -1,62 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Behat\Testwork\Counter; - -/** - * Counts amount of system memory being used. - * - * @author Konstantin Kudryashov - */ -final class Memory -{ - /** - * @var string[] - */ - private $units = array('B', 'Kb', 'Mb', 'Gb', 'Tb'); - - /** - * Returns current memory usage. - * - * @return integer - */ - public function getMemoryUsage() - { - return memory_get_usage(); - } - - /** - * Presents memory usage in human-readable form. - * - * @return string - */ - public function __toString() - { - return $this->humanize($this->getMemoryUsage()); - } - - /** - * Humanizes usage information. - * - * @param integer $bytes - * - * @return string - */ - private function humanize($bytes) - { - $e = intval(floor(log($bytes) / log(1024))); - - if (!isset($this->units[$e])) { - return 'Can not calculate memory usage'; - } - - return sprintf('%.2f%s', ($bytes / pow(1024, floor($e))), $this->units[$e]); - } -}