1 | <?php |
||
10 | class TranslationController extends Controller |
||
11 | { |
||
12 | public function index() |
||
18 | |||
19 | public function edit($id) |
||
29 | |||
30 | public function update(Request $request, $page_id) |
||
41 | |||
42 | private function saveValueTranslations(array $translations) |
||
43 | { |
||
44 | collect($translations)->map(function ($translation, $locale) { |
||
45 | collect($translation)->map(function ($value, $id) use ($locale) { |
||
46 | |||
47 | $line = Line::find($id); |
||
48 | |||
49 | $value = squantoCleanupHTML($value); |
||
50 | |||
51 | if(false == config('squanto.paragraphize') && !$line->areParagraphsAllowed()) |
||
52 | { |
||
53 | $value = $this->replaceParagraphsByLinebreaks($value); |
||
54 | } |
||
55 | |||
56 | // If line value is not meant to contain tags, we should strip them |
||
57 | if (!$line->editInEditor()) { |
||
58 | $value = squantoCleanupString($value); |
||
59 | } |
||
60 | |||
61 | if (null === $value) { |
||
62 | $line->removeValue($locale); |
||
63 | } else { |
||
64 | $line->saveValue($locale, $value); |
||
65 | } |
||
66 | }); |
||
67 | }); |
||
68 | } |
||
69 | |||
70 | /** |
||
71 | * @param $page |
||
72 | * @return \Illuminate\Support\Collection |
||
73 | */ |
||
74 | protected function groupLinesByKey($page) |
||
99 | |||
100 | /** |
||
101 | * Get suggestion for a label based on the key |
||
102 | * e.g. foo.bar.title return bar |
||
103 | * @return string |
||
104 | */ |
||
105 | private function getFirstSegmentOfKey(Line $line) |
||
115 | |||
116 | private function replaceParagraphsByLinebreaks($value) |
||
129 | } |
||
130 |
This check marks calls to methods that do not seem to exist on an object.
This is most likely the result of a method being renamed without all references to it being renamed likewise.