langleyfoxall / langleyfoxall/php-simple-google-maps

Add additional methods to mutate time & distance

Open
#3 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
PHP
Stars
1
Forks
2
PR merge metrics
No merged PRs in 30d

Description

It would be very convenient if you could mutate the time that is calculated, without needing to perform additional processing of the data outside of the package.

Time

If we use the demo as an example, it currently returns the information in seconds. What I propose would do the following.

$journey->duration()->toMinutes()

This would then return, for example, 5 mins. Additional options would also be really handy, e.g. toHours().

Distance

Something similar could also be done to the distance.

$journey->distance()->toMiles()

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by locating the duration() and distance() return values used in the package and its demo. Review how those values are currently represented, then define the supported time and distance conversion methods and their output formatting. Done means the proposed methods work for both examples and are covered by appropriate tests.

Written by the indexing model from the issue text.

Assessment

Tech stack
php
Domain
api
Issue type
Feature
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
38/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.