for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
namespace Dock\System\Environ;
class EnvironManipulatorFactory
{
/**
* Get environ manipulator based on the current system.
*
* @return EnvironManipulator
*/
public function getSystemManipulator()
$shell = getenv('SHELL');
$userHome = getenv('HOME');
$environFile = $userHome.'/.bash_profile';
if (strpos($shell, 'zsh') !== false) {
$environFile = $userHome.'/.zshrc';
} elseif (strpos($shell, 'fish') !== false) {
$environFile = $userHome.'/.config/fish/config.fish';
}
return new FileEnvironManipulator($environFile);