Skip to content

Commit

Permalink
Merge branch '5.x'
Browse files Browse the repository at this point in the history
  • Loading branch information
crynobone committed Aug 29, 2020
2 parents 9f614bf + 8609e70 commit 44c19c9
Show file tree
Hide file tree
Showing 16 changed files with 23 additions and 212 deletions.
1 change: 0 additions & 1 deletion .php_cs
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ return PhpCsFixer\Config::create()
'no_extra_consecutive_blank_lines' => false,
'no_unneeded_control_parentheses' => false,
'not_operator_with_successor_space' => true,
'no_superfluous_phpdoc_tags' => false,
'ordered_imports' => ['sortAlgorithm' => 'alpha'],
'phpdoc_align' => false,
'phpdoc_no_empty_return' => false,
Expand Down
50 changes: 0 additions & 50 deletions CHANGELOG-3.x.md

This file was deleted.

6 changes: 3 additions & 3 deletions CHANGELOG-4.x.md
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
# Changelog for 3.x
# Changelog for 4.x

This changelog references the relevant changes (bug and security fixes) done to `orchestra/memory`.

## 4.0.0

Released: 2019-9-02
Released: 2019-09-02

### Changes

* Update support for Laravel Framework v6.0.
* Update support for Laravel Framework v6.
11 changes: 11 additions & 0 deletions CHANGELOG-5.x.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# Changelog for 5.x

This changelog references the relevant changes (bug and security fixes) done to `orchestra/memory`.

## 5.0.0

Released: 2020-02-28

### Changes

