Skip to content

joshdifabio/semantic-diff

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

39 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Semantic Diff for PHP

Build Status Coveralls Codacy Badge

API status

Until the first tag is created, this package should be considered very unstable.

Usage

use PhpParser\Parser;
use PhpParser\Lexer;
use SemanticDiff\Diff\Factory;
use SemanticDiff\Status;

$phpParser = new Parser(new Lexer);

$diff = (new Factory)->createDiff(
    $phpParser->parse($oldPhpCode),
    $phpParser->parse($newPhpCode)
);

$status = $diff->getStatus();

/*
 * $status is now one of:
 *  Status::NO_CHANGES
 *  Status::API_ADDITIONS
 *  Status::INTERNAL_CHANGES
 *  Status::API_CHANGES
 *  Status::INCOMPATIBLE_API
 */

License

Semantic Diff is released under the MIT license.

About

Semantic diffs for PHP code

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages