Skip to content

Conversation

@mkusher
Copy link
Member

@mkusher mkusher commented May 19, 2016

Implementation of the #20

@mkusher mkusher added the WIP label May 19, 2016
) {
$self = new static($index, $rootFolder);
$self->config = $config;
return $self;
Copy link

@greg0ire greg0ire Jul 25, 2016

Choose a reason for hiding this comment

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

Why not have just one constructor, with the following signature : public function __construct(Index $index, $rootFolder = "", Config $config = null). If $config is null, it can be initialized to Config::default(), right?

Copy link
Member Author

Choose a reason for hiding this comment

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

it looks more elegant with named factories

Choose a reason for hiding this comment

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

I'm not familiar with them (apart from the very ancient time where I learnt C++ and there were several possible constructors), but I guess it's something that might indeed come in handy if you don't want to remember the order of the 1878739 constructor arguments…

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants