Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
.idea/
.vagrant/
Vagrantfile
build/
vendor/
box.phar
codeclimate-test-reporter.phar
composer.lock
composer.phar
90 changes: 55 additions & 35 deletions composer.json
Original file line number Diff line number Diff line change
@@ -1,37 +1,57 @@
{
"name": "codeclimate/php-test-reporter",
"description": "PHP client for reporting test coverage to Code Climate",
"keywords": ["codeclimate", "coverage"],
"homepage": "https://github.com/codeclimate/php-test-reporter",
"type": "library",
"license": "MIT",
"authors": [
{
"name": "Code Climate",
"email": "[email protected]",
"homepage": "https://codeclimate.com"
}
],
"require": {
"php": ">=5.3",
"ext-curl": "*",
"satooshi/php-coveralls": "1.0.*",
"symfony/console": ">=2.0"
},
"require-dev": {
"phpunit/phpunit": "3.7.*@stable",
"ext-xdebug": "*"
},
"autoload": {
"psr-0": {
"CodeClimate\\Component": "src/",
"CodeClimate\\Bundle": "src/"
}
},
"bin": ["composer/bin/test-reporter"],
"extra": {
"branch-alias": {
"dev-master": "0.3.x-dev"
}
}
"name": "codeclimate/php-test-reporter",
"description": "PHP client for reporting test coverage to Code Climate",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@hollodotme

The reformatting here seems unrelated, doesn't it?

Copy link
Contributor Author

@hollodotme hollodotme Jul 22, 2016

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The reformatting, yes, but not the additions at "autoload" section and at the bottom.
Sorry, My PhpStorm settings differ from the previous indention.

"keywords": [
"codeclimate",
"coverage"
],
"homepage": "https://github.com/codeclimate/php-test-reporter",
"type": "library",
"license": "MIT",
"authors": [
{
"name": "Code Climate",
"email": "[email protected]",
"homepage": "https://codeclimate.com"
}
],
"require": {
"php": ">=5.3",
"ext-curl": "*",
"satooshi/php-coveralls": "^1.0",
"symfony/console": "^2.0"
},
"require-dev": {
"phpunit/phpunit": "3.7.*@stable",
"ext-xdebug": "*",
"tm/tooly-composer-script": "^1.0"
},
"autoload": {
"psr-4": {
"CodeClimate\\PhpTestReporter\\": "src/"
}
},
"autoload-dev": {
"psr-4": {
"CodeClimate\\PhpTestReporter\\Tests\\": "tests/"
}
},
"bin": [
"composer/bin/test-reporter"
],
"scripts": {
"post-install-cmd": "Tooly\\ScriptHandler::installPharTools",
"post-update-cmd": "Tooly\\ScriptHandler::installPharTools"
},
"extra": {
"branch-alias": {
"dev-master": "0.3.x-dev"
},
"tools": {
"box": {
"url": "https://github.com/box-project/box2/releases/download/2.7.2/box-2.7.2.phar",
"only-dev": true
}
}
}
}
46 changes: 25 additions & 21 deletions composer/bin/test-reporter
Original file line number Diff line number Diff line change
@@ -1,33 +1,37 @@
#!/usr/bin/env php
<?php

$files = array(
__DIR__ . '/../../vendor/autoload.php',
__DIR__ . '/../../../../autoload.php'
);
namespace CodeClimate\PhpTestReporter;

foreach ($files as $file) {
if (file_exists($file)) {
include_once $file;
use CodeClimate\PhpTestReporter\Constants\Version;

define('PHP_TEST_REPORTER_COMPOSER_INSTALL', $file);
$files = [
__DIR__ . '/../../vendor/autoload.php',
__DIR__ . '/../../../../autoload.php',
];

break;
}
}
foreach ( $files as $file )
{
if ( file_exists( $file ) )
{
include_once $file;

define( 'PHP_TEST_REPORTER_COMPOSER_INSTALL', $file );

if (!defined('PHP_TEST_REPORTER_COMPOSER_INSTALL')) {
die(
'You need to set up the project dependencies using the following commands:' . PHP_EOL .
'curl -s http://getcomposer.org/installer | php' . PHP_EOL .
'php composer.phar install' . PHP_EOL
);
break;
}
}

use CodeClimate\Bundle\TestReporterBundle\Version;
use CodeClimate\Bundle\TestReporterBundle\Console\Application;
if ( !defined( 'PHP_TEST_REPORTER_COMPOSER_INSTALL' ) )
{
die(
'You need to set up the project dependencies using the following commands:' . PHP_EOL .
'curl -s http://getcomposer.org/installer | php' . PHP_EOL .
'php composer.phar install' . PHP_EOL
);
}

$rootDir = realpath(dirname(PHP_TEST_REPORTER_COMPOSER_INSTALL) . '/..');
$rootDir = realpath( dirname( PHP_TEST_REPORTER_COMPOSER_INSTALL ) . '/..' );

$app = new Application($rootDir, 'Code Climate PHP Test Reporter', Version::VERSION);
$app = new Application( $rootDir, 'Code Climate PHP Test Reporter', Version::VERSION );
$app->run();
85 changes: 85 additions & 0 deletions src/Application.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,85 @@
<?php
namespace CodeClimate\PhpTestReporter;

use CodeClimate\PhpTestReporter\ConsoleCommands\TestReporterCommand;
use Symfony\Component\Console\Application as BaseApplication;
use Symfony\Component\Console\Input\InputInterface;

/**
* Coveralls API application.
* @author Kitamura Satoshi <[email protected]>
*/
class Application extends BaseApplication
{
/**
* Path to project root directory.
* @var string
*/
private $rootDir;

/**
* Constructor.
*
* @param string $rootDir Path to project root directory.
* @param string $name The name of the application
* @param string $version The version of the application
*/
public function __construct( $rootDir, $name = 'UNKNOWN', $version = 'UNKNOWN' )
{
$this->rootDir = $rootDir;

parent::__construct( $name, $version );
}

// internal method

/**
* {@inheritdoc}
* @see \Symfony\Component\Console\Application::getCommandName()
*/
protected function getCommandName( InputInterface $input )
{
return 'test-reporter';
}

/**
* {@inheritdoc}
* @see \Symfony\Component\Console\Application::getDefaultCommands()
*/
protected function getDefaultCommands()
{
// Keep the core default commands to have the HelpCommand
// which is used when using the --help option
$defaultCommands = parent::getDefaultCommands();
$defaultCommands[] = $this->createTestReporterCommand();

return $defaultCommands;
}

/**
* Create TestReporterCommand.
* @return TestReporterCommand
*/
protected function createTestReporterCommand()
{
$command = new TestReporterCommand();
$command->setRootDir( $this->rootDir );

return $command;
}

// accessor

/**
* {@inheritdoc}
* @see \Symfony\Component\Console\Application::getDefinition()
*/
public function getDefinition()
{
$inputDefinition = parent::getDefinition();
// clear out the normal first argument, which is the command name
$inputDefinition->setArguments();

return $inputDefinition;
}
}
123 changes: 0 additions & 123 deletions src/CodeClimate/Bundle/TestReporterBundle/ApiClient.php

This file was deleted.

Loading