Skip to content

Refactor variables into functions #9

@jenny-ccc

Description

@jenny-ccc

I would also suggest moving totalSeconds excludeIds and subEntryIds into functions:

e.g. for subEntryIds

private Collection $_subEntryIds;

public function init(): void
{
  $this->_subEntryIds = collect();
}

protected function getSubEntryIds() 
{
  return $this->_subEntryIds->toArray();
}

protected function trackSubEntry(int|array|Collection $id): void
{
  $this->getSubEntryIds()->merge(collect($id));
}

then you'd just do:

$this->trackSubEntry($id);

Metadata

Metadata

Assignees

Labels

No labels
No labels

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions