icanhazstring/systemctl-php

Make ProcessBuilder as optional dependency

icanhazstring opened this issue · 0 comments

Currently the ProcessBuilder is a hard wired dependency of SystemCtl.
Adding this as an optional dependency will improve testability for mocking the ProcessBuilder.

Something like
$systemCtl->setProcessBuilderBuilder($processBuilder)

There should not be an required dependency in the constructor. This way the default construction is still valid. The getProcessBuilder() should be used to call the ProcessBuilderBuilder for an instance of ProcessBuilder

This should be done for v0.x as well as v1.x