tomphp / time-tracker

0 stars 0 forks source link

Thoughts, ideas, and errata #1

Open settermjd opened 7 years ago

settermjd commented 7 years ago

General Thoughts

Docker

This is just a personal preference, but what about moving the docker-compose* files in to a provisioning or docker directory? There's no specific need to. But might help to keep the repository that much tidier.

Code

Group use declaration

As you're using PHP7, what about using a group use declaration? For example, instead of

use TomPHP\TimeTracker\Tracker\Developer;
use TomPHP\TimeTracker\Tracker\DeveloperId;
use TomPHP\TimeTracker\Tracker\DeveloperProjections;

how about using:

use TomPHP\TimeTracker\Tracker\{Developer, DeveloperId, DeveloperProjections};

IDE support

I know you're a VIM user though (I LOVE it for writing btw), but I'm a big PhpStorm user. And I know many who are. What are your thoughts on adding more IDE annotations to help with auto-completion? For example:

public function getResource(Request $request, Response $response, array $args)
{
    /** @var \TomPHP\TimeTracker\Tracker\DeveloperProjections $developers */
    $developers = $this->container->get(DeveloperProjections::class);
    // ...
}
tomphp commented 7 years ago

Some responses

General Thoughts

Docker

Nice suggestion. The docker stuff is a work in progress, but as I said, I've been moving to cloud foundary (currently in a different branch) so a lot of it is obsolete.

Code

The src folder is separated by bounded contexts. Communication between them is through strict interfaces (probably a longer conversation to be had there). I've got some plans for further refactoring here.

Group Declarations

I think your suggestions are good. The reason I've not got into it yet is because of the lack of decision here with regards to PSR-2 yet. Since everything is formatted by php-cs-fixer, I'm waiting to see where this goes.

IDE Support

I completely agree, I just often miss the opportunity to add the extra detail as VIM doesn't flag them up. I will add additional annotations when I notice them ;)

Thanks for the feedback so far, it's really great to bounce ideas off another person - really appreciated!

settermjd commented 7 years ago

Happy to help. Will try and keep helping out.