From 0d46c22d3038eb342c460f0627b67208aed2211d Mon Sep 17 00:00:00 2001 From: Leonardo Vilarinho Date: Thu, 26 Oct 2017 03:34:26 +0000 Subject: [PATCH] fix bug developer metric and require filesystem --- composer.json | 5 +- composer.lock | 102 +++++++++++----------- source/Metrics/DevelopersMetric.php | 4 +- source/Program/ExportServices/IExport.php | 2 +- 4 files changed, 57 insertions(+), 56 deletions(-) diff --git a/composer.json b/composer.json index 32bde26..ee8550d 100644 --- a/composer.json +++ b/composer.json @@ -3,7 +3,7 @@ "type": "framework", "license": "GPL-3.0", "minimum-stability": "stable", - "version": "1.0.3", + "version": "1.0.4", "authors": [ { "name": "Leonardo Vilarinho", @@ -44,7 +44,8 @@ "symfony/yaml": "^3.3", "symfony/process": "^3.3", "symfony/console": "^3.3", - "duncan3dc/fork-helper": "^2.2" + "duncan3dc/fork-helper": "^2.2", + "symfony/filesystem": "^3.3" }, "require-dev": { "phpunit/phpunit": "^6.2", diff --git a/composer.lock b/composer.lock index 1091e86..6df0855 100644 --- a/composer.lock +++ b/composer.lock @@ -4,8 +4,8 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#composer-lock-the-lock-file", "This file is @generated automatically" ], - "hash": "fa88bcb487de9e6e4b25096ef15dacd5", - "content-hash": "dd896b1927f63a7506f9746bba57134a", + "hash": "97fde05aec9883c67e0eaee40381db7f", + "content-hash": "bbf093749f0f70bab1ec6be3487cb731", "packages": [ { "name": "duncan3dc/fork-helper", @@ -389,6 +389,55 @@ "homepage": "https://symfony.com", "time": "2017-10-02 06:42:24" }, + { + "name": "symfony/filesystem", + "version": "v3.3.10", + "source": { + "type": "git", + "url": "https://github.com/symfony/filesystem.git", + "reference": "90bc45abf02ae6b7deb43895c1052cb0038506f1" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/filesystem/zipball/90bc45abf02ae6b7deb43895c1052cb0038506f1", + "reference": "90bc45abf02ae6b7deb43895c1052cb0038506f1", + "shasum": "" + }, + "require": { + "php": "^5.5.9|>=7.0.8" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "3.3-dev" + } + }, + "autoload": { + "psr-4": { + "Symfony\\Component\\Filesystem\\": "" + }, + "exclude-from-classmap": [ + "/Tests/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Symfony Filesystem Component", + "homepage": "https://symfony.com", + "time": "2017-10-03 13:33:10" + }, { "name": "symfony/finder", "version": "v3.3.10", @@ -3242,55 +3291,6 @@ "homepage": "https://symfony.com", "time": "2017-10-02 06:42:24" }, - { - "name": "symfony/filesystem", - "version": "v3.3.10", - "source": { - "type": "git", - "url": "https://github.com/symfony/filesystem.git", - "reference": "90bc45abf02ae6b7deb43895c1052cb0038506f1" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/symfony/filesystem/zipball/90bc45abf02ae6b7deb43895c1052cb0038506f1", - "reference": "90bc45abf02ae6b7deb43895c1052cb0038506f1", - "shasum": "" - }, - "require": { - "php": "^5.5.9|>=7.0.8" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "3.3-dev" - } - }, - "autoload": { - "psr-4": { - "Symfony\\Component\\Filesystem\\": "" - }, - "exclude-from-classmap": [ - "/Tests/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Fabien Potencier", - "email": "fabien@symfony.com" - }, - { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" - } - ], - "description": "Symfony Filesystem Component", - "homepage": "https://symfony.com", - "time": "2017-10-03 13:33:10" - }, { "name": "symfony/http-foundation", "version": "v3.3.10", diff --git a/source/Metrics/DevelopersMetric.php b/source/Metrics/DevelopersMetric.php index bb1711b..73d65e9 100644 --- a/source/Metrics/DevelopersMetric.php +++ b/source/Metrics/DevelopersMetric.php @@ -58,8 +58,8 @@ public static function generate(OutputInterface $output) unset($line[0]); $line[1] = isset($line[1]) ? trim($line[1]) : 0; $line[2] = isset($line[2]) ? trim($line[2]) : 0; - self::$developers[$dev]['inserts'] += $line[1]; - self::$developers[$dev]['deletions'] += $line[2]; + self::$developers[$dev]['inserts'] += (int)$line[1]; + self::$developers[$dev]['deletions'] += (int)$line[2]; } } $progress->advance(); diff --git a/source/Program/ExportServices/IExport.php b/source/Program/ExportServices/IExport.php index f9f5c61..74b7d9a 100644 --- a/source/Program/ExportServices/IExport.php +++ b/source/Program/ExportServices/IExport.php @@ -9,5 +9,5 @@ interface IExport { public function __construct(ClassesRepository $repository, array $devs, OutputInterface $output); - public function export(string $path, float $stars, string $alias = null); + public function export(string $path, float $stars, string $alias = ''); }