Home
Docs
GitHub
Pricing
Blog
Log In

Run Sandworm Audit for your App

Get started
Generated on Jul 9, 2024 via composer

sebastian/diff 5.1.0

Diff implementation
Package summary
Share
0
issues
1
license
1
BSD-3-Clause
Package created
12 Feb 2013
Version published
22 Dec 2023
Maintainers
1
Total deps
1
Direct deps
0
License
BSD-3-Clause

Issues

0
This package has no issues

Licenses

BSD 3-Clause "New" or "Revised" License

Permissive
OSI Approved
This is a human-readable summary of (and not a substitute for) the license. Disclaimer.
Can
commercial-use
modify
distribute
place-warranty
Cannot
use-trademark
hold-liable
Must
include-copyright
include-license
1 Packages, Including:
sebastian/diff@5.1.0
Disclaimer

This deed highlights only some of the key features and terms of the actual license. It is not a license and has no legal value. You should carefully review all of the terms and conditions of the actual license before using the licensed material.

Sandworm is not a law firm and does not provide legal services. Distributing, displaying, or linking to this deed or the license that it summarizes does not create a lawyer-client or any other relationship.

Direct Dependencies

0
All Dependencies CSV
β“˜ This is a list of sebastian/diff 's direct dependencies. Data on all dependencies, including transitive ones, is available via CSV download.
NameVersionSizeLicenseTypeVulnerabilities

Visualizations

Frequently Asked Questions

What does sebastian/diff do?

The sebastian/diff package is an implementation of the 'diff' feature in PHP. Born out of PHPUnit, it is a stand-alone component that allows you to compare two strings and generate a textual representation of their differences. This is particularly useful in software development, as it enables developers to identify variations in code, version differences and changes.

How do you use sebastian/diff?

To use sebastian/diff, you should first install the package in your project using Composer. The installation is done by running the command composer require sebastian/diff. If you want to use it only in the development phase, you can add it as a development-time dependency using the command composer require --dev sebastian/diff.

Once installed, you will be able to start using it to generate differences between two strings. Here's a basic example of how you can generate a diff:

<?php
use SebastianBergmann\Diff\Differ;

$differ = new Differ;
print $differ->diff('foo', 'bar');

This piece of code will output a unified diff of the two strings, 'foo' and 'bar'.

There's also a class called Parser that helps to parse a unified diff into an object graph:

use SebastianBergmann\Diff\Parser;
use SebastianBergmann\Git;

$git = new Git('/usr/local/src/money');

$diff = $git->getDiff(
  '948a1a07768d8edd10dcefa8315c1cbeffb31833',
  'c07a373d2399f3e686234c4f7f088d635eb9641b'
);

$parser = new Parser;
print_r($parser->parse($diff));

Where are the sebastian/diff docs?

The documentation for the sebastian/diff can be found directly in the readme.md file on its GitHub repository page - https://github.com/sebastianbergmann/diff. Here you will find detailed instructions on how to install and use the package, along with code usage examples.