* Update support for Laravel Framework v7.
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ class OrchestraMemoryCreateOptionsTable extends Migration
public function up()
{
Schema::create('orchestra_options', function (Blueprint $table) {
$table->increments('id');
$table->id();
$table->string('name', 64);
$table->longText('value');

Expand Down
26 changes: 1 addition & 25 deletions src/DatabaseHandler.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,6 @@ abstract class DatabaseHandler extends Handler implements HandlerContract
{
/**
* Load the data from database.
*
* @return array
*/
public function initiate(): array
{
Expand All @@ -37,10 +35,6 @@ public function initiate(): array

/**
* Save data to database.
*
* @param array $items
*
* @return bool
*/
public function finish(array $items = []): bool
{
Expand Down Expand Up @@ -71,11 +65,7 @@ public function finish(array $items = []): bool
/**
* Attempt to save or remove data to the database.
*
* @param string $key
* @param mixed $value
* @param bool $isNew
*
* @return void
* @param mixed $value
*/
protected function saving(string $key, $value, bool $isNew): void
{
Expand All @@ -89,20 +79,12 @@ protected function saving(string $key, $value, bool $isNew): void
/**
* Create/insert data to database.
*
* @param string $key
* @param mixed $value
* @param bool $isNew
*
* @return void
*/
abstract protected function save(string $key, $value, bool $isNew = false): void;

/**
* Remove data from database.
*
* @param string $key
*
* @return void
*/
abstract protected function delete(string $key): void;

Expand All @@ -115,8 +97,6 @@ abstract protected function resolver();

/**
* Get items from cache.
*
* @return \Illuminate\Support\Collection
*/
protected function getItemsFromCache(): Collection
{
Expand All @@ -127,8 +107,6 @@ protected function getItemsFromCache(): Collection

/**
* Get items from database.
*
* @return \Illuminate\Support\Collection
*/
protected function getItemsFromDatabase(): Collection
{
Expand All @@ -139,8 +117,6 @@ protected function getItemsFromDatabase(): Collection
* Convert mixed value fetch from database to array.
*
* @param \Illuminate\Support\Collection|\Illuminate\Contracts\Support\Arrayable|array $data
*
* @return array
*/
protected function asArray($data = []): array
{
Expand Down
32 changes: 4 additions & 28 deletions src/Handler.php
Original file line number Diff line number Diff line change
Expand Up @@ -57,24 +57,17 @@ abstract class Handler

/**
* Setup a new memory handler.
*
* @param string $name
* @param array $config
*/
public function __construct($name, array $config)
public function __construct(string $name, array $config)
{
$this->name = $name;
$this->config = \array_merge($this->config, $config);
$this->cacheKey = "db-memory:{$this->storage}-{$this->name}";

$this->cacheKey = "db-memory:{$this->storage}-{$name}";
}

/**
* Add key with id and checksum.
*
* @param string $name
* @param array $option
*
* @return void
*/
protected function addKey(string $name, array $option): void
{
Expand All @@ -86,11 +79,6 @@ protected function addKey(string $name, array $option): void

/**
* Verify checksum.
*
* @param string $name
* @param string $check
*
* @return bool
*/
protected function check(string $name, string $check = ''): bool
{
Expand All @@ -101,8 +89,6 @@ protected function check(string $name, string $check = ''): bool
* Generate a checksum from given value.
*
* @param mixed $value
*
* @return string
*/
protected function generateNewChecksum($value): string
{
Expand All @@ -116,9 +102,7 @@ protected function generateNewChecksum($value): string
/**
* Is given key a new content.
*
* @param string $name
*
* @return int
* @return int|null
*/
protected function getKeyId(string $name)
{
Expand All @@ -127,8 +111,6 @@ protected function getKeyId(string $name)

/**
* Get storage name.
*
* @return string
*/
public function getStorageName(): string
{
Expand All @@ -137,8 +119,6 @@ public function getStorageName(): string

/**
* Get handler name.
*
* @return string
*/
public function getName(): string
{
Expand All @@ -147,10 +127,6 @@ public function getName(): string

/**
* Get if from content is new.
*
* @param string $name
*
* @return bool
*/
protected function isNewKey(string $name): bool
{
Expand Down
10 changes: 0 additions & 10 deletions src/Handlers/Cache.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,6 @@ class Cache extends Handler implements HandlerContract

/**
* Setup a new memory handler.
*
* @param string $name
* @param array $config
* @param \Illuminate\Contracts\Cache\Repository $cache
*/
public function __construct(string $name, array $config, Repository $cache)
{
Expand All @@ -33,8 +29,6 @@ public function __construct(string $name, array $config, Repository $cache)

/**
* Load the data from cache.
*
* @return array
*/
public function initiate(): array
{
Expand All @@ -43,10 +37,6 @@ public function initiate(): array

/**
* Save data to cache.
*
* @param array $items
*
* @return bool
*/
public function finish(array $items = []): bool
{
Expand Down
13 changes: 0 additions & 13 deletions src/Handlers/Eloquent.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,11 +26,6 @@ class Eloquent extends DatabaseHandler

/**
* Setup a new memory handler.
*
* @param string $name
* @param array $config
* @param \Illuminate\Contracts\Container\Container $repository
* @param \Illuminate\Contracts\Cache\Repository $cache
*/
public function __construct(string $name, array $config, Container $repository, Repository $cache)
{
Expand All @@ -46,11 +41,7 @@ public function __construct(string $name, array $config, Container $repository,
/**
* Create/insert data to database.
*
* @param string $key
* @param mixed $value
* @param bool $isNew
*
* @return void
*/
protected function save(string $key, $value, bool $isNew = false): void
{
Expand All @@ -70,10 +61,6 @@ protected function save(string $key, $value, bool $isNew = false): void

/**
* Remove data from database.
*
* @param string $key
*
* @return void
*/
protected function delete(string $key): void
{
Expand Down
13 changes: 0 additions & 13 deletions src/Handlers/Fluent.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,11 +26,6 @@ class Fluent extends DatabaseHandler

/**
* Setup a new memory handler.
*
* @param string $name
* @param array $config
* @param \Illuminate\Database\DatabaseManager $repository
* @param \Illuminate\Contracts\Cache\Repository $cache
*/
public function __construct(string $name, array $config, DatabaseManager $repository, Repository $cache)
{
Expand All @@ -46,11 +41,7 @@ public function __construct(string $name, array $config, DatabaseManager $reposi
/**
* Create/insert data to database.
*
* @param string $key
* @param mixed $value
* @param bool $isNew
*
* @return void
*/
protected function save(string $key, $value, bool $isNew = false): void
{
Expand All @@ -71,10 +62,6 @@ protected function save(string $key, $value, bool $isNew = false): void

/**
* Remove data from database.
*
* @param string $key
*
* @return void
*/
protected function delete(string $key): void
{
Expand Down
6 changes: 0 additions & 6 deletions src/Handlers/Runtime.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,6 @@ class Runtime extends Handler implements HandlerContract

/**
* Load empty data for runtime.
*
* @return array
*/
public function initiate(): array
{
Expand All @@ -26,10 +24,6 @@ public function initiate(): array

/**
* Save empty data to /dev/null.
*
* @param array $items
*
* @return bool
*/
public function finish(array $items = []): bool
{
Expand Down

0 comments on commit 44c19c9

Please sign in to comment.