Skip to content

Namespacing #5

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 4 commits into from
Jan 14, 2019
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
Prev Previous commit
Next Next commit
add name spacing
  • Loading branch information
JBlond committed Jan 14, 2019
commit 1d1516417ce47b4a30f304be82189f188aa52bc7
10 changes: 5 additions & 5 deletions example/example.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,15 +24,15 @@
);

// Initialize the diff class
$diff = new Diff($a, $b, $options);
$diff = new \jblond\Diff($a, $b, $options);

?>
<h2>Side by Side Diff</h2>
<?php

// Generate a side by side diff
require_once dirname(__FILE__).'/../lib/Diff/Renderer/Html/SideBySide.php';
$renderer = new Diff_Renderer_Html_SideBySide(array(
$renderer = new \jblond\Diff_Renderer_Html_SideBySide(array(
'title_a' => 'Custom title for OLD version',
'title_b' => 'Custom title for NEW version',
));
Expand All @@ -44,7 +44,7 @@

// Generate an inline diff
require_once dirname(__FILE__).'/../lib/Diff/Renderer/Html/Inline.php';
$renderer = new Diff_Renderer_Html_Inline;
$renderer = new \jblond\Diff_Renderer_Html_Inline;
echo $diff->render($renderer);

?>
Expand All @@ -53,7 +53,7 @@

// Generate a unified diff
require_once dirname(__FILE__).'/../lib/Diff/Renderer/Text/Unified.php';
$renderer = new Diff_Renderer_Text_Unified;
$renderer = new \jblond\Diff_Renderer_Text_Unified;
echo htmlspecialchars($diff->render($renderer));

?>
Expand All @@ -63,7 +63,7 @@

// Generate a context diff
require_once dirname(__FILE__).'/../lib/Diff/Renderer/Text/Context.php';
$renderer = new Diff_Renderer_Text_Context;
$renderer = new \jblond\Diff_Renderer_Text_Context;
echo htmlspecialchars($diff->render($renderer));
?>
</pre>
Expand Down
4 changes: 3 additions & 1 deletion lib/Diff.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
<?php
namespace jblond;

/**
* Diff
*
Expand Down Expand Up @@ -97,7 +99,7 @@ public function __construct($a, $b, $options=array())
/**
* Render a diff using the supplied rendering class and return it.
*
* @param \Diff_Renderer_Abstract|object $renderer An instance of the rendering object to use for generating the diff.
* @param \jblond\Diff_Renderer_Abstract|object $renderer An instance of the rendering object to use for generating the diff.
*
* @return mixed The generated diff. Exact return value depends on the rendered.
*/
Expand Down
2 changes: 2 additions & 0 deletions lib/Diff/Renderer/Abstract.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
<?php
namespace jblond;

/**
* Abstract class for diff renderers in PHP DiffLib.
*
Expand Down
2 changes: 2 additions & 0 deletions lib/Diff/Renderer/Html/Array.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
<?php
namespace jblond;

/**
* Base renderer for rendering HTML based diffs for PHP DiffLib.
*
Expand Down
2 changes: 2 additions & 0 deletions lib/Diff/Renderer/Html/Inline.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
<?php
namespace jblond;

/**
* Inline HTML diff generator for PHP DiffLib.
*
Expand Down
2 changes: 2 additions & 0 deletions lib/Diff/Renderer/Html/SideBySide.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
<?php
namespace jblond;

/**
* Side by Side HTML diff generator for PHP DiffLib.
*
Expand Down
2 changes: 2 additions & 0 deletions lib/Diff/Renderer/Text/Context.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
<?php
namespace jblond;

/**
* Context diff generator for PHP DiffLib.
*
Expand Down
2 changes: 2 additions & 0 deletions lib/Diff/Renderer/Text/Unified.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
<?php
namespace jblond;

/**
* Unified diff generator for PHP DiffLib.
*
Expand Down
2 changes: 2 additions & 0 deletions lib/Diff/SequenceMatcher.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
<?php
namespace jblond;

/**
* Sequence matcher for Diff
*
Expand Down