Skip to content

Fix array diff'ing#74

Merged
sebastianbergmann merged 1 commit intosebastianbergmann:masterfrom
SpacePossum:master_fixes_2
Dec 14, 2017
Merged

Fix array diff'ing#74
sebastianbergmann merged 1 commit intosebastianbergmann:masterfrom
SpacePossum:master_fixes_2

Conversation

@SpacePossum
Copy link
Copy Markdown
Contributor

@SpacePossum SpacePossum commented Dec 14, 2017

On diff 1.4 :

<?php
require_once __DIR__.'/vendor/autoload.php';

$a = new \SebastianBergmann\Diff\Differ();
$diff = $a->diff(array('one'), array('two'));
var_dump($diff);

die;
?>

[09:19 AM]-[possum@zoo1]-[/home/possum/work/diff]-[git 1.4]
$ php test.php
string(37) "--- Original
+++ New
@@ @@
-one
+two
"

However on master

$ php test.php 
PHP Fatal error:  Uncaught TypeError: Return value of SebastianBergmann\Diff\Differ::validateDiffInput() must be of the type string, array returned in /home/possum/work/diff/src/Differ.php:83
Stack trace:
#0 /home/possum/work/diff/src/Differ.php(63): SebastianBergmann\Diff\Differ->validateDiffInput(Array)
#1 /home/possum/work/diff/test.php(5): SebastianBergmann\Diff\Differ->diff(Array, Array)
#2 {main}
  thrown in /home/possum/work/diff/src/Differ.php on line 83

This PR fixes the code back to original behavior.

closes #70

(depends on #73)

@codecov-io
Copy link
Copy Markdown

codecov-io commented Dec 14, 2017

Codecov Report

Merging #74 into master will not change coverage.
The diff coverage is 0%.

Impacted file tree graph

@@            Coverage Diff            @@
##             master      #74   +/-   ##
=========================================
  Coverage     62.43%   62.43%           
  Complexity      150      150           
=========================================
  Files            10       10           
  Lines           386      386           
=========================================
  Hits            241      241           
  Misses          145      145
Impacted Files Coverage Δ Complexity Δ
src/Differ.php 73.94% <0%> (ø) 52 <3> (ø) ⬇️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update c6f30b2...07d7d22. Read the comment docs.

@sebastianbergmann
Copy link
Copy Markdown
Owner

Does this break BC with 2.0 and should therefore go into 3.0 or can this go into 2.1?

@SpacePossum
Copy link
Copy Markdown
Contributor Author

This can go into 2.1 as bug fix, bringing back a feature lost between 1.4 and 2.0

@SpacePossum
Copy link
Copy Markdown
Contributor Author

Travis is happy, codecov x seems not valid in this case, I think this PR is good to go.

@sebastianbergmann sebastianbergmann merged commit 907c73b into sebastianbergmann:master Dec 14, 2017
@SpacePossum SpacePossum deleted the master_fixes_2 branch December 14, 2017 13:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Documentation and possibly implementation for Differ needs updated

3 participants