joshdifabio / semantic-diff
A library for performing semantic diffs of PHP code
Installs: 15
Dependents: 0
Suggesters: 0
Security: 0
Stars: 16
Watchers: 5
Forks: 0
Open Issues: 0
pkg:composer/joshdifabio/semantic-diff
Requires
- php: >=5.5
- nikic/php-parser: ~1.1
Requires (Dev)
- phpunit/phpunit: ~3.5
- satooshi/php-coveralls: dev-master
This package is auto-updated.
Last update: 2025-09-26 06:45:41 UTC
README
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.