Skip to content

Commit

Permalink
Add Atom, PHPStorm and Vim to telemetry environments
Browse files Browse the repository at this point in the history
Closes #13
  • Loading branch information
jubianchi committed May 19, 2016
1 parent 7af90b2 commit fb6a41c
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 2 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
# `dev-master` (2.x-dev)

* [#14](https://github.com/atoum/reports-extension/pull/14) Add Atom, PHPStorm and Vim to telemetry environments ([@jubianchi])

# 2.2.0 - 2015-05-12

* [#11](https://github.com/atoum/reports-extension/pull/11) Anonymize only project name ([@jubianchi])
Expand Down
16 changes: 14 additions & 2 deletions classes/telemetry.php
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@ public function build($event)
'atoum' => $this->score->getAtoumVersion(),
'os' => php_uname('s') . ' ' . php_uname('r'),
'arch' => php_uname('m'),
'environment' => self::getCiEnvironment(),
'environment' => self::getEnvironment(),
'vendor' => $this->projectVendorName,
'project' => $this->projectName,
'metrics' => [
Expand Down Expand Up @@ -178,7 +178,7 @@ public function build($event)
return $this;
}

private static function getCiEnvironment()
private static function getEnvironment()
{
switch (true)
{
Expand Down Expand Up @@ -206,6 +206,18 @@ private static function getCiEnvironment()
case (bool) getenv('CI'):
return 'ci';

case (bool) getenv('TERM'):
return 'cli';

case (bool) getenv('PHPSTORM'):
return 'phpstorm';

case (bool) getenv('ATOM'):
return 'atom';

case (bool) getenv('VIM'):
return 'vim';

default:
return 'unknown';
}
Expand Down
5 changes: 5 additions & 0 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,5 +25,10 @@
"mageekguy\\atoum\\reports\\": "classes"
},
"files": ["autoloader.php"]
},
"extra": {
"branch-alias": {
"dev-master": "2.x-dev"
}
}
}

0 comments on commit fb6a41c

Please sign in to comment.