[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"project-8239":3},{"id":4,"name":5,"fullName":6,"owner":7,"repo":5,"description":8,"homepage":9,"htmlUrl":10,"language":11,"languages":10,"totalLinesOfCode":10,"stars":12,"forks":13,"watchers":14,"openIssues":15,"contributorsCount":16,"subscribersCount":16,"size":16,"stars1d":16,"stars7d":15,"stars30d":17,"stars90d":16,"forks30d":16,"starsTrendScore":16,"compositeScore":18,"rankGlobal":10,"rankLanguage":10,"license":19,"archived":20,"fork":20,"defaultBranch":21,"hasWiki":20,"hasPages":20,"topics":22,"createdAt":10,"pushedAt":10,"updatedAt":23,"readmeContent":24,"aiSummary":25,"trendingCount":16,"starSnapshotCount":16,"syncStatus":26,"lastSyncTime":27,"discoverSource":28},8239,"diff","sebastianbergmann\u002Fdiff","sebastianbergmann","Diff implementation","",null,"PHP",7661,86,25,1,0,3,36.82,"BSD 3-Clause \"New\" or \"Revised\" License",false,"main",[],"2026-06-12 02:01:51","[![Latest Stable Version](https:\u002F\u002Fposer.pugx.org\u002Fsebastian\u002Fdiff\u002Fv)](https:\u002F\u002Fpackagist.org\u002Fpackages\u002Fsebastian\u002Fdiff)\n[![CI Status](https:\u002F\u002Fgithub.com\u002Fsebastianbergmann\u002Fdiff\u002Fworkflows\u002FCI\u002Fbadge.svg)](https:\u002F\u002Fgithub.com\u002Fsebastianbergmann\u002Fdiff\u002Factions)\n[![codecov](https:\u002F\u002Fcodecov.io\u002Fgh\u002Fsebastianbergmann\u002Fdiff\u002Fbranch\u002Fmain\u002Fgraph\u002Fbadge.svg)](https:\u002F\u002Fcodecov.io\u002Fgh\u002Fsebastianbergmann\u002Fdiff)\n\n# sebastian\u002Fdiff\n\nDiff implementation for PHP, factored out of PHPUnit into a stand-alone component.\n\n## Installation\n\nYou can add this library as a local, per-project dependency to your project using [Composer](https:\u002F\u002Fgetcomposer.org\u002F):\n\n```\ncomposer require sebastian\u002Fdiff\n```\n\nIf you only need this library during development, for instance to run your project's test suite, then you should add it as a development-time dependency:\n\n```\ncomposer require --dev sebastian\u002Fdiff\n```\n\n### Usage\n\n#### Generating diff\n\nThe `Differ` class can be used to generate a textual representation of the difference between two strings:\n\n```php\n\u003C?php declare(strict_types=1);\nuse SebastianBergmann\\Diff\\Differ;\nuse SebastianBergmann\\Diff\\Output\\UnifiedDiffOutputBuilder;\n\n$differ = new Differ(new UnifiedDiffOutputBuilder);\n\nprint $differ->diff('foo', 'bar');\n```\n\nThe code above yields the output below:\n\n```diff\n--- Original\n+++ New\n@@ @@\n-foo\n+bar\n```\n\nThe `UnifiedDiffOutputBuilder` used in the example above generates output in \"unified diff\"\nformat and is used by PHPUnit, for example.\n\nThe `StrictUnifiedDiffOutputBuilder` generates output in \"strict unified diff\" format with\nhunks,  similar to `diff -u` and compatible with `patch` or `git apply`.\n\nThe `DiffOnlyOutputBuilder` generates output that only contains the lines that differ.\n\nIf none of these three output builders match your use case then you can implement\n`DiffOutputBuilderInterface` to generate custom output.\n\n#### Parsing diff\n\nThe `Parser` class can be used to parse a unified diff into an object graph:\n\n```php\nuse SebastianBergmann\\Diff\\Parser;\nuse SebastianBergmann\\Git;\n\n$git = new Git('\u002Fusr\u002Flocal\u002Fsrc\u002Fmoney');\n\n$diff = $git->getDiff(\n  '948a1a07768d8edd10dcefa8315c1cbeffb31833',\n  'c07a373d2399f3e686234c4f7f088d635eb9641b'\n);\n\n$parser = new Parser;\n\nprint_r($parser->parse($diff));\n```\n\nThe code above yields the output below:\n\n    Array\n    (\n        [0] => SebastianBergmann\\Diff\\Diff Object\n            (\n                [from:SebastianBergmann\\Diff\\Diff:private] => a\u002Ftests\u002FMoneyTest.php\n                [to:SebastianBergmann\\Diff\\Diff:private] => b\u002Ftests\u002FMoneyTest.php\n                [chunks:SebastianBergmann\\Diff\\Diff:private] => Array\n                    (\n                        [0] => SebastianBergmann\\Diff\\Chunk Object\n                            (\n                                [start:SebastianBergmann\\Diff\\Chunk:private] => 87\n                                [startRange:SebastianBergmann\\Diff\\Chunk:private] => 7\n                                [end:SebastianBergmann\\Diff\\Chunk:private] => 87\n                                [endRange:SebastianBergmann\\Diff\\Chunk:private] => 7\n                                [lines:SebastianBergmann\\Diff\\Chunk:private] => Array\n                                    (\n                                        [0] => SebastianBergmann\\Diff\\Line Object\n                                            (\n                                                [type:SebastianBergmann\\Diff\\Line:private] => 3\n                                                [content:SebastianBergmann\\Diff\\Line:private] =>      * @covers SebastianBergmann\\Money\\Money::add\n                                            )\n\n                                        [1] => SebastianBergmann\\Diff\\Line Object\n                                            (\n                                                [type:SebastianBergmann\\Diff\\Line:private] => 3\n                                                [content:SebastianBergmann\\Diff\\Line:private] =>      * @covers SebastianBergmann\\Money\\Money::newMoney\n                                            )\n\n                                        [2] => SebastianBergmann\\Diff\\Line Object\n                                            (\n                                                [type:SebastianBergmann\\Diff\\Line:private] => 3\n                                                [content:SebastianBergmann\\Diff\\Line:private] =>      *\u002F\n                                            )\n\n                                        [3] => SebastianBergmann\\Diff\\Line Object\n                                            (\n                                                [type:SebastianBergmann\\Diff\\Line:private] => 2\n                                                [content:SebastianBergmann\\Diff\\Line:private] =>     public function testAnotherMoneyWithSameCurrencyObjectCanBeAdded()\n                                            )\n\n                                        [4] => SebastianBergmann\\Diff\\Line Object\n                                            (\n                                                [type:SebastianBergmann\\Diff\\Line:private] => 1\n                                                [content:SebastianBergmann\\Diff\\Line:private] =>     public function testAnotherMoneyObjectWithSameCurrencyCanBeAdded()\n                                            )\n\n                                        [5] => SebastianBergmann\\Diff\\Line Object\n                                            (\n                                                [type:SebastianBergmann\\Diff\\Line:private] => 3\n                                                [content:SebastianBergmann\\Diff\\Line:private] =>     {\n                                            )\n\n                                        [6] => SebastianBergmann\\Diff\\Line Object\n                                            (\n                                                [type:SebastianBergmann\\Diff\\Line:private] => 3\n                                                [content:SebastianBergmann\\Diff\\Line:private] =>         $a = new Money(1, new Currency('EUR'));\n                                            )\n\n                                        [7] => SebastianBergmann\\Diff\\Line Object\n                                            (\n                                                [type:SebastianBergmann\\Diff\\Line:private] => 3\n                                                [content:SebastianBergmann\\Diff\\Line:private] =>         $b = new Money(2, new Currency('EUR'));\n                                            )\n                                    )\n                            )\n                    )\n            )\n    )\n\nNote: If the chunk size is 0 lines, i.e., `getStartRange()` or `getEndRange()` return 0, the number of line returned by `getStart()` or `getEnd()` is one lower than one would expect. It is the line number after which the chunk should be inserted or deleted; in all other cases, it gives the first line number of the replaced range of lines.\n","sebastian\u002Fdiff 是一个用于 PHP 的差异实现库，从 PHPUnit 中独立出来作为一个单独的组件。它提供了生成和解析文本差异的功能，支持统一差异格式（unified diff），包括标准和严格模式，并且可以自定义输出格式。该库特别适合需要在开发过程中进行代码比较、版本控制或自动化测试的场景。通过 Composer 可以轻松集成到项目中，无论是作为运行时依赖还是仅限于开发阶段的工具都非常方便。",2,"2026-06-11 03:16:57","top_language"]