for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
namespace League\CLImate\Util\System;
class SystemFactory
{
/**
* @var \League\CLImate\Util\System\System $instance
*/
protected static $instance;
* Get an instance of the appropriate System class
*
* @return \League\CLImate\Util\System\System
public static function getInstance()
if (static::$instance) {
return static::$instance;
}
static::$instance = self::getSystem();
* Set the $instance property to the appropriate system
protected static function getSystem()
if (strtoupper(substr(PHP_OS, 0, 3)) === 'WIN') {
return new Windows();
return new Linux();