Skip to content
Prev Previous commit
refactor: rename functions
  • Loading branch information
mbarreche committed Nov 6, 2022
commit ffb76f41de2328c573ceec44adb7c0112bee43ee
Original file line number Diff line number Diff line change
Expand Up @@ -25,11 +25,11 @@ public function __construct(Platform $platform)
public function get(string $courseId): string
{
$csv = $this->platform->findCourseSteps($courseId);
$steps = $this->createSteps($csv);
return $this->serialize($steps);
$steps = $this->parseSteps($csv);
return $this->serializeSteps($steps);
}

private function serialize(array $steps): string
private function serializeSteps(array $steps): string
{
$results = [];
foreach ($steps as $step) {
Expand All @@ -38,7 +38,7 @@ private function serialize(array $steps): string
return '[' . implode(',', $results) . ']';
}

private function createSteps(string $csv): array
private function parseSteps(string $csv): array
{
$csvLines = explode(PHP_EOL, $csv);
$steps = [];
Expand Down