Add pear modules, mail and net_smtp via composer (#93)

Add pear modules, mail and net_smtp via composer, remove php 5.6 build due to phpunit 6
This commit is contained in:
Thilina Hasantha
2018-01-08 23:13:43 +01:00
committed by GitHub
parent 359e3f8382
commit e7792e7d79
2349 changed files with 117270 additions and 83170 deletions

View File

@@ -0,0 +1,49 @@
<?php
namespace Consolidation\AnnotatedCommand\Cache;
/**
* Make a generic cache object conform to our expected interface.
*/
class CacheWrapper implements SimpleCacheInterface
{
protected $dataStore;
public function __construct($dataStore)
{
$this->dataStore = $dataStore;
}
/**
* Test for an entry from the cache
* @param string $key
* @return boolean
*/
public function has($key)
{
if (method_exists($this->dataStore, 'has')) {
return $this->dataStore->has($key);
}
$test = $this->dataStore->get($key);
return !empty($test);
}
/**
* Get an entry from the cache
* @param string $key
* @return array
*/
public function get($key)
{
return (array) $this->dataStore->get($key);
}
/**
* Store an entry in the cache
* @param string $key
* @param array $data
*/
public function set($key, $data)
{
$this->dataStore->set($key, $data);
}
}

View File

@@ -0,0 +1,37 @@
<?php
namespace Consolidation\AnnotatedCommand\Cache;
/**
* An empty cache that never stores or fetches any objects.
*/
class NullCache implements SimpleCacheInterface
{
/**
* Test for an entry from the cache
* @param string $key
* @return boolean
*/
public function has($key)
{
return false;
}
/**
* Get an entry from the cache
* @param string $key
* @return array
*/
public function get($key)
{
return [];
}
/**
* Store an entry in the cache
* @param string $key
* @param array $data
*/
public function set($key, $data)
{
}
}

View File

@@ -0,0 +1,35 @@
<?php
namespace Consolidation\AnnotatedCommand\Cache;
/**
* Documentation interface.
*
* Clients that use AnnotatedCommandFactory::setDataStore()
* are encouraged to provide a data store that implements
* this interface.
*
* This is not currently required to allow clients to use a generic cache
* store that does not itself depend on the annotated-command library.
* This might be required in a future version.
*/
interface SimpleCacheInterface
{
/**
* Test for an entry from the cache
* @param string $key
* @return boolean
*/
public function has($key);
/**
* Get an entry from the cache
* @param string $key
* @return array
*/
public function get($key);
/**
* Store an entry in the cache
* @param string $key
* @param array $data
*/
public function set($key, $data);
}