Skip to content

Add Swift scheduling exercice#1003

Merged
mk-mxp merged 6 commits into
exercism:mainfrom
resu-xuniL:swift-scheduling
Jun 28, 2026
Merged

Add Swift scheduling exercice#1003
mk-mxp merged 6 commits into
exercism:mainfrom
resu-xuniL:swift-scheduling

Conversation

@resu-xuniL

Copy link
Copy Markdown
Contributor

Another exercice for validation.

@resu-xuniL resu-xuniL changed the title Add Swift scheduling Add Swift scheduling exercice Jun 9, 2026

@mk-mxp mk-mxp left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks a lot for your contribution! I'm not totally pleased with the class interface, as it makes the problem look like a functional problem (no constructor args, one method to call). But we go with it when you do not want to invest more time / effort.

The introduction sounds more like "one meeting start given, many delivery dates derived" to me. Based on that, I'd suggest changing the implementation to this interface:

class SwiftScheduling
{
    public function __construct(DateTime $meetingStart)
    {
        throw new \BadMethodCallException(sprintf('Implement the %s method', __FUNCTION__));
    }

    public function deliveryDate(string $description): DateTime
    {
        throw new \BadMethodCallException(sprintf('Implement the %s method', __FUNCTION__));
    }
}

You can use constructor promotion to ease implementation.

Comment thread exercises/practice/swift-scheduling/.meta/example.php Outdated
Comment thread exercises/practice/swift-scheduling/.meta/example.php Outdated
Comment thread config.json Outdated
@resu-xuniL

Copy link
Copy Markdown
Contributor Author

I hope I correctly understood your proposal :)

@mk-mxp mk-mxp left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, that's what I had in mind. Thanks for your effort!

@mk-mxp mk-mxp merged commit fa50d0a into exercism:main Jun 28, 2026
13 checks passed
@resu-xuniL

Copy link
Copy Markdown
Contributor Author

You're welcome! thanks to you ...

@resu-xuniL resu-xuniL deleted the swift-scheduling branch June 28, 2026 13:23
@mk-mxp mk-mxp added x:action/create Work on something from scratch x:knowledge/intermediate Quite a bit of Exercism knowledge required x:module/practice-exercise Work on Practice Exercises x:type/content Work on content (e.g. exercises, concepts) x:size/medium Medium amount of work x:rep/medium Medium amount of reputation labels Jun 28, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

x:action/create Work on something from scratch x:knowledge/intermediate Quite a bit of Exercism knowledge required x:module/practice-exercise Work on Practice Exercises x:rep/medium Medium amount of reputation x:size/medium Medium amount of work x:type/content Work on content (e.g. exercises, concepts)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants