Przejdź do treści
Biblioteka skilli
Programowanie · Integracja z narzędziem

php-forge-diff

/php-forge-diff

Integruje bibliotekę php-forge/diff w aplikacjach PHP i diagnozuje renderowanie różnic w formacie unified diff.

Repozytorium
diff ↗
Licencja
BSD-3-Clause
Ostatnia zmiana repozytorium
27.10.2026

Ocena i bezpieczeństwo

95/ 100Klasa: dobry
Format25 / 25
Frontmatter z nazwą i opisem, poprawna nazwa, opis do 1024 znaków, nazwa zgodna z folderem.
Odkrywalność25 / 25
Opis mówi, kiedy użyć skilla, ma sensowną długość i jest w 3. osobie.
Treść30 / 35
Co najmniej 150 słów i do 500 linii, nagłówki, listy kroków, przykłady albo kod.
Higiena15 / 15
Bez zaślepek typu TODO, bez ścieżek Windows, z licencją.
Ryzykobrak sygnałów w skanie
Pliki w paczce
1
Skrypty
0
Komentarze HTML
0
Adresy URL w SKILL.md
1
Przestarzałość

Brak sygnałów. Repozytorium zmienione 27.10.2026, bez odwołań do wycofanych modeli i API.

Licencja

BSD-3-Clause, otwarta.

Co robi i kiedy

Integruje bibliotekę php-forge/diff w aplikacjach PHP i diagnozuje renderowanie różnic w formacie unified diff.

Oryginalny opis (EN)

Integrate or troubleshoot php-forge/diff line edit scripts and unified diff rendering in PHP applications. Use for LineDiffer, DifferInterface, or UnifiedDiffRenderer; exclude applying patches and unrelated Git operations.

Jak działa

  1. Choose the result
  2. Verify
Sekcje z nagłówków SKILL.md, w oryginale · 39 linii, 427 słów
Podgląd SKILL.md
---
name: php-forge-diff
description: Integrate or troubleshoot php-forge/diff line edit scripts and unified diff rendering in PHP applications. Use for LineDiffer, DifferInterface, or UnifiedDiffRenderer; exclude applying patches and unrelated Git operations.
license: BSD-3-Clause
metadata:
  source: https://github.com/php-forge/diff
---

# Use php-forge/diff

Inspect the installed revision and its `composer.json`, source and guides before choosing an API. For a dependency,
resolve Composer's installed path and reference; a path checkout can contain uncommitted changes. Compare the lock file,
which may describe a different installation. Use documentation matching the installed files and report a gap if it
cannot be found. PHP 8.3 or later is required by the current package.

## Choose the result

Use `(new PHPForge\Diff\LineDiffer())->diff($old, $new)` for an ordered list of `DiffLine` objects with
`DiffOp::Context`, `Remove`, or `Add`. It splits both strings literally on `"\n"`: an empty string is one empty line and
a trailing newline produces an empty final line. Remove `Add` entries to reconstruct the old input, or `Remove` entries
for the new input, joining the remaining `line` values with `"\n"`. It does not normalize line endings.

Use `(new PHPForge\Diff\UnifiedDiffRenderer())->render($old, $new, $fromLabel, $toLabel, $context)` for unified text;
`$context` is optional and defaults to `3`. It normalizes CRLF and CR to LF, returns an empty string for normalized
equal texts and otherwise returns a patch without a trailing newline or Git's `diff --git` and `index` headers. Negative
context is treated as zero. Missing final newlines are represented by `\ No newline at end of file`. Labels are supplied
by the caller; this renderer does not read files, apply patches, or escape labels for untrusted presentation.

A custom `DifferInterface` can be injected into the renderer. Its script must reconstruct both inputs in order. The
renderer takes the rendered lines from the texts by operation position and does not validate `DiffLine::line`: a script
whose operations do not consume both inputs exactly throws `LogicException`, while a balanced script with wrong
operations renders an incorrect diff without any error. Test a non-empty change as well as empty inputs because the
renderer handles empty sides separately. Do not swallow `LogicException` as an empty diff.

The default differ follows Git's default xdiff pipeline and indent heuristic, but lacks Git's cost limit. Its edit
script is not guaranteed shortest or identical to Git on expensive inputs. Do not promise binary diff support or exact
byte preservation after renderer line-ending normalization.

## Verify

Use the application's existing tests and the package's `docs/examples.md`, `docs/algorithms.md` and `docs/testing.md` at
the matching revision. Assert both reconstructed sides, unchanged inputs, empty sides, trailing-newline differences,
line-ending normalization, requested context and custom-differ failure as relevant. If comparing with Git, disable user
and system Git configuration and document the chosen options. Record installation, client discovery, native skill
loading, actual task behavior and test results separately; reading this file alone proves no activation.

Wersje

W bazie nie ma innych skilli o nazwie php-forge-diff.

Migawka bazy z 13.11.2026 · wersja paczki 3cdad9557cb8 (skrót SHA-256 całej paczki)

Pobrania w ostatnich 30 dniach: 0 · ranking

Zgłoś problem z tym skillem: szkodliwa treść, błędny opis albo prośba autora o usunięcie.

Podobne skille

  • 92write-script-php
    Prowadzi przez pisanie skryptów w PHP zgodnie z konwencjami tej platformy.
  • 100review-local
    Przegląda lokalny diff php-src względem standardów PHP i zapisuje raport REVIEW.md, bez zmian w kodzie ani stanie gita.
  • 100upgrade-php
    Pomaga w aktualizacji PHP: naprawia deprecacje pod docelową wersję i skanuje problemy zgodności z PHP.
  • 100programming-php
    Podpowiada praktyki PHP 8: zwięzły kod z typami, funkcje aż do PHP 8.5, walidację danych wejściowych i kontrole jakości.
  • 100php
    Podpowiada konwencje języka PHP, nowoczesne idiomy i system typów przy pisaniu, przeglądzie i refaktoryzacji kodu.
  • 86php
    Pomaga w backendzie PHP: Laravel, ThinkPHP, aplikacjach webowych, API i systemach CMS.

Uwagi i zgłoszenia

Wiadomość trafi do Bartosza Sokolińskiego. Adres e-mail jest potrzebny tylko do odpowiedzi. Szczegóły w polityce prywatności.