Skip to content

Latest commit

 

History

History
41 lines (22 loc) · 1.22 KB

NewHistoryAnalyser.md

File metadata and controls

41 lines (22 loc) · 1.22 KB

Adding support for SCMs other than git

SARB uses an SCM to answer the question: "Where was line number X for file Y at the time the baseline was created". There are 2 possible answers:

  • It wasn't in the baseline
  • It was line A in file B

To support another SCM the following interfaces need implementing:

  • HistoryMarker
  • HistoryMarkerFactory
  • HistoryAnalyser
  • HistoryFactory

HistoryMarker

src/Domain/HistoryAnalyser/HistoryMarker.php

This holds a string representation of the point where the baseline was taken. E.g. for git this is the git SHA of the baseline.

HistoryMarkerFactory

src/Domain/HistoryAnalyser/HistoryMarkerFactory.php

Responsible for creating a HistoryMarker.

HistoryAnalyser

src/Domain/HistoryAnalyser/HistoryAnalyser.php

This is used to answer the question: "Where was line number X for file Y at the time the baseline was created".

HistoryFactory

src/Domain/HistoryAnalyser/HistoryFactory.php

This is responsible for building the HistoryAnalyser and HistoryMarkerFactory.