23 $definition = $this->removeTrailingSlash( $definition );
24 $translation = $this->removeTrailingSlash( $translation );
26 $definitionStartNewline = $this->getStartingNewLinesCount( $definition );
27 $definitionEndNewline = $this->getEndingNewLineCount( $definition );
29 $translationStartNewline = $this->getStartingNewLinesCount( $translation );
30 $translationEndNewline = $this->getEndingNewLineCount( $translation );
32 $failingChecks = array_merge(
33 $this->validateStartingNewline( $definitionStartNewline, $translationStartNewline ),
34 $this->validateEndingNewline( $definitionEndNewline, $translationEndNewline )
37 return $this->createIssues( $failingChecks );
40 private function removeTrailingSlash(
string $str ):
string {
41 if ( substr( $str, -strlen(
'\\' ) ) ===
'\\' ) {
42 return substr( $str, 0, -1 );