Skip to content

Commit

Permalink
Cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
sebastianbergmann committed Feb 3, 2017
1 parent 39d1d55 commit 0bbadb2
Show file tree
Hide file tree
Showing 12 changed files with 42 additions and 103 deletions.
3 changes: 1 addition & 2 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
/build/phar
/build/*.phar*
/.idea
/cache.properties
/composer.phar
/composer.lock
/vendor

71 changes: 13 additions & 58 deletions build.xml
Original file line number Diff line number Diff line change
@@ -1,72 +1,26 @@
<?xml version="1.0" encoding="UTF-8"?>
<project name="phpcov" default="build">
<target name="build" depends="prepare,lint"/>
<project name="phpcov" default="setup">
<target name="setup" depends="clean,composer"/>

<target name="clean" description="Cleanup build artifacts">
<delete dir="${basedir}/bin"/>
<delete dir="${basedir}/vendor"/>
<delete file="${basedir}/composer.lock"/>
<delete dir="${basedir}/build/phar"/>
<delete>
<fileset dir="${basedir}/build" includes="*.phar"/>
</delete>
</target>

<target name="composer" description="Install dependencies with Composer">
<tstamp>
<format property="thirty.days.ago" pattern="MM/dd/yyyy hh:mm aa" offset="-30" unit="day"/>
</tstamp>
<delete>
<fileset dir="${basedir}">
<include name="composer.phar"/>
<date datetime="${thirty.days.ago}" when="before"/>
</fileset>
</delete>

<get src="https://getcomposer.org/composer.phar" dest="${basedir}/composer.phar" skipexisting="true"/>

<exec executable="php">
<arg value="composer.phar"/>
<arg value="install"/>
</exec>
</target>

<target name="prepare" depends="clean,composer" description="Prepare for build">
</target>

<target name="lint">
<apply executable="php" failonerror="true">
<arg value="-l"/>

<fileset dir="${basedir}/src">
<include name="**/*.php"/>
<modified/>
</fileset>

<fileset dir="${basedir}/tests">
<include name="**/*.php"/>
<modified/>
</fileset>
</apply>
</target>

<target name="phpcs" description="Find coding standard violations using PHP_CodeSniffer">
<exec executable="phpcs">
<arg value="--standard=PSR2"/>
<arg value="--extensions=php"/>
<arg path="${basedir}/src"/>
</exec>
</target>

<target name="phpunit" depends="prepare,lint" description="Run unit tests with PHPUnit">
<exec executable="${basedir}/vendor/bin/phpunit" failonerror="true">
<arg value="--configuration"/>
<arg path="${basedir}/build/phpunit.xml"/>
<target name="composer" depends="clean" description="Install dependencies with Composer">
<exec executable="composer" taskname="composer">
<arg value="update"/>
<arg value="--no-interaction"/>
<arg value="--no-progress"/>
<arg value="--no-ansi"/>
<arg value="--no-suggest"/>
<arg value="--optimize-autoloader"/>
<arg value="--prefer-stable"/>
</exec>
</target>

<target name="signed-phar"
description="Create signed PHAR archive of PHPUnit and all its dependencies (release)"
description="Create signed PHAR archive of phpcov and all its dependencies (release)"
depends="phar">
<exec executable="bash" outputproperty="version">
<arg value="-c" />
Expand Down Expand Up @@ -145,3 +99,4 @@
<chmod file="${basedir}/build/phpcov-${version}.phar" perm="ugo+rx"/>
</target>
</project>

14 changes: 0 additions & 14 deletions build/phpunit.xml

This file was deleted.

