Skip to content

v5.0.0

Compare
Choose a tag to compare
@Spamercz Spamercz released this 15 Jul 13:53
· 61 commits to master since this release
f004495

Features in this release

  • Nette 3 support
  • Coding standard updated
  • Travis cleanup and unification
  • Composer, compatibility packages and loading

PR #85

Features:

Coding standard

  • Use strict_types
  • Return types where posible, anotated all the array returned
  • Typed method arguments where possible, anotated otherwise
  • Upper cased null/false/true
  • Global function fqn

Travis

  • Removed unused nette libraries
  • Added PHPStan to travis
  • Added CodingStandard to travis

Composer

  • Autoload set to PSR4

Changes:

  • Supported PHP => 7.1
  • Nette/Caching to ~3.0
  • Nette/Deprecated to ~3.0
  • Nette/DI to ~2.4.10 || ~3.0
  • Nette/Http ~2.4.7 || ~3.0
  • Nette/Utils ~2.5 || ~3.0
  • Nette/Reflection ~2.4
  • Removed \Kdyby\Redis\IRedisDriver::class and \Kdyby\Redis\IRedisDriverOld::class because they had outdated methods and docblocks, needed to be updated with redis changes. Also they had same methods as \Redis and as interfaces they needed to have same type hints as implemented classes wich depends on installed version on client server. All this meant 30+ CS and PHPStan skipped rules and no added value. So use default \Redis hinting and if needed add some undocumented stuff add it in docblok of \Kdyby\Redis\Driver\PhpRedisDriver::class since it is named driver it is appropriate place.
  • class RedisLuaJournal extends RedisJournal implements Nette\Caching\Storages\IJournal -> class RedisLuaJournal extends \Kdyby\Redis\RedisJournal
  • Composer requires ext-redis (php check remains)

Exceptions moved to separate files and changed namespace. For compatibility there is Typo3/ClassAliasLoader with aliased old namespaces. For future uses please use new namespaces.

\Kdyby\Redis\ConnectionException        => \Kdyby\Redis\Exception\ConnectionException
\Kdyby\Redis\Exception                   => \Kdyby\Redis\Exception\IException
\Kdyby\Redis\InvalidArgumentException    => \Kdyby\Redis\Exception\InvalidArgumentException
\Kdyby\Redis\LockException               => \Kdyby\Redis\Exception\LockException
\Kdyby\Redis\MissingExtensionException   => \Kdyby\Redis\Exception\MissingExtensionException
\Kdyby\Redis\RedisClientException        => \Kdyby\Redis\Exception\RedisClientException
\Kdyby\Redis\SessionHandlerException     => \Kdyby\Redis\Exception\SessionHandlerException
\Kdyby\Redis\TransactionException       => \Kdyby\Redis\Exception\TransactionException

Argument types and return types (mentioning only some which can be problem)

  • \Kdyby\Redis\DI\RedisExtension::PANEL_COUNT_MODE is private
  • Config option array_key(redis.client) is expected string|null
  • \Kdyby\Redis\Diagnostics::TIMER_NAME is private
  • Added types \Kdyby\Redis\Diagnostics\Panel::begin
  • \Kdyby\Redis\Driver\PhpRedisDriverOld::script now accepts only declared arguments, dropped func_get_args
  • Added types \Kdyby\Redis\ExclusiveLock::acquireLock
  • Added types \Kdyby\Redis\ExclusiveLock::release
  • Added types \Kdyby\Redis\ExclusiveLock::increaseLockTimeout
  • Added types \Kdyby\Redis\ExclusiveLock::getLockTimeout
  • Added types \Kdyby\Redis\ExclusiveLock::formatLock
  • Added types \Kdyby\Redis\RedisClient::__construct
  • Added types \Kdyby\Redis\RedisClient::unlock
  • Added types \Kdyby\Redis\RedisClient::lock
  • Added types \Kdyby\Redis\RedisClient::__call
  • Added types \Kdyby\Redis\RedisClient::__get
  • Added types \Kdyby\Redis\RedisClient::__set
  • Added types \Kdyby\Redis\RedisClient::__isset
  • \Kdyby\Redis\RedisJournal and Lua version constants made private
  • Added types \Kdyby\Redis\RedisJournal::write
  • Added types \Kdyby\Redis\RedisJournal::formatKey
  • \Kdyby\Redis\RedisStorage constants made private
  • Added types \Kdyby\Redis\RedisStorage::read
  • Added types \Kdyby\Redis\RedisStorage::lock
  • Added types \Kdyby\Redis\RedisStorage::unlock
  • Added types \Kdyby\Redis\RedisStorage::write
  • Added types \Kdyby\Redis\RedisStorage::remove

And more, see #85 for all changes