Minor code style improvements

This commit is contained in:
Timothy Warren 2017-03-01 13:04:00 -05:00
parent 2b472c3185
commit 98b4ee9f05
6 changed files with 17 additions and 9 deletions

View File

@ -37,7 +37,8 @@
"phpunit/phpunit": "^6.0.0",
"sebastian/phpcpd": "^3.0",
"squizlabs/php_codesniffer": "^3.0.0RC3",
"theseer/phpdox": "^0.9.0"
"theseer/phpdox": "^0.9.0",
"phpstan/phpstan": "^0.6.4"
},
"suggest": {
"monolog/monolog": "A good standard logging library",
@ -51,5 +52,10 @@
"name": "Timothy J Warren",
"email": "tim@timshomepage.net"
}
]
],
"scripts": {
"test": "vendor/bin/phpunit",
"coverage": "phpdbg -qrr -- vendor/bin/phpunit -c build",
"phpstan": "vendor/bin/phpstan analyse src tests"
}
}

View File

@ -15,6 +15,7 @@
*/
namespace Aviat\Banker\Driver;
use Aviat\Banker\LoggerTrait;
use Psr\Log\LoggerAwareInterface;
/**
@ -22,7 +23,7 @@ use Psr\Log\LoggerAwareInterface;
*/
abstract class AbstractDriver implements DriverInterface, LoggerAwareInterface {
use \Aviat\Banker\LoggerTrait;
use LoggerTrait;
/**
* The object encapsulating the connection to the cache backend

View File

@ -38,7 +38,7 @@ class ApcuDriver extends AbstractDriver {
*/
public function __construct(array $config = [], array $options = [])
{
// noop
}
/**
@ -46,7 +46,7 @@ class ApcuDriver extends AbstractDriver {
*/
public function __destruct()
{
// noop
}
/**

View File

@ -16,6 +16,7 @@
namespace Aviat\Banker\Driver;
use Aviat\Banker\Exception\CacheException;
use Memcache;
/**
* Redis cache backend
@ -31,14 +32,12 @@ class MemcacheDriver extends AbstractDriver {
*/
public function __construct(array $config = [], array $options = [])
{
// @codeCoverageIgnoreStart
if ( ! class_exists('Memcache'))
{
throw new CacheException('Memcache driver requires the PHP memcache extension');
}
// @codeCoverageIgnoreEnd
$this->conn = new \Memcache();
$this->conn = new Memcache();
$method = ($config['persistent'] === TRUE) ? 'pconnect' : 'connect';

View File

@ -26,7 +26,7 @@ class RedisDriver extends AbstractDriver {
/**
* The object encapsulating the connection to the Redis server
*
* @var Predis\Client
* @var \Predis\Client
*/
protected $conn;

View File

@ -20,6 +20,8 @@ use PHPUnit\Framework\TestCase;
class ItemCollectionTest extends TestCase {
protected $collection;
public function setUp()
{
$this->collection = new ItemCollection([]);