12 changes: 6 additions & 6 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,13 @@
"issues": "https://github.com/sebastianbergmann/phpcov/issues"
},
"require": {
"php": "^5.6 || ^7.0",
"phpunit/phpunit": "^5.0|^6.0",
"phpunit/php-code-coverage": "^4.0",
"php": "^7.0",
"phpunit/phpunit": "^6.0",
"phpunit/php-code-coverage": "^5.0",
"sebastian/diff": "^1.1",
"sebastian/finder-facade": "^1.1",
"sebastian/version": "^1.0|^2.0",
"symfony/console": "^2|^3"
"sebastian/version": "^2.0",
"symfony/console": "^3"
},
"autoload": {
"classmap": [
Expand All @@ -32,7 +32,7 @@
],
"extra": {
"branch-alias": {
"dev-master": "3.1.x-dev"
"dev-master": "4.0.x-dev"
}
}
}
Expand Down
19 changes: 19 additions & 0 deletions phpunit.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
<?xml version="1.0" encoding="UTF-8"?>
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/6.0/phpunit.xsd"
bootstrap="vendor/autoload.php"
forceCoversAnnotation="true"
beStrictAboutCoversAnnotation="true"
beStrictAboutOutputDuringTests="true"
beStrictAboutTodoAnnotatedTests="true"
verbose="true">
<testsuite>
<directory suffix="Test.php">tests</directory>
</testsuite>

<filter>
<whitelist processUncoveredFilesFromWhitelist="true">
<directory suffix=".php">src</directory>
</whitelist>
</filter>
</phpunit>
4 changes: 1 addition & 3 deletions src/Application.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,14 +17,12 @@

/**
* TextUI frontend for php-code-coverage.
*
* @since Class available since Release 2.0.0
*/
class Application extends AbstractApplication
{
public function __construct()
{
$version = new Version('3.1.0', dirname(__DIR__));
$version = new Version('4.0', dirname(__DIR__));
parent::__construct('phpcov', $version->getVersion());

$this->add(new ExecuteCommand);
Expand Down
3 changes: 0 additions & 3 deletions src/BaseCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,6 @@
use Symfony\Component\Console\Output\OutputInterface;
use PHPUnit_Util_Configuration;

/**
* @since Class available since Release 2.0.0
*/
abstract class BaseCommand extends AbstractCommand
{
protected function handleConfiguration(CodeCoverage $coverage, InputInterface $input)
Expand Down
3 changes: 0 additions & 3 deletions src/ExecuteCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,6 @@
use Symfony\Component\Console\Input\InputOption;
use Symfony\Component\Console\Output\OutputInterface;

/**
* @since Class available since Release 2.0.0
*/
class ExecuteCommand extends BaseCommand
{
/**
Expand Down
3 changes: 0 additions & 3 deletions src/MergeCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,6 @@
use Symfony\Component\Console\Output\OutputInterface;
use SebastianBergmann\FinderFacade\FinderFacade;

/**
* @since Class available since Release 2.0.0
*/
class MergeCommand extends BaseCommand
{
/**
Expand Down
3 changes: 0 additions & 3 deletions src/PatchCoverage.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,6 @@
use SebastianBergmann\Diff\Line;
use SebastianBergmann\Diff\Parser as DiffParser;

/**
* @since Class available since Release 2.0.0
*/
class PatchCoverage
{
/**
Expand Down
3 changes: 0 additions & 3 deletions src/PatchCoverageCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,6 @@
use Symfony\Component\Console\Input\InputOption;
use Symfony\Component\Console\Output\OutputInterface;

/**
* @since Class available since Release 2.0.0
*/
class PatchCoverageCommand extends AbstractCommand
{
/**
Expand Down
7 changes: 2 additions & 5 deletions tests/PatchCoverageTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,9 @@

namespace SebastianBergmann\PHPCOV;

use PHPUnit_Framework_TestCase;
use PHPUnit\Framework\TestCase;

/**
* @since Class available since Release 2.0.0
*/
class PatchCoverageTest extends PHPUnit_Framework_TestCase
class PatchCoverageTest extends TestCase
{
/**
* @dataProvider providerForPatchCoverageIsCalculatedCorrectly
Expand Down

0 comments on commit 0bbadb2

Please sign in to comment.