diff --git a/README.md b/README.md
index a22587b..55c15b2 100644
--- a/README.md
+++ b/README.md
@@ -3,7 +3,7 @@ FineDiff
Originally written by Raymond Hill ([https://github.com/gorhill/PHP-FineDiff](https://github.com/gorhill/PHP-FineDiff)) FineDiff has been tweaked to bring it up to date with the modern world. That means documented, nicely formatted, tested code that can be easily extended.
-[](https://travis-ci.org/cogpowered/FineDiff)
+[](https://travis-ci.org/bariew/FineDiff)
Installation
------------
@@ -17,7 +17,7 @@ Add the following to your composer.json file:
```json
{
"require": {
- "cogpowered/finediff": "0.3.*"
+ "bariew/finediff": "0.3.*"
}
}
```
@@ -38,7 +38,7 @@ Usage
Render as HTML the difference between two strings:
```php
-$diff = new cogpowered\FineDiff\Diff;
+$diff = new bariew\FineDiff\Diff;
echo $diff->render('string one', 'string two');
```
@@ -48,7 +48,7 @@ This would then output:
string twone
```
-You could change the granularity to `cogpowered\FineDiff\Granularity\Word` so the output is:
+You could change the granularity to `bariew\FineDiff\Granularity\Word` so the output is:
```html
string onetwo
@@ -57,8 +57,8 @@ string onetwo
You do this by passing it into the Diff constructor:
```php
-$granularity = new cogpowered\FineDiff\Granularity\Word;
-$diff = new cogpowered\FineDiff\Diff($granularity);
+$granularity = new bariew\FineDiff\Granularity\Word;
+$diff = new bariew\FineDiff\Diff($granularity);
```
**Grab opcode instructions**
@@ -66,7 +66,7 @@ $diff = new cogpowered\FineDiff\Diff($granularity);
Opcode instructions are what tell FineDiff how to change one string into another.
```php
-$diff = new cogpowered\FineDiff\Diff;
+$diff = new bariew\FineDiff\Diff;
echo $diff->getOpcodes('string one', 'string two');
```
@@ -78,7 +78,7 @@ c7d3i3:two
Render text using the opcodes:
```php
-$render = new cogpowered\FineDiff\Render\Text;
+$render = new bariew\FineDiff\Render\Text;
echo $render->process('string one', 'c7d3i3:two');
```
@@ -89,7 +89,7 @@ string two
Same with HTML:
```php
-$render = new cogpowered\FineDiff\Render\Html;
+$render = new bariew\FineDiff\Render\Html;
echo $render->process('string one', 'c7d3i3:two');
```
@@ -97,7 +97,7 @@ License
-------
Copyright (c) 2011 Raymond Hill (http://raymondhill.net/blog/?p=441)
-Copyright (c) 2013 Rob Crowe (http://cogpowered.com)
+Copyright (c) 2013 Rob Crowe (http://bariew.com)
Licensed under The MIT License
diff --git a/composer.json b/composer.json
index 7c57ace..3e1e3b8 100644
--- a/composer.json
+++ b/composer.json
@@ -1,7 +1,7 @@
{
- "name": "cogpowered/finediff",
+ "name": "bariew/finediff",
"description": "PHP implementation of a Fine granularity Diff engine",
- "homepage": "https://github.com/cogpowered/FineDiff",
+ "homepage": "https://github.com/bariew/FineDiff",
"license": "MIT",
"keywords": ["finediff", "diff", "text", "string", "opcode"],
"authors": [
@@ -10,7 +10,7 @@
},
{
"name": "Rob Crowe",
- "email": "rob@cogpowered.com"
+ "email": "rob@bariew.com"
}
],
"type": "library",
@@ -22,6 +22,6 @@
"phpunit/phpunit": "*"
},
"autoload": {
- "psr-0": { "cogpowered\\FineDiff": "src/" }
+ "psr-0": { "bariew\\FineDiff": "src/" }
}
}
diff --git a/src/cogpowered/FineDiff/Delimiters.php b/src/bariew/FineDiff/Delimiters.php
similarity index 71%
rename from src/cogpowered/FineDiff/Delimiters.php
rename to src/bariew/FineDiff/Delimiters.php
index 6bb0884..0be0d43 100644
--- a/src/cogpowered/FineDiff/Delimiters.php
+++ b/src/bariew/FineDiff/Delimiters.php
@@ -7,19 +7,19 @@
* one string into another.
*
* Originally created by Raymond Hill (https://github.com/gorhill/PHP-FineDiff), brought up
- * to date by Cog Powered (https://github.com/cogpowered/FineDiff).
+ * to date by Cog Powered (https://github.com/bariew/FineDiff).
*
* @copyright Copyright 2011 (c) Raymond Hill (http://raymondhill.net/blog/?p=441)
- * @copyright Copyright 2013 (c) Robert Crowe (http://cogpowered.com)
- * @link https://github.com/cogpowered/FineDiff
+ * @copyright Copyright 2013 (c) Robert Crowe (http://bariew.com)
+ * @link https://github.com/bariew/FineDiff
* @version 0.0.1
* @license MIT License (http://www.opensource.org/licenses/mit-license.php)
*/
-namespace cogpowered\FineDiff;
+namespace bariew\FineDiff;
/**
- * Used by classes implementing cogpowered\FineDiff\Granularity\GranularityInterface.
+ * Used by classes implementing bariew\FineDiff\Granularity\GranularityInterface.
*
* Class is used more like an Enum type; the class can not be instantiated.
*/
diff --git a/src/cogpowered/FineDiff/Diff.php b/src/bariew/FineDiff/Diff.php
similarity index 65%
rename from src/cogpowered/FineDiff/Diff.php
rename to src/bariew/FineDiff/Diff.php
index 3f171f8..a01e01d 100644
--- a/src/cogpowered/FineDiff/Diff.php
+++ b/src/bariew/FineDiff/Diff.php
@@ -7,23 +7,23 @@
* one string into another.
*
* Originally created by Raymond Hill (https://github.com/gorhill/PHP-FineDiff), brought up
- * to date by Cog Powered (https://github.com/cogpowered/FineDiff).
+ * to date by Cog Powered (https://github.com/bariew/FineDiff).
*
* @copyright Copyright 2011 (c) Raymond Hill (http://raymondhill.net/blog/?p=441)
- * @copyright Copyright 2013 (c) Robert Crowe (http://cogpowered.com)
- * @link https://github.com/cogpowered/FineDiff
+ * @copyright Copyright 2013 (c) Robert Crowe (http://bariew.com)
+ * @link https://github.com/bariew/FineDiff
* @version 0.0.1
* @license MIT License (http://www.opensource.org/licenses/mit-license.php)
*/
-namespace cogpowered\FineDiff;
+namespace bariew\FineDiff;
-use cogpowered\FineDiff\Granularity\GranularityInterface;
-use cogpowered\FineDiff\Render\RendererInterface;
-use cogpowered\FineDiff\Parser\ParserInterface;
-use cogpowered\FineDiff\Granularity\Character;
-use cogpowered\FineDiff\Render\Html;
-use cogpowered\FineDiff\Parser\Parser;
+use bariew\FineDiff\Granularity\GranularityInterface;
+use bariew\FineDiff\Render\RendererInterface;
+use bariew\FineDiff\Parser\ParserInterface;
+use bariew\FineDiff\Granularity\Character;
+use bariew\FineDiff\Render\Html;
+use bariew\FineDiff\Parser\Parser;
/**
* Diff class.
@@ -31,29 +31,29 @@
class Diff
{
/**
- * @var cogpowered\FineDiff\Granularity\GranularityInterface
+ * @var bariew\FineDiff\Granularity\GranularityInterface
*/
protected $granularity;
/**
- * @var cogpowered\FineDiff\Render\RendererInterface
+ * @var bariew\FineDiff\Render\RendererInterface
*/
protected $renderer;
/**
- * @var cogpowered\FineDiff\Parser\ParserInterface
+ * @var bariew\FineDiff\Parser\ParserInterface
*/
protected $parser;
/**
* Instantiate a new instance of Diff.
*
- * @param cogpowered\FineDiff\Granularity\GranularityInterface $granularity Level of diff.
- * @param cogpowered\FineDiff\Render\RenderInterface $renderer Diff renderer.
- * @param cogpowered\FineDiff\Parser\ParserInterface $parser Parser used to generate opcodes.
+ * @param bariew\FineDiff\Granularity\GranularityInterface $granularity Level of diff.
+ * @param bariew\FineDiff\Render\RenderInterface $renderer Diff renderer.
+ * @param bariew\FineDiff\Parser\ParserInterface $parser Parser used to generate opcodes.
*
- * @throws cogpowered\FineDiff\Exceptions\GranularityCountException
- * @throws cogpowered\FineDiff\Exceptions\OperationException
+ * @throws bariew\FineDiff\Exceptions\GranularityCountException
+ * @throws bariew\FineDiff\Exceptions\OperationException
*/
public function __construct(GranularityInterface $granularity = null, RendererInterface $renderer = null, ParserInterface $parser = null)
{
@@ -72,7 +72,7 @@ public function __construct(GranularityInterface $granularity = null, RendererIn
/**
* Returns the granularity object used by the parser.
*
- * @return @cogpowered\FineDiff\Granularity\GranularityInterface
+ * @return @bariew\FineDiff\Granularity\GranularityInterface
*/
public function getGranularity()
{
@@ -82,7 +82,7 @@ public function getGranularity()
/**
* Set the granularity level of the parser.
*
- * @param cogpowered\FineDiff\Granularity\GranularityInterface $granularity
+ * @param bariew\FineDiff\Granularity\GranularityInterface $granularity
* @return void
*/
public function setGranularity(GranularityInterface $granularity)
@@ -93,7 +93,7 @@ public function setGranularity(GranularityInterface $granularity)
/**
* Get the render.
*
- * @return cogpowered\FineDiff\Render\RendererInterface
+ * @return bariew\FineDiff\Render\RendererInterface
*/
public function getRenderer()
{
@@ -103,7 +103,7 @@ public function getRenderer()
/**
* Set the renderer.
*
- * @param cogpowered\FineDiff\Render\RendererInterface $renderer
+ * @param bariew\FineDiff\Render\RendererInterface $renderer
* @return void
*/
public function setRenderer(RendererInterface $renderer)
@@ -114,7 +114,7 @@ public function setRenderer(RendererInterface $renderer)
/**
* Get the parser responsible for generating the diff/opcodes.
*
- * @return cogpowered\FineDiff\Parser\ParserInterface
+ * @return bariew\FineDiff\Parser\ParserInterface
*/
public function getParser()
{
@@ -124,7 +124,7 @@ public function getParser()
/**
* Set the parser.
*
- * @param cogpowered\FineDiff\Parser\ParserInterface $parser
+ * @param bariew\FineDiff\Parser\ParserInterface $parser
* @return void
*/
public function setParser(ParserInterface $parser)
@@ -138,7 +138,7 @@ public function setParser(ParserInterface $parser)
* Returns the opcode diff which can be used for example, to
* to generate a HTML report of the differences.
*
- * @return cogpowered\FineDiff\Parser\Opcodes
+ * @return bariew\FineDiff\Parser\Opcodes
*/
public function getOpcodes($from_text, $to_text)
{
diff --git a/src/cogpowered/FineDiff/Exceptions/GranularityCountException.php b/src/bariew/FineDiff/Exceptions/GranularityCountException.php
similarity index 71%
rename from src/cogpowered/FineDiff/Exceptions/GranularityCountException.php
rename to src/bariew/FineDiff/Exceptions/GranularityCountException.php
index 55d6e22..1d5389f 100644
--- a/src/cogpowered/FineDiff/Exceptions/GranularityCountException.php
+++ b/src/bariew/FineDiff/Exceptions/GranularityCountException.php
@@ -7,16 +7,16 @@
* one string into another.
*
* Originally created by Raymond Hill (github.com/gorhill/PHP-FineDiff), brought up
-* to date by Cog Powered (github.com/cogpowered/FineDiff).
+* to date by Cog Powered (github.com/bariew/FineDiff).
*
* @copyright Copyright 2011 (c) Raymond Hill (http://raymondhill.net/blog/?p=441)
-* @copyright Copyright 2013 (c) Robert Crowe (http://cogpowered.com)
-* @link https://github.com/cogpowered/FineDiff
+* @copyright Copyright 2013 (c) Robert Crowe (http://bariew.com)
+* @link https://github.com/bariew/FineDiff
* @version 0.0.1
* @license MIT License (http://www.opensource.org/licenses/mit-license.php)
*/
-namespace cogpowered\FineDiff\Exceptions;
+namespace bariew\FineDiff\Exceptions;
/**
* A granularity must have at least one thing to match against. Thrown when this isn't the case.
diff --git a/src/cogpowered/FineDiff/Exceptions/OperationException.php b/src/bariew/FineDiff/Exceptions/OperationException.php
similarity index 57%
rename from src/cogpowered/FineDiff/Exceptions/OperationException.php
rename to src/bariew/FineDiff/Exceptions/OperationException.php
index 8153266..3861011 100644
--- a/src/cogpowered/FineDiff/Exceptions/OperationException.php
+++ b/src/bariew/FineDiff/Exceptions/OperationException.php
@@ -7,18 +7,18 @@
* one string into another.
*
* Originally created by Raymond Hill (https://github.com/gorhill/PHP-FineDiff), brought up
- * to date by Cog Powered (https://github.com/cogpowered/FineDiff).
+ * to date by Cog Powered (https://github.com/bariew/FineDiff).
*
* @copyright Copyright 2011 (c) Raymond Hill (http://raymondhill.net/blog/?p=441)
- * @copyright Copyright 2013 (c) Robert Crowe (http://cogpowered.com)
- * @link https://github.com/cogpowered/FineDiff
+ * @copyright Copyright 2013 (c) Robert Crowe (http://bariew.com)
+ * @link https://github.com/bariew/FineDiff
* @version 0.0.1
* @license MIT License (http://www.opensource.org/licenses/mit-license.php)
*/
-namespace cogpowered\FineDiff\Exceptions;
+namespace bariew\FineDiff\Exceptions;
/**
- * Thrown when trying to set an opcode that doesn't implement cogpowered\FineDiff\Parser\Operations\OperationInterface.
+ * Thrown when trying to set an opcode that doesn't implement bariew\FineDiff\Parser\Operations\OperationInterface.
*/
class OperationException extends \Exception {}
\ No newline at end of file
diff --git a/src/cogpowered/FineDiff/Granularity/Character.php b/src/bariew/FineDiff/Granularity/Character.php
similarity index 71%
rename from src/cogpowered/FineDiff/Granularity/Character.php
rename to src/bariew/FineDiff/Granularity/Character.php
index d2caf41..3bd1fba 100644
--- a/src/cogpowered/FineDiff/Granularity/Character.php
+++ b/src/bariew/FineDiff/Granularity/Character.php
@@ -7,18 +7,18 @@
* one string into another.
*
* Originally created by Raymond Hill (https://github.com/gorhill/PHP-FineDiff), brought up
- * to date by Cog Powered (https://github.com/cogpowered/FineDiff).
+ * to date by Cog Powered (https://github.com/bariew/FineDiff).
*
* @copyright Copyright 2011 (c) Raymond Hill (http://raymondhill.net/blog/?p=441)
- * @copyright Copyright 2013 (c) Robert Crowe (http://cogpowered.com)
- * @link https://github.com/cogpowered/FineDiff
+ * @copyright Copyright 2013 (c) Robert Crowe (http://bariew.com)
+ * @link https://github.com/bariew/FineDiff
* @version 0.0.1
* @license MIT License (http://www.opensource.org/licenses/mit-license.php)
*/
-namespace cogpowered\FineDiff\Granularity;
+namespace bariew\FineDiff\Granularity;
-use cogpowered\FineDiff\Delimiters;
+use bariew\FineDiff\Delimiters;
/**
* Character level granularity.
diff --git a/src/cogpowered/FineDiff/Granularity/Granularity.php b/src/bariew/FineDiff/Granularity/Granularity.php
similarity index 88%
rename from src/cogpowered/FineDiff/Granularity/Granularity.php
rename to src/bariew/FineDiff/Granularity/Granularity.php
index 00f77a9..a392e32 100644
--- a/src/cogpowered/FineDiff/Granularity/Granularity.php
+++ b/src/bariew/FineDiff/Granularity/Granularity.php
@@ -7,16 +7,16 @@
* one string into another.
*
* Originally created by Raymond Hill (https://github.com/gorhill/PHP-FineDiff), brought up
- * to date by Cog Powered (https://github.com/cogpowered/FineDiff).
+ * to date by Cog Powered (https://github.com/bariew/FineDiff).
*
* @copyright Copyright 2011 (c) Raymond Hill (http://raymondhill.net/blog/?p=441)
- * @copyright Copyright 2013 (c) Robert Crowe (http://cogpowered.com)
- * @link https://github.com/cogpowered/FineDiff
+ * @copyright Copyright 2013 (c) Robert Crowe (http://bariew.com)
+ * @link https://github.com/bariew/FineDiff
* @version 0.0.1
* @license MIT License (http://www.opensource.org/licenses/mit-license.php)
*/
-namespace cogpowered\FineDiff\Granularity;
+namespace bariew\FineDiff\Granularity;
/**
* Granularities should extend this class.
diff --git a/src/cogpowered/FineDiff/Granularity/GranularityInterface.php b/src/bariew/FineDiff/Granularity/GranularityInterface.php
similarity index 80%
rename from src/cogpowered/FineDiff/Granularity/GranularityInterface.php
rename to src/bariew/FineDiff/Granularity/GranularityInterface.php
index 07d6b66..ff1f2be 100644
--- a/src/cogpowered/FineDiff/Granularity/GranularityInterface.php
+++ b/src/bariew/FineDiff/Granularity/GranularityInterface.php
@@ -7,16 +7,16 @@
* one string into another.
*
* Originally created by Raymond Hill (https://github.com/gorhill/PHP-FineDiff), brought up
- * to date by Cog Powered (https://github.com/cogpowered/FineDiff).
+ * to date by Cog Powered (https://github.com/bariew/FineDiff).
*
* @copyright Copyright 2011 (c) Raymond Hill (http://raymondhill.net/blog/?p=441)
- * @copyright Copyright 2013 (c) Robert Crowe (http://cogpowered.com)
- * @link https://github.com/cogpowered/FineDiff
+ * @copyright Copyright 2013 (c) Robert Crowe (http://bariew.com)
+ * @link https://github.com/bariew/FineDiff
* @version 0.0.1
* @license MIT License (http://www.opensource.org/licenses/mit-license.php)
*/
-namespace cogpowered\FineDiff\Granularity;
+namespace bariew\FineDiff\Granularity;
interface GranularityInterface
{
diff --git a/src/cogpowered/FineDiff/Granularity/Paragraph.php b/src/bariew/FineDiff/Granularity/Paragraph.php
similarity index 67%
rename from src/cogpowered/FineDiff/Granularity/Paragraph.php
rename to src/bariew/FineDiff/Granularity/Paragraph.php
index 2c58c64..10fe6fd 100644
--- a/src/cogpowered/FineDiff/Granularity/Paragraph.php
+++ b/src/bariew/FineDiff/Granularity/Paragraph.php
@@ -7,18 +7,18 @@
* one string into another.
*
* Originally created by Raymond Hill (https://github.com/gorhill/PHP-FineDiff), brought up
- * to date by Cog Powered (https://github.com/cogpowered/FineDiff).
+ * to date by Cog Powered (https://github.com/bariew/FineDiff).
*
* @copyright Copyright 2011 (c) Raymond Hill (http://raymondhill.net/blog/?p=441)
- * @copyright Copyright 2013 (c) Robert Crowe (http://cogpowered.com)
- * @link https://github.com/cogpowered/FineDiff
+ * @copyright Copyright 2013 (c) Robert Crowe (http://bariew.com)
+ * @link https://github.com/bariew/FineDiff
* @version 0.0.1
* @license MIT License (http://www.opensource.org/licenses/mit-license.php)
*/
-namespace cogpowered\FineDiff\Granularity;
+namespace bariew\FineDiff\Granularity;
-use cogpowered\FineDiff\Delimiters;
+use bariew\FineDiff\Delimiters;
/**
* Paragraph level granularity.
diff --git a/src/cogpowered/FineDiff/Granularity/Sentence.php b/src/bariew/FineDiff/Granularity/Sentence.php
similarity index 69%
rename from src/cogpowered/FineDiff/Granularity/Sentence.php
rename to src/bariew/FineDiff/Granularity/Sentence.php
index 0882de7..97e3c0f 100644
--- a/src/cogpowered/FineDiff/Granularity/Sentence.php
+++ b/src/bariew/FineDiff/Granularity/Sentence.php
@@ -7,18 +7,18 @@
* one string into another.
*
* Originally created by Raymond Hill (https://github.com/gorhill/PHP-FineDiff), brought up
- * to date by Cog Powered (https://github.com/cogpowered/FineDiff).
+ * to date by Cog Powered (https://github.com/bariew/FineDiff).
*
* @copyright Copyright 2011 (c) Raymond Hill (http://raymondhill.net/blog/?p=441)
- * @copyright Copyright 2013 (c) Robert Crowe (http://cogpowered.com)
- * @link https://github.com/cogpowered/FineDiff
+ * @copyright Copyright 2013 (c) Robert Crowe (http://bariew.com)
+ * @link https://github.com/bariew/FineDiff
* @version 0.0.1
* @license MIT License (http://www.opensource.org/licenses/mit-license.php)
*/
-namespace cogpowered\FineDiff\Granularity;
+namespace bariew\FineDiff\Granularity;
-use cogpowered\FineDiff\Delimiters;
+use bariew\FineDiff\Delimiters;
/**
* Sentence level granularity.
diff --git a/src/cogpowered/FineDiff/Granularity/Word.php b/src/bariew/FineDiff/Granularity/Word.php
similarity index 69%
rename from src/cogpowered/FineDiff/Granularity/Word.php
rename to src/bariew/FineDiff/Granularity/Word.php
index 4a13a61..a861f40 100644
--- a/src/cogpowered/FineDiff/Granularity/Word.php
+++ b/src/bariew/FineDiff/Granularity/Word.php
@@ -7,18 +7,18 @@
* one string into another.
*
* Originally created by Raymond Hill (https://github.com/gorhill/PHP-FineDiff), brought up
- * to date by Cog Powered (https://github.com/cogpowered/FineDiff).
+ * to date by Cog Powered (https://github.com/bariew/FineDiff).
*
* @copyright Copyright 2011 (c) Raymond Hill (http://raymondhill.net/blog/?p=441)
- * @copyright Copyright 2013 (c) Robert Crowe (http://cogpowered.com)
- * @link https://github.com/cogpowered/FineDiff
+ * @copyright Copyright 2013 (c) Robert Crowe (http://bariew.com)
+ * @link https://github.com/bariew/FineDiff
* @version 0.0.1
* @license MIT License (http://www.opensource.org/licenses/mit-license.php)
*/
-namespace cogpowered\FineDiff\Granularity;
+namespace bariew\FineDiff\Granularity;
-use cogpowered\FineDiff\Delimiters;
+use bariew\FineDiff\Delimiters;
/**
* Word level granularity.
diff --git a/src/cogpowered/FineDiff/Parser/Opcodes.php b/src/bariew/FineDiff/Parser/Opcodes.php
similarity index 78%
rename from src/cogpowered/FineDiff/Parser/Opcodes.php
rename to src/bariew/FineDiff/Parser/Opcodes.php
index d922727..6484017 100644
--- a/src/cogpowered/FineDiff/Parser/Opcodes.php
+++ b/src/bariew/FineDiff/Parser/Opcodes.php
@@ -7,18 +7,18 @@
* one string into another.
*
* Originally created by Raymond Hill (https://github.com/gorhill/PHP-FineDiff), brought up
- * to date by Cog Powered (https://github.com/cogpowered/FineDiff).
+ * to date by Cog Powered (https://github.com/bariew/FineDiff).
*
* @copyright Copyright 2011 (c) Raymond Hill (http://raymondhill.net/blog/?p=441)
- * @copyright Copyright 2013 (c) Robert Crowe (http://cogpowered.com)
- * @link https://github.com/cogpowered/FineDiff
+ * @copyright Copyright 2013 (c) Robert Crowe (http://bariew.com)
+ * @link https://github.com/bariew/FineDiff
* @version 0.0.1
* @license MIT License (http://www.opensource.org/licenses/mit-license.php)
*/
-namespace cogpowered\FineDiff\Parser;
+namespace bariew\FineDiff\Parser;
-use cogpowered\FineDiff\Exceptions\OperationException;
+use bariew\FineDiff\Exceptions\OperationException;
/**
* Holds all the opcodes returned by the parser.
@@ -48,7 +48,7 @@ public function setOpcodes(array $opcodes)
// Ensure that all elements of the array
// are of the correct type
foreach ($opcodes as $opcode) {
- if (!is_a($opcode, 'cogpowered\FineDiff\Parser\Operations\OperationInterface')) {
+ if (!is_a($opcode, 'bariew\FineDiff\Parser\Operations\OperationInterface')) {
throw new OperationException('Invalid opcode object');
}
diff --git a/src/cogpowered/FineDiff/Parser/OpcodesInterface.php b/src/bariew/FineDiff/Parser/OpcodesInterface.php
similarity index 70%
rename from src/cogpowered/FineDiff/Parser/OpcodesInterface.php
rename to src/bariew/FineDiff/Parser/OpcodesInterface.php
index 29b379c..3fc3528 100644
--- a/src/cogpowered/FineDiff/Parser/OpcodesInterface.php
+++ b/src/bariew/FineDiff/Parser/OpcodesInterface.php
@@ -7,16 +7,16 @@
* one string into another.
*
* Originally created by Raymond Hill (https://github.com/gorhill/PHP-FineDiff), brought up
- * to date by Cog Powered (https://github.com/cogpowered/FineDiff).
+ * to date by Cog Powered (https://github.com/bariew/FineDiff).
*
* @copyright Copyright 2011 (c) Raymond Hill (http://raymondhill.net/blog/?p=441)
- * @copyright Copyright 2013 (c) Robert Crowe (http://cogpowered.com)
- * @link https://github.com/cogpowered/FineDiff
+ * @copyright Copyright 2013 (c) Robert Crowe (http://bariew.com)
+ * @link https://github.com/bariew/FineDiff
* @version 0.0.1
* @license MIT License (http://www.opensource.org/licenses/mit-license.php)
*/
-namespace cogpowered\FineDiff\Parser;
+namespace bariew\FineDiff\Parser;
interface OpcodesInterface
{
@@ -30,8 +30,8 @@ public function getOpcodes();
/**
* Set the opcodes for this parse.
*
- * @param array $opcodes Elements must be an instance of cogpowered\FineDiff\Parser\Operations\OperationInterface.
- * @throws cogpowered\FineDiff\Exceptions\OperationException
+ * @param array $opcodes Elements must be an instance of bariew\FineDiff\Parser\Operations\OperationInterface.
+ * @throws bariew\FineDiff\Exceptions\OperationException
* @return void
*/
public function setOpcodes(array $opcodes);
diff --git a/src/cogpowered/FineDiff/Parser/Operations/Copy.php b/src/bariew/FineDiff/Parser/Operations/Copy.php
similarity index 84%
rename from src/cogpowered/FineDiff/Parser/Operations/Copy.php
rename to src/bariew/FineDiff/Parser/Operations/Copy.php
index a79b7d6..fd5e2be 100644
--- a/src/cogpowered/FineDiff/Parser/Operations/Copy.php
+++ b/src/bariew/FineDiff/Parser/Operations/Copy.php
@@ -7,16 +7,16 @@
* one string into another.
*
* Originally created by Raymond Hill (https://github.com/gorhill/PHP-FineDiff), brought up
- * to date by Cog Powered (https://github.com/cogpowered/FineDiff).
+ * to date by Cog Powered (https://github.com/bariew/FineDiff).
*
* @copyright Copyright 2011 (c) Raymond Hill (http://raymondhill.net/blog/?p=441)
- * @copyright Copyright 2013 (c) Robert Crowe (http://cogpowered.com)
- * @link https://github.com/cogpowered/FineDiff
+ * @copyright Copyright 2013 (c) Robert Crowe (http://bariew.com)
+ * @link https://github.com/bariew/FineDiff
* @version 0.0.1
* @license MIT License (http://www.opensource.org/licenses/mit-license.php)
*/
-namespace cogpowered\FineDiff\Parser\Operations;
+namespace bariew\FineDiff\Parser\Operations;
/**
* Generates the opcode for a copy operation.
diff --git a/src/cogpowered/FineDiff/Parser/Operations/Delete.php b/src/bariew/FineDiff/Parser/Operations/Delete.php
similarity index 82%
rename from src/cogpowered/FineDiff/Parser/Operations/Delete.php
rename to src/bariew/FineDiff/Parser/Operations/Delete.php
index 05073e2..a4600e1 100644
--- a/src/cogpowered/FineDiff/Parser/Operations/Delete.php
+++ b/src/bariew/FineDiff/Parser/Operations/Delete.php
@@ -7,16 +7,16 @@
* one string into another.
*
* Originally created by Raymond Hill (https://github.com/gorhill/PHP-FineDiff), brought up
- * to date by Cog Powered (https://github.com/cogpowered/FineDiff).
+ * to date by Cog Powered (https://github.com/bariew/FineDiff).
*
* @copyright Copyright 2011 (c) Raymond Hill (http://raymondhill.net/blog/?p=441)
- * @copyright Copyright 2013 (c) Robert Crowe (http://cogpowered.com)
- * @link https://github.com/cogpowered/FineDiff
+ * @copyright Copyright 2013 (c) Robert Crowe (http://bariew.com)
+ * @link https://github.com/bariew/FineDiff
* @version 0.0.1
* @license MIT License (http://www.opensource.org/licenses/mit-license.php)
*/
-namespace cogpowered\FineDiff\Parser\Operations;
+namespace bariew\FineDiff\Parser\Operations;
/**
* Generates the opcode for a delete operation.
diff --git a/src/cogpowered/FineDiff/Parser/Operations/Insert.php b/src/bariew/FineDiff/Parser/Operations/Insert.php
similarity index 79%
rename from src/cogpowered/FineDiff/Parser/Operations/Insert.php
rename to src/bariew/FineDiff/Parser/Operations/Insert.php
index 64a73c2..9ca2cce 100644
--- a/src/cogpowered/FineDiff/Parser/Operations/Insert.php
+++ b/src/bariew/FineDiff/Parser/Operations/Insert.php
@@ -7,16 +7,16 @@
* one string into another.
*
* Originally created by Raymond Hill (https://github.com/gorhill/PHP-FineDiff), brought up
- * to date by Cog Powered (https://github.com/cogpowered/FineDiff).
+ * to date by Cog Powered (https://github.com/bariew/FineDiff).
*
* @copyright Copyright 2011 (c) Raymond Hill (http://raymondhill.net/blog/?p=441)
- * @copyright Copyright 2013 (c) Robert Crowe (http://cogpowered.com)
- * @link https://github.com/cogpowered/FineDiff
+ * @copyright Copyright 2013 (c) Robert Crowe (http://bariew.com)
+ * @link https://github.com/bariew/FineDiff
* @version 0.0.1
* @license MIT License (http://www.opensource.org/licenses/mit-license.php)
*/
-namespace cogpowered\FineDiff\Parser\Operations;
+namespace bariew\FineDiff\Parser\Operations;
/**
* Generates the opcode for a copy operation.
@@ -46,7 +46,7 @@ public function getFromLen()
*/
public function getToLen()
{
- return strlen($this->text);
+ return mb_strlen($this->text);
}
/**
@@ -62,7 +62,7 @@ public function getText()
*/
public function getOpcode()
{
- $to_len = strlen($this->text);
+ $to_len = mb_strlen($this->text);
if ( $to_len === 1 ) {
return "i:{$this->text}";
diff --git a/src/cogpowered/FineDiff/Parser/Operations/OperationInterface.php b/src/bariew/FineDiff/Parser/Operations/OperationInterface.php
similarity index 74%
rename from src/cogpowered/FineDiff/Parser/Operations/OperationInterface.php
rename to src/bariew/FineDiff/Parser/Operations/OperationInterface.php
index c497f21..fa87c4b 100644
--- a/src/cogpowered/FineDiff/Parser/Operations/OperationInterface.php
+++ b/src/bariew/FineDiff/Parser/Operations/OperationInterface.php
@@ -7,16 +7,16 @@
* one string into another.
*
* Originally created by Raymond Hill (https://github.com/gorhill/PHP-FineDiff), brought up
- * to date by Cog Powered (https://github.com/cogpowered/FineDiff).
+ * to date by Cog Powered (https://github.com/bariew/FineDiff).
*
* @copyright Copyright 2011 (c) Raymond Hill (http://raymondhill.net/blog/?p=441)
- * @copyright Copyright 2013 (c) Robert Crowe (http://cogpowered.com)
- * @link https://github.com/cogpowered/FineDiff
+ * @copyright Copyright 2013 (c) Robert Crowe (http://bariew.com)
+ * @link https://github.com/bariew/FineDiff
* @version 0.0.1
* @license MIT License (http://www.opensource.org/licenses/mit-license.php)
*/
-namespace cogpowered\FineDiff\Parser\Operations;
+namespace bariew\FineDiff\Parser\Operations;
interface OperationInterface
{
diff --git a/src/cogpowered/FineDiff/Parser/Operations/Replace.php b/src/bariew/FineDiff/Parser/Operations/Replace.php
similarity index 81%
rename from src/cogpowered/FineDiff/Parser/Operations/Replace.php
rename to src/bariew/FineDiff/Parser/Operations/Replace.php
index 515af13..f5fb660 100644
--- a/src/cogpowered/FineDiff/Parser/Operations/Replace.php
+++ b/src/bariew/FineDiff/Parser/Operations/Replace.php
@@ -7,16 +7,16 @@
* one string into another.
*
* Originally created by Raymond Hill (https://github.com/gorhill/PHP-FineDiff), brought up
- * to date by Cog Powered (https://github.com/cogpowered/FineDiff).
+ * to date by Cog Powered (https://github.com/bariew/FineDiff).
*
* @copyright Copyright 2011 (c) Raymond Hill (http://raymondhill.net/blog/?p=441)
- * @copyright Copyright 2013 (c) Robert Crowe (http://cogpowered.com)
- * @link https://github.com/cogpowered/FineDiff
+ * @copyright Copyright 2013 (c) Robert Crowe (http://bariew.com)
+ * @link https://github.com/bariew/FineDiff
* @version 0.0.1
* @license MIT License (http://www.opensource.org/licenses/mit-license.php)
*/
-namespace cogpowered\FineDiff\Parser\Operations;
+namespace bariew\FineDiff\Parser\Operations;
class Replace implements OperationInterface
{
@@ -43,7 +43,7 @@ public function getFromLen()
*/
public function getToLen()
{
- return strlen($this->text);
+ return mb_strlen($this->text);
}
/**
@@ -67,7 +67,7 @@ public function getOpcode()
$del_opcode = "d{$this->fromLen}";
}
- $to_len = strlen($this->text);
+ $to_len = mb_strlen($this->text);
if ($to_len === 1) {
return "{$del_opcode}i:{$this->text}";
diff --git a/src/cogpowered/FineDiff/Parser/Parser.php b/src/bariew/FineDiff/Parser/Parser.php
similarity index 87%
rename from src/cogpowered/FineDiff/Parser/Parser.php
rename to src/bariew/FineDiff/Parser/Parser.php
index b85415b..bbf46fd 100644
--- a/src/cogpowered/FineDiff/Parser/Parser.php
+++ b/src/bariew/FineDiff/Parser/Parser.php
@@ -7,23 +7,23 @@
* one string into another.
*
* Originally created by Raymond Hill (https://github.com/gorhill/PHP-FineDiff), brought up
- * to date by Cog Powered (https://github.com/cogpowered/FineDiff).
+ * to date by Cog Powered (https://github.com/bariew/FineDiff).
*
* @copyright Copyright 2011 (c) Raymond Hill (http://raymondhill.net/blog/?p=441)
- * @copyright Copyright 2013 (c) Robert Crowe (http://cogpowered.com)
- * @link https://github.com/cogpowered/FineDiff
+ * @copyright Copyright 2013 (c) Robert Crowe (http://bariew.com)
+ * @link https://github.com/bariew/FineDiff
* @version 0.0.1
* @license MIT License (http://www.opensource.org/licenses/mit-license.php)
*/
-namespace cogpowered\FineDiff\Parser;
+namespace bariew\FineDiff\Parser;
-use cogpowered\FineDiff\Granularity\GranularityInterface;
-use cogpowered\FineDiff\Exceptions\GranularityCountException;
-use cogpowered\FineDiff\Parser\Operations\Copy;
-use cogpowered\FineDiff\Parser\Operations\Delete;
-use cogpowered\FineDiff\Parser\Operations\Insert;
-use cogpowered\FineDiff\Parser\Operations\Replace;
+use bariew\FineDiff\Granularity\GranularityInterface;
+use bariew\FineDiff\Exceptions\GranularityCountException;
+use bariew\FineDiff\Parser\Operations\Copy;
+use bariew\FineDiff\Parser\Operations\Delete;
+use bariew\FineDiff\Parser\Operations\Insert;
+use bariew\FineDiff\Parser\Operations\Replace;
/**
* Generates a set of instructions to convert one string to another.
@@ -31,12 +31,12 @@
class Parser implements ParserInterface
{
/**
- * @var cogpowered\FineDiff\GranularityInterface
+ * @var bariew\FineDiff\GranularityInterface
*/
protected $granularity;
/**
- * @var cogpowered\FineDiff\Parser\OpcodesInterface
+ * @var bariew\FineDiff\Parser\OpcodesInterface
*/
protected $opcodes;
@@ -51,7 +51,7 @@ class Parser implements ParserInterface
protected $from_offset = 0;
/**
- * @var cogpowered\FineDiff\Operations\OperationInterface
+ * @var bariew\FineDiff\Operations\OperationInterface
*/
protected $last_edit;
@@ -155,7 +155,7 @@ protected function process($from_text, $to_text)
// increase granularity
if ($fragment instanceof Replace && $has_next_stage) {
$this->process(
- substr($this->from_text, $this->from_offset, $fragment->getFromLen()),
+ mb_substr($this->from_text, $this->from_offset, $fragment->getFromLen()),
$fragment->getText()
);
}
@@ -195,8 +195,8 @@ protected function diff($from_text, $to_text, $delimiters)
$result = array();
// fragment-level diffing
- $from_text_len = strlen($from_text);
- $to_text_len = strlen($to_text);
+ $from_text_len = mb_strlen($from_text);
+ $to_text_len = mb_strlen($to_text);
$from_fragments = $this->extractFragments($from_text, $delimiters);
$to_fragments = $this->extractFragments($to_text, $delimiters);
@@ -218,7 +218,7 @@ protected function diff($from_text, $to_text, $delimiters)
if ( $from_segment_length ) {
$result[$from_segment_start * 4] = new Delete($from_segment_length);
} else if ( $to_segment_length ) {
- $result[$from_segment_start * 4 + 1] = new Insert(substr($to_text, $to_segment_start, $to_segment_length));
+ $result[$from_segment_start * 4 + 1] = new Insert(mb_substr($to_text, $to_segment_start, $to_segment_length));
}
continue;
@@ -233,7 +233,7 @@ protected function diff($from_text, $to_text, $delimiters)
while ( $from_base_fragment_index < $from_segment_end ) {
$from_base_fragment = $from_fragments[$from_base_fragment_index];
- $from_base_fragment_length = strlen($from_base_fragment);
+ $from_base_fragment_length = mb_strlen($from_base_fragment);
// performance boost: cache array keys
if (!isset($cached_array_keys_for_current_segment[$from_base_fragment])) {
@@ -297,7 +297,7 @@ protected function diff($from_text, $to_text, $delimiters)
break;
}
- $fragment_length = strlen($from_fragments[$fragment_from_index]);
+ $fragment_length = mb_strlen($from_fragments[$fragment_from_index]);
$fragment_index_offset += $fragment_length;
}
@@ -308,7 +308,7 @@ protected function diff($from_text, $to_text, $delimiters)
}
}
- $from_base_fragment_index += strlen($from_base_fragment);
+ $from_base_fragment_index += mb_strlen($from_base_fragment);
// If match is larger than half segment size, no point trying to find better
// TODO: Really?
@@ -328,7 +328,7 @@ protected function diff($from_text, $to_text, $delimiters)
$result[$best_from_start * 4 + 2] = new Copy($best_copy_length);
$jobs[] = array($best_from_start + $best_copy_length, $from_segment_end, $best_to_start + $best_copy_length, $to_segment_end);
} else {
- $result[$from_segment_start * 4 ] = new Replace($from_segment_length, substr($to_text, $to_segment_start, $to_segment_length));
+ $result[$from_segment_start * 4 ] = new Replace($from_segment_length, mb_substr($to_text, $to_segment_start, $to_segment_length));
}
}
@@ -346,7 +346,7 @@ protected function diff($from_text, $to_text, $delimiters)
protected function charDiff($from_text, $to_text)
{
$result = array();
- $jobs = array(array(0, strlen($from_text), 0, strlen($to_text)));
+ $jobs = array(array(0, mb_strlen($from_text), 0, mb_strlen($to_text)));
while ($job = array_pop($jobs)) {
@@ -362,7 +362,7 @@ protected function charDiff($from_text, $to_text)
if ($from_segment_len) {
$result[$from_segment_start * 4 + 0] = new Delete($from_segment_len);
} else if ( $to_segment_len ) {
- $result[$from_segment_start * 4 + 1] = new Insert(substr($to_text, $to_segment_start, $to_segment_len));
+ $result[$from_segment_start * 4 + 1] = new Insert(mb_substr($to_text, $to_segment_start, $to_segment_len));
}
continue;
@@ -379,7 +379,7 @@ protected function charDiff($from_text, $to_text)
while ($to_copy_start <= $to_copy_start_max) {
- $from_copy_start = strpos(substr($from_text, $from_segment_start, $from_segment_len), substr($to_text, $to_copy_start, $copy_len));
+ $from_copy_start = mb_strpos(mb_substr($from_text, $from_segment_start, $from_segment_len), mb_substr($to_text, $to_copy_start, $copy_len));
if ($from_copy_start !== false) {
$from_copy_start += $from_segment_start;
@@ -402,7 +402,7 @@ protected function charDiff($from_text, $to_text)
while ($from_copy_start <= $from_copy_start_max) {
- $to_copy_start = strpos(substr($to_text, $to_segment_start, $to_segment_len), substr($from_text, $from_copy_start, $copy_len));
+ $to_copy_start = mb_strpos(mb_substr($to_text, $to_segment_start, $to_segment_len), mb_substr($from_text, $from_copy_start, $copy_len));
if ($to_copy_start !== false) {
$to_copy_start += $to_segment_start;
@@ -424,7 +424,7 @@ protected function charDiff($from_text, $to_text)
}
// no match, so delete all, insert all
else {
- $result[$from_segment_start * 4] = new Replace($from_segment_len, substr($to_text, $to_segment_start, $to_segment_len));
+ $result[$from_segment_start * 4] = new Replace($from_segment_len, mb_substr($to_text, $to_segment_start, $to_segment_len));
}
}
@@ -448,7 +448,7 @@ protected function extractFragments($text, $delimiters)
// special case: split into characters
if (empty($delimiters)) {
$chars = str_split($text, 1);
- $chars[strlen($text)] = '';
+ $chars[mb_strlen($text)] = '';
return $chars;
}
@@ -466,7 +466,7 @@ protected function extractFragments($text, $delimiters)
break;
}
- $fragments[$start] = substr($text, $start, $end - $start);
+ $fragments[$start] = mb_substr($text, $start, $end - $start);
$start = $end;
}
diff --git a/src/cogpowered/FineDiff/Parser/ParserInterface.php b/src/bariew/FineDiff/Parser/ParserInterface.php
similarity index 52%
rename from src/cogpowered/FineDiff/Parser/ParserInterface.php
rename to src/bariew/FineDiff/Parser/ParserInterface.php
index 6d36d80..ac2bf8b 100644
--- a/src/cogpowered/FineDiff/Parser/ParserInterface.php
+++ b/src/bariew/FineDiff/Parser/ParserInterface.php
@@ -7,51 +7,51 @@
* one string into another.
*
* Originally created by Raymond Hill (https://github.com/gorhill/PHP-FineDiff), brought up
- * to date by Cog Powered (https://github.com/cogpowered/FineDiff).
+ * to date by Cog Powered (https://github.com/bariew/FineDiff).
*
* @copyright Copyright 2011 (c) Raymond Hill (http://raymondhill.net/blog/?p=441)
- * @copyright Copyright 2013 (c) Robert Crowe (http://cogpowered.com)
- * @link https://github.com/cogpowered/FineDiff
+ * @copyright Copyright 2013 (c) Robert Crowe (http://bariew.com)
+ * @link https://github.com/bariew/FineDiff
* @version 0.0.1
* @license MIT License (http://www.opensource.org/licenses/mit-license.php)
*/
-namespace cogpowered\FineDiff\Parser;
+namespace bariew\FineDiff\Parser;
-use cogpowered\FineDiff\Granularity\GranularityInterface;
+use bariew\FineDiff\Granularity\GranularityInterface;
interface ParserInterface
{
/**
* Creates an instance.
*
- * @param cogpowered\FineDiff\Granularity\GranularityInterface
+ * @param bariew\FineDiff\Granularity\GranularityInterface
*/
public function __construct(GranularityInterface $granularity);
/**
* Granularity the parser is working with.
*
- * Default is cogpowered\FineDiff\Granularity\Character.
+ * Default is bariew\FineDiff\Granularity\Character.
*
- * @see cogpowered\FineDiff\Granularity\Character
- * @see cogpowered\FineDiff\Granularity\Word
- * @see cogpowered\FineDiff\Granularity\Sentence
- * @see cogpowered\FineDiff\Granularity\Paragraph
+ * @see bariew\FineDiff\Granularity\Character
+ * @see bariew\FineDiff\Granularity\Word
+ * @see bariew\FineDiff\Granularity\Sentence
+ * @see bariew\FineDiff\Granularity\Paragraph
*
- * @return cogpowered\FineDiff\Granularity\GranularityInterface
+ * @return bariew\FineDiff\Granularity\GranularityInterface
*/
public function getGranularity();
/**
* Set the granularity that the parser is working with.
*
- * @see cogpowered\FineDiff\Granularity\Character
- * @see cogpowered\FineDiff\Granularity\Word
- * @see cogpowered\FineDiff\Granularity\Sentence
- * @see cogpowered\FineDiff\Granularity\Paragraph
+ * @see bariew\FineDiff\Granularity\Character
+ * @see bariew\FineDiff\Granularity\Word
+ * @see bariew\FineDiff\Granularity\Sentence
+ * @see bariew\FineDiff\Granularity\Paragraph
*
- * @param cogpowered\FineDiff\Granularity\GranularityInterface
+ * @param bariew\FineDiff\Granularity\GranularityInterface
* @return void
*/
public function setGranularity(GranularityInterface $granularity);
@@ -59,14 +59,14 @@ public function setGranularity(GranularityInterface $granularity);
/**
* Get the opcodes object that is used to store all the opcodes.
*
- * @return cogpowered\FineDiff\Parser\OpcodesInterface
+ * @return bariew\FineDiff\Parser\OpcodesInterface
*/
public function getOpcodes();
/**
* Set the opcodes object used to store all the opcodes for this parse.
*
- * @param cogpowered\FineDiff\Parser\OpcodesInterface $opcodes.
+ * @param bariew\FineDiff\Parser\OpcodesInterface $opcodes.
* @return void
*/
public function setOpcodes(OpcodesInterface $opcodes);
@@ -76,8 +76,8 @@ public function setOpcodes(OpcodesInterface $opcodes);
*
* @param string $from_text
* @param string $to_text
- * @throws cogpowered\FineDiff\Exceptions\GranularityCountException
- * @return cogpowered\FineDiff\Parser\OpcodesInterface
+ * @throws bariew\FineDiff\Exceptions\GranularityCountException
+ * @return bariew\FineDiff\Parser\OpcodesInterface
*/
public function parse($from_text, $to_text);
}
\ No newline at end of file
diff --git a/src/cogpowered/FineDiff/Render/Html.php b/src/bariew/FineDiff/Render/Html.php
similarity index 64%
rename from src/cogpowered/FineDiff/Render/Html.php
rename to src/bariew/FineDiff/Render/Html.php
index 3788598..ca9c612 100644
--- a/src/cogpowered/FineDiff/Render/Html.php
+++ b/src/bariew/FineDiff/Render/Html.php
@@ -7,28 +7,28 @@
* one string into another.
*
* Originally created by Raymond Hill (https://github.com/gorhill/PHP-FineDiff), brought up
- * to date by Cog Powered (https://github.com/cogpowered/FineDiff).
+ * to date by Cog Powered (https://github.com/bariew/FineDiff).
*
* @copyright Copyright 2011 (c) Raymond Hill (http://raymondhill.net/blog/?p=441)
- * @copyright Copyright 2013 (c) Robert Crowe (http://cogpowered.com)
- * @link https://github.com/cogpowered/FineDiff
+ * @copyright Copyright 2013 (c) Robert Crowe (http://bariew.com)
+ * @link https://github.com/bariew/FineDiff
* @version 0.0.1
* @license MIT License (http://www.opensource.org/licenses/mit-license.php)
*/
-namespace cogpowered\FineDiff\Render;
+namespace bariew\FineDiff\Render;
-use cogpowered\FineDiff\Parser\OpcodeInterface;
+use bariew\FineDiff\Parser\OpcodeInterface;
class Html extends Renderer
{
public function callback($opcode, $from, $from_offset, $from_len)
{
if ($opcode === 'c') {
- $html = htmlentities(substr($from, $from_offset, $from_len));
+ $html = htmlentities(mb_substr($from, $from_offset, $from_len));
} else if ($opcode === 'd') {
- $deletion = substr($from, $from_offset, $from_len);
+ $deletion = mb_substr($from, $from_offset, $from_len);
if (strcspn($deletion, " \n\r") === 0) {
$deletion = str_replace(array("\n","\r"), array('\n','\r'), $deletion);
@@ -37,7 +37,7 @@ public function callback($opcode, $from, $from_offset, $from_len)
$html = ''.htmlentities($deletion).'';
} else /* if ( $opcode === 'i' ) */ {
- $html = ''.htmlentities(substr($from, $from_offset, $from_len)).'';
+ $html = ''.htmlentities(mb_substr($from, $from_offset, $from_len)).'';
}
return $html;
diff --git a/src/cogpowered/FineDiff/Render/Renderer.php b/src/bariew/FineDiff/Render/Renderer.php
similarity index 78%
rename from src/cogpowered/FineDiff/Render/Renderer.php
rename to src/bariew/FineDiff/Render/Renderer.php
index 7d848ea..44fa50f 100644
--- a/src/cogpowered/FineDiff/Render/Renderer.php
+++ b/src/bariew/FineDiff/Render/Renderer.php
@@ -7,18 +7,18 @@
* one string into another.
*
* Originally created by Raymond Hill (https://github.com/gorhill/PHP-FineDiff), brought up
- * to date by Cog Powered (https://github.com/cogpowered/FineDiff).
+ * to date by Cog Powered (https://github.com/bariew/FineDiff).
*
* @copyright Copyright 2011 (c) Raymond Hill (http://raymondhill.net/blog/?p=441)
- * @copyright Copyright 2013 (c) Robert Crowe (http://cogpowered.com)
- * @link https://github.com/cogpowered/FineDiff
+ * @copyright Copyright 2013 (c) Robert Crowe (http://bariew.com)
+ * @link https://github.com/bariew/FineDiff
* @version 0.0.1
* @license MIT License (http://www.opensource.org/licenses/mit-license.php)
*/
-namespace cogpowered\FineDiff\Render;
+namespace bariew\FineDiff\Render;
-use cogpowered\FineDiff\Parser\OpcodesInterface;
+use bariew\FineDiff\Parser\OpcodesInterface;
use InvalidArgumentException;
abstract class Renderer implements RendererInterface
@@ -27,7 +27,7 @@ abstract class Renderer implements RendererInterface
* Covert text based on the provided opcodes.
*
* @param string $from_text
- * @param string|\cogpowered\FineDiff\Parser\OpcodesInterface $opcodes
+ * @param string|\bariew\FineDiff\Parser\OpcodesInterface $opcodes
*
* @return string
*/
@@ -43,18 +43,18 @@ public function process($from_text, $opcodes)
// Holds the generated string that is returned
$output = '';
- $opcodes_len = strlen($opcodes);
+ $opcodes_len = mb_strlen($opcodes);
$from_offset = 0;
$opcodes_offset = 0;
while ($opcodes_offset < $opcodes_len) {
- $opcode = substr($opcodes, $opcodes_offset, 1);
+ $opcode = mb_substr($opcodes, $opcodes_offset, 1);
$opcodes_offset++;
- $n = intval(substr($opcodes, $opcodes_offset));
+ $n = intval(mb_substr($opcodes, $opcodes_offset));
if ($n) {
- $opcodes_offset += strlen(strval($n));
+ $opcodes_offset += mb_strlen(strval($n));
} else {
$n = 1;
}
diff --git a/src/cogpowered/FineDiff/Render/RendererInterface.php b/src/bariew/FineDiff/Render/RendererInterface.php
similarity index 71%
rename from src/cogpowered/FineDiff/Render/RendererInterface.php
rename to src/bariew/FineDiff/Render/RendererInterface.php
index 1b9f2cd..6fd137e 100644
--- a/src/cogpowered/FineDiff/Render/RendererInterface.php
+++ b/src/bariew/FineDiff/Render/RendererInterface.php
@@ -7,16 +7,16 @@
* one string into another.
*
* Originally created by Raymond Hill (https://github.com/gorhill/PHP-FineDiff), brought up
- * to date by Cog Powered (https://github.com/cogpowered/FineDiff).
+ * to date by Cog Powered (https://github.com/bariew/FineDiff).
*
* @copyright Copyright 2011 (c) Raymond Hill (http://raymondhill.net/blog/?p=441)
- * @copyright Copyright 2013 (c) Robert Crowe (http://cogpowered.com)
- * @link https://github.com/cogpowered/FineDiff
+ * @copyright Copyright 2013 (c) Robert Crowe (http://bariew.com)
+ * @link https://github.com/bariew/FineDiff
* @version 0.0.1
* @license MIT License (http://www.opensource.org/licenses/mit-license.php)
*/
-namespace cogpowered\FineDiff\Render;
+namespace bariew\FineDiff\Render;
interface RendererInterface
{
diff --git a/src/cogpowered/FineDiff/Render/Text.php b/src/bariew/FineDiff/Render/Text.php
similarity index 68%
rename from src/cogpowered/FineDiff/Render/Text.php
rename to src/bariew/FineDiff/Render/Text.php
index 699e864..29a009e 100644
--- a/src/cogpowered/FineDiff/Render/Text.php
+++ b/src/bariew/FineDiff/Render/Text.php
@@ -7,23 +7,23 @@
* one string into another.
*
* Originally created by Raymond Hill (https://github.com/gorhill/PHP-FineDiff), brought up
- * to date by Cog Powered (https://github.com/cogpowered/FineDiff).
+ * to date by Cog Powered (https://github.com/bariew/FineDiff).
*
* @copyright Copyright 2011 (c) Raymond Hill (http://raymondhill.net/blog/?p=441)
- * @copyright Copyright 2013 (c) Robert Crowe (http://cogpowered.com)
- * @link https://github.com/cogpowered/FineDiff
+ * @copyright Copyright 2013 (c) Robert Crowe (http://bariew.com)
+ * @link https://github.com/bariew/FineDiff
* @version 0.0.1
* @license MIT License (http://www.opensource.org/licenses/mit-license.php)
*/
-namespace cogpowered\FineDiff\Render;
+namespace bariew\FineDiff\Render;
class Text extends Renderer
{
public function callback($opcode, $from, $from_offset, $from_len)
{
if ($opcode === 'c' || $opcode === 'i') {
- return substr($from, $from_offset, $from_len);
+ return mb_substr($from, $from_offset, $from_len);
}
return '';
diff --git a/tests/Delimiters/ConstantsTest.php b/tests/Delimiters/ConstantsTest.php
index 2acb5b7..00c052b 100644
--- a/tests/Delimiters/ConstantsTest.php
+++ b/tests/Delimiters/ConstantsTest.php
@@ -3,7 +3,7 @@
namespace FineDiffTests\Delimiters;
use PHPUnit_Framework_TestCase;
-use cogpowered\FineDiff\Delimiters;
+use bariew\FineDiff\Delimiters;
class ConstantsTest extends PHPUnit_Framework_TestCase
{
diff --git a/tests/Delimiters/EnumTest.php b/tests/Delimiters/EnumTest.php
index 7605f04..4625374 100644
--- a/tests/Delimiters/EnumTest.php
+++ b/tests/Delimiters/EnumTest.php
@@ -8,7 +8,7 @@ class EnumTest extends PHPUnit_Framework_TestCase
{
public function testCantInstantiate()
{
- $class = new \ReflectionClass('cogpowered\FineDiff\Delimiters');
+ $class = new \ReflectionClass('bariew\FineDiff\Delimiters');
$methods = $class->getMethods(\ReflectionMethod::IS_PRIVATE);
$this->assertTrue(count($methods) >= 1);
diff --git a/tests/Diff/DefaultsTest.php b/tests/Diff/DefaultsTest.php
index 99ae543..9732314 100644
--- a/tests/Diff/DefaultsTest.php
+++ b/tests/Diff/DefaultsTest.php
@@ -3,7 +3,7 @@
namespace FineDiffTests\Diff;
use PHPUnit_Framework_TestCase;
-use cogpowered\FineDiff\Diff;
+use bariew\FineDiff\Diff;
class DefaultsTest extends PHPUnit_Framework_TestCase
{
@@ -14,21 +14,21 @@ public function setUp()
public function testGetGranularity()
{
- $this->assertTrue(is_a($this->diff->getGranularity(), 'cogpowered\FineDiff\Granularity\Character'));
- $this->assertTrue(is_a($this->diff->getGranularity(), 'cogpowered\FineDiff\Granularity\Granularity'));
- $this->assertTrue(is_a($this->diff->getGranularity(), 'cogpowered\FineDiff\Granularity\GranularityInterface'));
+ $this->assertTrue(is_a($this->diff->getGranularity(), 'bariew\FineDiff\Granularity\Character'));
+ $this->assertTrue(is_a($this->diff->getGranularity(), 'bariew\FineDiff\Granularity\Granularity'));
+ $this->assertTrue(is_a($this->diff->getGranularity(), 'bariew\FineDiff\Granularity\GranularityInterface'));
}
public function testGetRenderer()
{
- $this->assertTrue(is_a($this->diff->getRenderer(), 'cogpowered\FineDiff\Render\Html'));
- $this->assertTrue(is_a($this->diff->getRenderer(), 'cogpowered\FineDiff\Render\Renderer'));
- $this->assertTrue(is_a($this->diff->getRenderer(), 'cogpowered\FineDiff\Render\RendererInterface'));
+ $this->assertTrue(is_a($this->diff->getRenderer(), 'bariew\FineDiff\Render\Html'));
+ $this->assertTrue(is_a($this->diff->getRenderer(), 'bariew\FineDiff\Render\Renderer'));
+ $this->assertTrue(is_a($this->diff->getRenderer(), 'bariew\FineDiff\Render\RendererInterface'));
}
public function testGetParser()
{
- $this->assertTrue(is_a($this->diff->getParser(), 'cogpowered\FineDiff\Parser\Parser'));
- $this->assertTrue(is_a($this->diff->getParser(), 'cogpowered\FineDiff\Parser\ParserInterface'));
+ $this->assertTrue(is_a($this->diff->getParser(), 'bariew\FineDiff\Parser\Parser'));
+ $this->assertTrue(is_a($this->diff->getParser(), 'bariew\FineDiff\Parser\ParserInterface'));
}
}
\ No newline at end of file
diff --git a/tests/Diff/DependencyInjectTest.php b/tests/Diff/DependencyInjectTest.php
index 9afb923..baa6c05 100644
--- a/tests/Diff/DependencyInjectTest.php
+++ b/tests/Diff/DependencyInjectTest.php
@@ -4,7 +4,7 @@
use PHPUnit_Framework_TestCase;
use Mockery as m;
-use cogpowered\FineDiff\Diff;
+use bariew\FineDiff\Diff;
class DependencyInjectTest extends PHPUnit_Framework_TestCase
{
@@ -15,7 +15,7 @@ public function tearDown()
public function testGetGranularity()
{
- $character = m::mock('cogpowered\FineDiff\Granularity\Character');
+ $character = m::mock('bariew\FineDiff\Granularity\Character');
$character->shouldReceive('justTesting')->once();
$diff = new Diff($character);
@@ -26,7 +26,7 @@ public function testGetGranularity()
public function testGetRenderer()
{
- $html = m::mock('cogpowered\FineDiff\Render\Html');
+ $html = m::mock('bariew\FineDiff\Render\Html');
$html->shouldReceive('justTesting')->once();
$diff = new Diff(null, $html);
@@ -37,13 +37,13 @@ public function testGetRenderer()
public function testRender()
{
- $opcodes = m::mock('cogpowered\FineDiff\Parser\Opcodes');
+ $opcodes = m::mock('bariew\FineDiff\Parser\Opcodes');
$opcodes->shouldReceive('generate')->andReturn('c12');
- $parser = m::mock('cogpowered\FineDiff\Parser\Parser');
+ $parser = m::mock('bariew\FineDiff\Parser\Parser');
$parser->shouldReceive('parse')->andReturn($opcodes);
- $html = m::mock('cogpowered\FineDiff\Render\Html');
+ $html = m::mock('bariew\FineDiff\Render\Html');
$html->shouldReceive('process')->with('hello', $opcodes)->once();
@@ -53,7 +53,7 @@ public function testRender()
public function testGetParser()
{
- $parser = m::mock('cogpowered\FineDiff\Parser\Parser');
+ $parser = m::mock('bariew\FineDiff\Parser\Parser');
$parser->shouldReceive('justTesting')->once();
$diff = new Diff(null, null, $parser);
@@ -64,7 +64,7 @@ public function testGetParser()
public function testGetOpcodes()
{
- $parser = m::mock('cogpowered\FineDiff\Parser\Parser');
+ $parser = m::mock('bariew\FineDiff\Parser\Parser');
$parser->shouldReceive('parse')->with('foobar', 'eggfooba')->once();
$diff = new Diff(null, null, $parser);
diff --git a/tests/Diff/SetTest.php b/tests/Diff/SetTest.php
index 7d91d67..fa96b89 100644
--- a/tests/Diff/SetTest.php
+++ b/tests/Diff/SetTest.php
@@ -4,7 +4,7 @@
use PHPUnit_Framework_TestCase;
use Mockery as m;
-use cogpowered\FineDiff\Diff;
+use bariew\FineDiff\Diff;
class SetTest extends PHPUnit_Framework_TestCase
{
@@ -22,7 +22,7 @@ public function testSetParser()
{
$this->assertFalse( method_exists($this->diff->getParser(), 'fooBar') );
- $parser = m::mock('cogpowered\FineDiff\Parser\Parser');
+ $parser = m::mock('bariew\FineDiff\Parser\Parser');
$parser->shouldReceive('fooBar')->once();
$this->diff->setParser($parser);
@@ -35,7 +35,7 @@ public function testSetRenderer()
{
$this->assertFalse( method_exists($this->diff->getRenderer(), 'fooBar') );
- $html = m::mock('cogpowered\FineDiff\Render\Html');
+ $html = m::mock('bariew\FineDiff\Render\Html');
$html->shouldReceive('fooBar')->once();
$this->diff->setRenderer($html);
@@ -48,10 +48,10 @@ public function testSetGranularity()
{
$this->assertFalse( method_exists($this->diff->getGranularity(), 'fooBar') );
- $granularity = m::mock('cogpowered\FineDiff\Granularity\Word');
+ $granularity = m::mock('bariew\FineDiff\Granularity\Word');
$granularity->shouldReceive('fooBar')->once();
- $parser = m::mock('cogpowered\FineDiff\Parser\Parser');
+ $parser = m::mock('bariew\FineDiff\Parser\Parser');
$parser->shouldReceive('setGranularity')->with($granularity)->once();
$parser->shouldReceive('getGranularity')->andReturn($granularity)->once();
diff --git a/tests/Granularity/CharacterTest.php b/tests/Granularity/CharacterTest.php
index 851392d..2fa51dd 100644
--- a/tests/Granularity/CharacterTest.php
+++ b/tests/Granularity/CharacterTest.php
@@ -3,8 +3,8 @@
namespace FineDiffTests\Granularity;
use PHPUnit_Framework_TestCase;
-use cogpowered\FineDiff\Delimiters;
-use cogpowered\FineDiff\Granularity\Character;
+use bariew\FineDiff\Delimiters;
+use bariew\FineDiff\Granularity\Character;
class CharacterTest extends PHPUnit_Framework_TestCase
{
@@ -22,8 +22,8 @@ public function setUp()
public function testExtendsAndImplements()
{
- $this->assertTrue(is_a($this->character, 'cogpowered\FineDiff\Granularity\Granularity'));
- $this->assertTrue(is_a($this->character, 'cogpowered\FineDiff\Granularity\GranularityInterface'));
+ $this->assertTrue(is_a($this->character, 'bariew\FineDiff\Granularity\Granularity'));
+ $this->assertTrue(is_a($this->character, 'bariew\FineDiff\Granularity\GranularityInterface'));
$this->assertTrue(is_a($this->character, 'ArrayAccess'));
$this->assertTrue(is_a($this->character, 'Countable'));
}
diff --git a/tests/Granularity/ParagraphTest.php b/tests/Granularity/ParagraphTest.php
index 2647fe1..a851e63 100644
--- a/tests/Granularity/ParagraphTest.php
+++ b/tests/Granularity/ParagraphTest.php
@@ -3,8 +3,8 @@
namespace FineDiffTests\Granularity;
use PHPUnit_Framework_TestCase;
-use cogpowered\FineDiff\Delimiters;
-use cogpowered\FineDiff\Granularity\Paragraph;
+use bariew\FineDiff\Delimiters;
+use bariew\FineDiff\Granularity\Paragraph;
class ParagraphTest extends PHPUnit_Framework_TestCase
{
@@ -19,8 +19,8 @@ public function setUp()
public function testExtendsAndImplements()
{
- $this->assertTrue(is_a($this->character, 'cogpowered\FineDiff\Granularity\Granularity'));
- $this->assertTrue(is_a($this->character, 'cogpowered\FineDiff\Granularity\GranularityInterface'));
+ $this->assertTrue(is_a($this->character, 'bariew\FineDiff\Granularity\Granularity'));
+ $this->assertTrue(is_a($this->character, 'bariew\FineDiff\Granularity\GranularityInterface'));
$this->assertTrue(is_a($this->character, 'ArrayAccess'));
$this->assertTrue(is_a($this->character, 'Countable'));
}
diff --git a/tests/Granularity/SentenceTest.php b/tests/Granularity/SentenceTest.php
index a663012..d54c5c0 100644
--- a/tests/Granularity/SentenceTest.php
+++ b/tests/Granularity/SentenceTest.php
@@ -3,8 +3,8 @@
namespace FineDiffTests\Granularity;
use PHPUnit_Framework_TestCase;
-use cogpowered\FineDiff\Delimiters;
-use cogpowered\FineDiff\Granularity\Sentence;
+use bariew\FineDiff\Delimiters;
+use bariew\FineDiff\Granularity\Sentence;
class SentenceTest extends PHPUnit_Framework_TestCase
{
@@ -20,8 +20,8 @@ public function setUp()
public function testExtendsAndImplements()
{
- $this->assertTrue(is_a($this->character, 'cogpowered\FineDiff\Granularity\Granularity'));
- $this->assertTrue(is_a($this->character, 'cogpowered\FineDiff\Granularity\GranularityInterface'));
+ $this->assertTrue(is_a($this->character, 'bariew\FineDiff\Granularity\Granularity'));
+ $this->assertTrue(is_a($this->character, 'bariew\FineDiff\Granularity\GranularityInterface'));
$this->assertTrue(is_a($this->character, 'ArrayAccess'));
$this->assertTrue(is_a($this->character, 'Countable'));
}
diff --git a/tests/Granularity/WordTest.php b/tests/Granularity/WordTest.php
index c16a46f..bac688e 100644
--- a/tests/Granularity/WordTest.php
+++ b/tests/Granularity/WordTest.php
@@ -3,8 +3,8 @@
namespace FineDiffTests\Granularity;
use PHPUnit_Framework_TestCase;
-use cogpowered\FineDiff\Delimiters;
-use cogpowered\FineDiff\Granularity\Word;
+use bariew\FineDiff\Delimiters;
+use bariew\FineDiff\Granularity\Word;
class WordTest extends PHPUnit_Framework_TestCase
{
@@ -21,8 +21,8 @@ public function setUp()
public function testExtendsAndImplements()
{
- $this->assertTrue(is_a($this->character, 'cogpowered\FineDiff\Granularity\Granularity'));
- $this->assertTrue(is_a($this->character, 'cogpowered\FineDiff\Granularity\GranularityInterface'));
+ $this->assertTrue(is_a($this->character, 'bariew\FineDiff\Granularity\Granularity'));
+ $this->assertTrue(is_a($this->character, 'bariew\FineDiff\Granularity\GranularityInterface'));
$this->assertTrue(is_a($this->character, 'ArrayAccess'));
$this->assertTrue(is_a($this->character, 'Countable'));
}
diff --git a/tests/Parser/OpcodesTest.php b/tests/Parser/OpcodesTest.php
index ae9e8ea..aad2786 100644
--- a/tests/Parser/OpcodesTest.php
+++ b/tests/Parser/OpcodesTest.php
@@ -4,7 +4,7 @@
use PHPUnit_Framework_TestCase;
use Mockery as m;
-use cogpowered\FineDiff\Parser\Opcodes;
+use bariew\FineDiff\Parser\Opcodes;
class OpcodesTest extends PHPUnit_Framework_TestCase
{
@@ -15,7 +15,7 @@ public function tearDown()
public function testInstanceOf()
{
- $this->assertTrue(is_a(new Opcodes, 'cogpowered\FineDiff\Parser\OpcodesInterface'));
+ $this->assertTrue(is_a(new Opcodes, 'bariew\FineDiff\Parser\OpcodesInterface'));
}
public function testEmptyOpcodes()
@@ -26,7 +26,7 @@ public function testEmptyOpcodes()
public function testSetOpcodes()
{
- $operation = m::mock('cogpowered\FineDiff\Parser\Operations\Copy');
+ $operation = m::mock('bariew\FineDiff\Parser\Operations\Copy');
$operation->shouldReceive('getOpcode')->once()->andReturn('testing');
$opcodes = new Opcodes;
@@ -37,7 +37,7 @@ public function testSetOpcodes()
}
/**
- * @expectedException cogpowered\FineDiff\Exceptions\OperationException
+ * @expectedException bariew\FineDiff\Exceptions\OperationException
*/
public function testNotOperation()
{
@@ -47,10 +47,10 @@ public function testNotOperation()
public function testGetOpcodes()
{
- $operation_one = m::mock('cogpowered\FineDiff\Parser\Operations\Copy');
+ $operation_one = m::mock('bariew\FineDiff\Parser\Operations\Copy');
$operation_one->shouldReceive('getOpcode')->andReturn('c5i');
- $operation_two = m::mock('cogpowered\FineDiff\Parser\Operations\Copy');
+ $operation_two = m::mock('bariew\FineDiff\Parser\Operations\Copy');
$operation_two->shouldReceive('getOpcode')->andReturn('2c6d');
$opcodes = new Opcodes;
@@ -65,10 +65,10 @@ public function testGetOpcodes()
public function testGenerate()
{
- $operation_one = m::mock('cogpowered\FineDiff\Parser\Operations\Copy');
+ $operation_one = m::mock('bariew\FineDiff\Parser\Operations\Copy');
$operation_one->shouldReceive('getOpcode')->andReturn('c5i');
- $operation_two = m::mock('cogpowered\FineDiff\Parser\Operations\Copy');
+ $operation_two = m::mock('bariew\FineDiff\Parser\Operations\Copy');
$operation_two->shouldReceive('getOpcode')->andReturn('2c6d');
$opcodes = new Opcodes;
@@ -79,10 +79,10 @@ public function testGenerate()
public function testToString()
{
- $operation_one = m::mock('cogpowered\FineDiff\Parser\Operations\Copy');
+ $operation_one = m::mock('bariew\FineDiff\Parser\Operations\Copy');
$operation_one->shouldReceive('getOpcode')->andReturn('c5i');
- $operation_two = m::mock('cogpowered\FineDiff\Parser\Operations\Copy');
+ $operation_two = m::mock('bariew\FineDiff\Parser\Operations\Copy');
$operation_two->shouldReceive('getOpcode')->andReturn('2c6d');
$opcodes = new Opcodes;
diff --git a/tests/Parser/Operations/CopyTest.php b/tests/Parser/Operations/CopyTest.php
index 88b7e24..e1733ab 100644
--- a/tests/Parser/Operations/CopyTest.php
+++ b/tests/Parser/Operations/CopyTest.php
@@ -3,14 +3,14 @@
namespace FineDiffTests\Parser\Operations;
use PHPUnit_Framework_TestCase;
-use cogpowered\FineDiff\Parser\Operations\Copy;
+use bariew\FineDiff\Parser\Operations\Copy;
class CopyTest extends PHPUnit_Framework_TestCase
{
public function testImplementsOperationInterface()
{
$replace = new Copy(10);
- $this->assertTrue(is_a($replace, 'cogpowered\FineDiff\Parser\Operations\OperationInterface'));
+ $this->assertTrue(is_a($replace, 'bariew\FineDiff\Parser\Operations\OperationInterface'));
}
public function testGetFromLen()
diff --git a/tests/Parser/Operations/DeleteTest.php b/tests/Parser/Operations/DeleteTest.php
index d8e9a93..d98d9c4 100644
--- a/tests/Parser/Operations/DeleteTest.php
+++ b/tests/Parser/Operations/DeleteTest.php
@@ -3,14 +3,14 @@
namespace FineDiffTests\Parser\Operations;
use PHPUnit_Framework_TestCase;
-use cogpowered\FineDiff\Parser\Operations\Delete;
+use bariew\FineDiff\Parser\Operations\Delete;
class DeleteTest extends PHPUnit_Framework_TestCase
{
public function testImplementsOperationInterface()
{
$replace = new Delete(10);
- $this->assertTrue(is_a($replace, 'cogpowered\FineDiff\Parser\Operations\OperationInterface'));
+ $this->assertTrue(is_a($replace, 'bariew\FineDiff\Parser\Operations\OperationInterface'));
}
public function testGetFromLen()
diff --git a/tests/Parser/Operations/InsertTest.php b/tests/Parser/Operations/InsertTest.php
index 8bb8cf8..1af1f34 100644
--- a/tests/Parser/Operations/InsertTest.php
+++ b/tests/Parser/Operations/InsertTest.php
@@ -3,14 +3,14 @@
namespace FineDiffTests\Parser\Operations;
use PHPUnit_Framework_TestCase;
-use cogpowered\FineDiff\Parser\Operations\Insert;
+use bariew\FineDiff\Parser\Operations\Insert;
class InsertTest extends PHPUnit_Framework_TestCase
{
public function testImplementsOperationInterface()
{
$replace = new Insert('hello world');
- $this->assertTrue(is_a($replace, 'cogpowered\FineDiff\Parser\Operations\OperationInterface'));
+ $this->assertTrue(is_a($replace, 'bariew\FineDiff\Parser\Operations\OperationInterface'));
}
public function testGetFromLen()
diff --git a/tests/Parser/Operations/ReplaceTest.php b/tests/Parser/Operations/ReplaceTest.php
index acdba0c..191539b 100644
--- a/tests/Parser/Operations/ReplaceTest.php
+++ b/tests/Parser/Operations/ReplaceTest.php
@@ -3,14 +3,14 @@
namespace FineDiffTests\Parser\Operations;
use PHPUnit_Framework_TestCase;
-use cogpowered\FineDiff\Parser\Operations\Replace;
+use bariew\FineDiff\Parser\Operations\Replace;
class ReplaceTest extends PHPUnit_Framework_TestCase
{
public function testImplementsOperationInterface()
{
$replace = new Replace('hello', 'world');
- $this->assertTrue(is_a($replace, 'cogpowered\FineDiff\Parser\Operations\OperationInterface'));
+ $this->assertTrue(is_a($replace, 'bariew\FineDiff\Parser\Operations\OperationInterface'));
}
public function testGetFromLen()
diff --git a/tests/Parser/ParserTest.php b/tests/Parser/ParserTest.php
index 2b79ca8..8a18ca3 100644
--- a/tests/Parser/ParserTest.php
+++ b/tests/Parser/ParserTest.php
@@ -4,8 +4,8 @@
use PHPUnit_Framework_TestCase;
use Mockery as m;
-use cogpowered\FineDiff\Granularity\Character;
-use cogpowered\FineDiff\Parser\Parser;
+use bariew\FineDiff\Granularity\Character;
+use bariew\FineDiff\Parser\Parser;
class ParserTest extends PHPUnit_Framework_TestCase
{
@@ -22,18 +22,18 @@ public function tearDown()
public function testInstanceOf()
{
- $this->assertTrue(is_a($this->parser, 'cogpowered\FineDiff\Parser\ParserInterface'));
+ $this->assertTrue(is_a($this->parser, 'bariew\FineDiff\Parser\ParserInterface'));
}
public function testDefaultOpcodes()
{
$opcodes = $this->parser->getOpcodes();
- $this->assertTrue(is_a($opcodes, 'cogpowered\FineDiff\Parser\OpcodesInterface'));
+ $this->assertTrue(is_a($opcodes, 'bariew\FineDiff\Parser\OpcodesInterface'));
}
public function testSetOpcodes()
{
- $opcodes = m::mock('cogpowered\FineDiff\Parser\Opcodes');
+ $opcodes = m::mock('bariew\FineDiff\Parser\Opcodes');
$opcodes->shouldReceive('foo')->andReturn('bar');
$this->parser->setOpcodes($opcodes);
@@ -42,11 +42,11 @@ public function testSetOpcodes()
}
/**
- * @expectedException cogpowered\FineDiff\Exceptions\GranularityCountException
+ * @expectedException bariew\FineDiff\Exceptions\GranularityCountException
*/
public function testParseBadGranularity()
{
- $granularity = m::mock('cogpowered\FineDiff\Granularity\Character');
+ $granularity = m::mock('bariew\FineDiff\Granularity\Character');
$granularity->shouldReceive('count')->andReturn(0);
$parser = new Parser($granularity);
@@ -55,7 +55,7 @@ public function testParseBadGranularity()
public function testParseSetOpcodes()
{
- $opcodes = m::mock('cogpowered\FineDiff\Parser\Opcodes');
+ $opcodes = m::mock('bariew\FineDiff\Parser\Opcodes');
$opcodes->shouldReceive('setOpcodes')->once();
$this->parser->setOpcodes($opcodes);
diff --git a/tests/Render/Html/CallbackTest.php b/tests/Render/Html/CallbackTest.php
index 8d8c267..1f98b21 100644
--- a/tests/Render/Html/CallbackTest.php
+++ b/tests/Render/Html/CallbackTest.php
@@ -3,7 +3,7 @@
namespace FineDiffTests\Render\Html;
use PHPUnit_Framework_TestCase;
-use cogpowered\FineDiff\Render\Html;
+use bariew\FineDiff\Render\Html;
class CallbackTest extends PHPUnit_Framework_TestCase
{
diff --git a/tests/Render/Html/ProcessTest.php b/tests/Render/Html/ProcessTest.php
index 23838b8..6f5d2ce 100644
--- a/tests/Render/Html/ProcessTest.php
+++ b/tests/Render/Html/ProcessTest.php
@@ -4,7 +4,7 @@
use PHPUnit_Framework_TestCase;
use Mockery as m;
-use cogpowered\FineDiff\Render\Html;
+use bariew\FineDiff\Render\Html;
class ProcessTest extends PHPUnit_Framework_TestCase
{
@@ -20,7 +20,7 @@ public function tearDown()
public function testProcess()
{
- $opcodes = m::mock('cogpowered\FineDiff\Parser\Opcodes');
+ $opcodes = m::mock('bariew\FineDiff\Parser\Opcodes');
$opcodes->shouldReceive('generate')->andReturn('c5i:2c6d')->once();
$html = $this->html->process('Hello worlds', $opcodes);
diff --git a/tests/Render/Text/CallbackTest.php b/tests/Render/Text/CallbackTest.php
index 8b69cc8..ad6bb11 100644
--- a/tests/Render/Text/CallbackTest.php
+++ b/tests/Render/Text/CallbackTest.php
@@ -3,7 +3,7 @@
namespace FineDiffTests\Render\Text;
use PHPUnit_Framework_TestCase;
-use cogpowered\FineDiff\Render\Text;
+use bariew\FineDiff\Render\Text;
class CallbackTest extends PHPUnit_Framework_TestCase
{
diff --git a/tests/Render/Text/ProcessTest.php b/tests/Render/Text/ProcessTest.php
index 2263976..198e9be 100644
--- a/tests/Render/Text/ProcessTest.php
+++ b/tests/Render/Text/ProcessTest.php
@@ -4,7 +4,7 @@
use PHPUnit_Framework_TestCase;
use Mockery as m;
-use cogpowered\FineDiff\Render\Text;
+use bariew\FineDiff\Render\Text;
class ProcessTest extends PHPUnit_Framework_TestCase
{
@@ -35,7 +35,7 @@ public function testProcessWithString()
public function testProcess()
{
- $opcodes = m::mock('cogpowered\FineDiff\Parser\Opcodes');
+ $opcodes = m::mock('bariew\FineDiff\Parser\Opcodes');
$opcodes->shouldReceive('generate')->andReturn('c5i:2c6d')->once();
$html = $this->text->process('Hello worlds', $opcodes);
diff --git a/tests/Usage/SimpleTest.php b/tests/Usage/SimpleTest.php
index 529bed3..8133c5f 100644
--- a/tests/Usage/SimpleTest.php
+++ b/tests/Usage/SimpleTest.php
@@ -2,13 +2,13 @@
namespace FineDiffTests\Usage;
-use cogpowered\FineDiff\Diff;
-use cogpowered\FineDiff\Render\Text;
-use cogpowered\FineDiff\Render\Html;
-use cogpowered\FineDiff\Granularity\Character;
-use cogpowered\FineDiff\Granularity\Word;
-use cogpowered\FineDiff\Granularity\Sentence;
-use cogpowered\FineDiff\Granularity\Paragraph;
+use bariew\FineDiff\Diff;
+use bariew\FineDiff\Render\Text;
+use bariew\FineDiff\Render\Html;
+use bariew\FineDiff\Granularity\Character;
+use bariew\FineDiff\Granularity\Word;
+use bariew\FineDiff\Granularity\Sentence;
+use bariew\FineDiff\Granularity\Paragraph;
class SimpleTest extends Base
{