for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
/**
* Pattern for basic functionality of drivers
*
* PHP Version 5
* @category Core
* @package Service
* @author Hans-Joachim Piepereit <[email protected]>
* @copyright 2013 cSphere Team
* @license http://opensource.org/licenses/bsd-license Simplified BSD License
* @link http://www.csphere.eu
**/
namespace csphere\core\service;
abstract class Drivers
{
* Stores the loader object
protected $loader = null;
* Stores the driver configuration
protected $config = [];
* Creates the driver handler object
* @param array $config Configuration details as an array
* @return \csphere\core\service\Drivers
@return
Adding a @return annotation to a constructor is not recommended, since a constructor does not have a meaningful return value.
Please refer to the PHP core documentation on constructors.
public function __construct(array $config)
// Store loader object
$this->loader = \csphere\core\service\Locator::get();
// Check for empty driver
if (empty($config['driver'])) {
$config['driver'] = 'none';
}
$this->config = $config;
* Returns the name of the driver
* @return string
public function driver()
return $this->config['driver'];
Adding a
@return
annotation to a constructor is not recommended, since a constructor does not have a meaningful return value.Please refer to the PHP core documentation on constructors.