Laravel 5.6 updates

Travis config update

Removed HHVM script as Laravel no longer support HHVM after releasing 5.3
This commit is contained in:
Manish Verma
2018-08-06 20:08:55 +05:30
parent 126fbb0255
commit 1ac0f42a58
2464 changed files with 65239 additions and 46734 deletions

View File

@@ -23,9 +23,7 @@ class ArrayStore extends TaggableStore implements Store
*/
public function get($key)
{
if (array_key_exists($key, $this->storage)) {
return $this->storage[$key];
}
return $this->storage[$key] ?? null;
}
/**

View File

@@ -61,7 +61,7 @@ class CacheManager implements FactoryContract
/**
* Get a cache driver instance.
*
* @param string $driver
* @param string|null $driver
* @return mixed
*/
public function driver($driver = null)

View File

@@ -72,7 +72,7 @@ class ClearCommand extends Command
'cache:cleared', [$this->argument('store'), $this->tags()]
);
$this->info('Cache cleared successfully.');
$this->info('Application cache cleared!');
}
/**
@@ -82,7 +82,11 @@ class ClearCommand extends Command
*/
public function flushFacades()
{
foreach ($this->files->files(storage_path('framework/cache')) as $file) {
if (! $this->files->exists($storagePath = storage_path('framework/cache'))) {
return;
}
foreach ($this->files->files($storagePath) as $file) {
if (preg_match('/facade-.*\.php$/', $file)) {
$this->files->delete($file);
}

View File

@@ -91,7 +91,7 @@ class FileStore implements Store
$raw = $this->getPayload($key);
return tap(((int) $raw['data']) + $value, function ($newValue) use ($key, $raw) {
$this->put($key, $newValue, $raw['time']);
$this->put($key, $newValue, $raw['time'] ?? 0);
});
}

View File

@@ -47,7 +47,7 @@ class MemcachedConnector
{
$memcached = $this->createMemcachedInstance($connectionId);
if (count($credentials) == 2) {
if (count($credentials) === 2) {
$this->setCredentials($memcached, $credentials);
}

View File

@@ -32,10 +32,9 @@ class RateLimiter
*
* @param string $key
* @param int $maxAttempts
* @param float|int $decayMinutes
* @return bool
*/
public function tooManyAttempts($key, $maxAttempts, $decayMinutes = 1)
public function tooManyAttempts($key, $maxAttempts)
{
if ($this->attempts($key) >= $maxAttempts) {
if ($this->cache->has($key.':timer')) {

View File

@@ -22,7 +22,7 @@ class RedisTaggedCache extends TaggedCache
*
* @param string $key
* @param mixed $value
* @param \DateTime|float|int $minutes
* @param \DateTime|float|int|null $minutes
* @return void
*/
public function put($key, $value, $minutes = null)
@@ -32,6 +32,34 @@ class RedisTaggedCache extends TaggedCache
parent::put($key, $value, $minutes);
}
/**
* Increment the value of an item in the cache.
*
* @param string $key
* @param mixed $value
* @return void
*/
public function increment($key, $value = 1)
{
$this->pushStandardKeys($this->tags->getNamespace(), $key);
parent::increment($key, $value);
}
/**
* Decrement the value of an item in the cache.
*
* @param string $key
* @param mixed $value
* @return void
*/
public function decrement($key, $value = 1)
{
$this->pushStandardKeys($this->tags->getNamespace(), $key);
parent::decrement($key, $value);
}
/**
* Store an item in the cache indefinitely.
*

View File

@@ -182,7 +182,7 @@ class Repository implements CacheContract, ArrayAccess
*
* @param string $key
* @param mixed $value
* @param \DateTimeInterface|\DateInterval|float|int $minutes
* @param \DateTimeInterface|\DateInterval|float|int|null $minutes
* @return void
*/
public function put($key, $value, $minutes = null)
@@ -419,7 +419,7 @@ class Repository implements CacheContract, ArrayAccess
throw new BadMethodCallException('This cache store does not support tagging.');
}
$cache = $this->store->tags($names);
$cache = $this->store->tags(is_array($names) ? $names : func_get_args());
if (! is_null($this->events)) {
$cache->setEventDispatcher($this->events);

View File

@@ -42,7 +42,7 @@ class TaggedCache extends Repository
}
/**
* Increment the value of an item in the cache.
* Decrement the value of an item in the cache.
*
* @param string $key
* @param mixed $value

View File

@@ -14,9 +14,9 @@
}
],
"require": {
"php": ">=7.0",
"illuminate/contracts": "5.5.*",
"illuminate/support": "5.5.*"
"php": "^7.1.3",
"illuminate/contracts": "5.6.*",
"illuminate/support": "5.6.*"
},
"autoload": {
"psr-4": {
@@ -25,13 +25,13 @@
},
"extra": {
"branch-alias": {
"dev-master": "5.5-dev"
"dev-master": "5.6-dev"
}
},
"suggest": {
"illuminate/database": "Required to use the database cache driver (5.5.*).",
"illuminate/filesystem": "Required to use the file cache driver (5.5.*).",
"illuminate/redis": "Required to use the redis cache driver (5.5.*)."
"illuminate/database": "Required to use the database cache driver (5.6.*).",
"illuminate/filesystem": "Required to use the file cache driver (5.6.*).",
"illuminate/redis": "Required to use the redis cache driver (5.6.*)."
},
"config": {
"sort-packages": true