Skip to content

Commit 9178eef

Browse files
committed
Updated README, added coveralls
1 parent b02342e commit 9178eef

File tree

11 files changed

+36
-49
lines changed

11 files changed

+36
-49
lines changed

.coveralls.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
coverage_clover: coverage/clover.xml
2+
json_path: coverage/coveralls-upload.json
3+
service_name: travis-ci

.gitignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,5 @@
33
composer.lock
44
cov/
55
vendor/
6-
bin
6+
bin/
7+
coverage/

.travis.yml

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,14 @@ language: php
22

33
php:
44
- 5.4
5-
- 5.5
5+
- 7.0
6+
- 7.1
67

78
before_script:
8-
- composer install --dev --prefer-source
9+
- composer install
10+
- mkdir coverage
911

10-
script: bin/phpunit --coverage-text
12+
script: bin/phpunit
13+
14+
after_script:
15+
- php bin/coveralls -v

LICENSE

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
Copyright (C) 2012 Tyler King <tyler.king@newfie.co>
1+
Copyright (C) 2017 Tyler King <tyler.n.king@gmail.com>
22

33
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
44

README.md

Lines changed: 6 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -2,34 +2,15 @@
22

33
This library simply gets the differences between strings with a few options to output the changes into raw `array`, `xml` or `text` formats.
44

5-
[![Build Status](https://secure.travis-ci.org/tyler-king/php-diff.png?branch=master)](http://travis-ci.org/tyler-king/php-diff)
5+
[![Build Status](https://secure.travis-ci.org/ohmybrew/php-diff.png?branch=master)](http://travis-ci.org/ohmybrew/php-diff)
6+
[![Coverage Status](https://coveralls.io/repos/github/ohmybrew/php-diff/badge.svg?branch=master)](https://coveralls.io/github/ohmybrew/php-diff?branch=master)
7+
[![License](https://poser.pugx.org/ohmybrew/php-diff/license)](https://packagist.org/packages/ohmybrew/php-diff)
68

7-
## Fetch
9+
## Installation
810

9-
The recommended way to install PHP Difff is [through composer](http://packagist.org).
11+
The recommended way to install is [through composer](http://packagist.org).
1012

11-
Just create a composer.json file for your project:
12-
13-
```JSON
14-
{
15-
"minimum-stability" : "dev",
16-
"require": {
17-
"tyler-king/php-diff": "dev-master"
18-
}
19-
}
20-
```
21-
22-
And run these two commands to install it:
23-
24-
$ curl -s http://getcomposer.org/installer | php
25-
$ php composer.phar install
26-
27-
Now you can add the autoloader, and you will have access to the library:
28-
29-
```php
30-
<?php
31-
require 'vendor/autoload.php';
32-
```
13+
$ composer require ohmybrew/php-diff
3314

3415
## Usage
3516

composer.json

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"name": "tyler-king/php-diff",
2+
"name": "ohmybrew/php-diff",
33
"description": "LSM - Longest Common Subsequence",
44
"type":"library",
55
"keywords":["lsm", "longest", "common", "subsequence"],
@@ -21,7 +21,8 @@
2121
"php": ">=5.4.0"
2222
},
2323
"require-dev": {
24-
"phpunit/phpunit": "3.7.*"
24+
"phpunit/phpunit": "3.7.*",
25+
"satooshi/php-coveralls": "~1.0"
2526
},
2627
"autoload": {
2728
"psr-0": {

phpunit.xml.dist

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,10 @@
1111
syntaxCheck="false"
1212
bootstrap="vendor/autoload.php"
1313
>
14+
<logging>
15+
<log type="coverage-clover" target="coverage/clover.xml"/>
16+
</logging>
17+
1418
<testsuites>
1519
<testsuite name="PHP DIff Test Suite">
1620
<directory>./tests/</directory>

src/Wally/PHPDiff/Diff.php

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,4 @@
1-
<?php
2-
3-
namespace Wally\PHPDiff;
1+
<?php namespace Wally\PHPDiff;
42

53
/**
64
* This class provides a simple diff function.
@@ -69,10 +67,10 @@ public function getResult()
6967
protected function _lsm()
7068
{
7169
$mStart = 0;
72-
$mEnd = count($this->string_1) - 1;
70+
$mEnd = count($this->string_1) - 1;
7371

7472
$nStart = 0;
75-
$nEnd = count($this->string_2) - 1;
73+
$nEnd = count($this->string_2) - 1;
7674

7775
$c = [];
7876
for ($i = -1; $i <= $mEnd; $i++) {

src/Wally/PHPDiff/Format/FormatInterface.php

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,4 @@
1-
<?php
2-
3-
namespace Wally\PHPDiff\Format;
1+
<?php namespace Wally\PHPDiff\Format;
42

53
interface FormatInterface
64
{

src/Wally/PHPDiff/Format/Text.php

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,4 @@
1-
<?php
2-
3-
namespace Wally\PHPDiff\Format;
1+
<?php namespace Wally\PHPDiff\Format;
42

53
use Wally\PHPDiff\Format\FormatInterface;
64

@@ -11,7 +9,7 @@ class Text implements FormatInterface
119

1210
public function __construct(array $input)
1311
{
14-
$this->input = $input;
12+
$this->input = $input;
1513
$this->result = '';
1614

1715
return $this;

0 commit comments

Comments
 (0)