Skip to content

Commit

Permalink
Merge branch 'dev'
Browse files Browse the repository at this point in the history
  • Loading branch information
Awilum committed Dec 2, 2020
2 parents 6cd2b4a + eeb7de8 commit 3c6bd40
Show file tree
Hide file tree
Showing 5 changed files with 20 additions and 10 deletions.
11 changes: 6 additions & 5 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ on: ['push', 'pull_request']

jobs:
build:

name: PHP ${{ matrix.php }} - ${{ matrix.os }} - ${{ matrix.dependency-version }}
runs-on: ${{ matrix.os }}
strategy:
matrix:
Expand All @@ -20,13 +20,14 @@ jobs:
with:
php-version: ${{ matrix.php }}
tools: composer:v2
coverage: none
extensions: json, mbstring
coverage: xdebug

- name: Setup Problem Matches
run: |
echo "::add-matcher::${{ runner.tool_cache }}/php.json"
echo "::add-matcher::${{ runner.tool_cache }}/phpunit.json"
- name: Install PHP 7 dependencies
run: composer update --dev --${{ matrix.dependency-version }} --no-interaction --no-progress
if: "matrix.php < 8"
Expand All @@ -35,5 +36,5 @@ jobs:
run: composer update --dev --${{ matrix.dependency-version }} --ignore-platform-req=php --no-interaction --no-progress
if: "matrix.php >= 8"

- name: Run Tests
run: ./vendor/bin/pest
- name: Run Tests with Coverage
run: ./vendor/bin/pest --coverage
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
<a name="2.0.0"></a>
# [2.0.0](https://github.com/atomastic/registry) (2020-12-02)
* use new Arrays 2.0.0
* general code refactoring.
* improve tests workflow.

<a name="1.0.1"></a>
# [1.0.1](https://github.com/atomastic/registry) (2020-10-06)
* Update composer.json
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
Registry Component provides a fluent, object-oriented interface for storing data globally in a well managed fashion, helping to prevent global meltdown.
</p>
<p align="center">
<a href="https://github.com/atomastic/registry/releases"><img alt="Version" src="https://img.shields.io/github/release/atomastic/registry.svg?label=version&color=green"></a> <a href="https://github.com/atomastic/registry"><img src="https://img.shields.io/badge/license-MIT-blue.svg?color=green" alt="License"></a> <a href="https://github.com/atomastic/registry"><img src="https://img.shields.io/github/downloads/atomastic/registry/total.svg?color=green" alt="Total downloads"></a> <img src="https://github.com/atomastic/registry/workflows/Static%20Analysis/badge.svg?branch=dev"> <img src="https://github.com/atomastic/registry/workflows/Tests/badge.svg">
<a href="https://github.com/atomastic/registry/releases"><img alt="Version" src="https://img.shields.io/github/release/atomastic/registry.svg?label=version&color=green"></a> <a href="https://github.com/atomastic/registry"><img src="https://img.shields.io/badge/license-MIT-blue.svg?color=green" alt="License"></a> <a href="https://packagist.org/packages/atomastic/registry"><img src="https://poser.pugx.org/atomastic/registry/downloads" alt="Total downloads"></a> <img src="https://github.com/atomastic/registry/workflows/Static%20Analysis/badge.svg?branch=dev"> <img src="https://github.com/atomastic/registry/workflows/Tests/badge.svg">
<a href="https://app.codacy.com/gh/atomastic/registry?utm_source=github.com&utm_medium=referral&utm_content=atomastic/registry&utm_campaign=Badge_Grade_Dashboard"><img src="https://api.codacy.com/project/badge/Grade/72b4dc84c20145e1b77dc0004a3c8e3d"></a> <a href="https://codeclimate.com/github/atomastic/registry/maintainability"><img src="https://api.codeclimate.com/v1/badges/4aff5282f051b4aebe22/maintainability" /></a> <a href="https://app.fossa.com/projects/git%2Bgithub.com%2Fatomastic%2Fregistry?ref=badge_shield" alt="FOSSA Status"><img src="https://app.fossa.com/api/projects/git%2Bgithub.com%2Fatomastic%2Fregistry.svg?type=shield"/></a>
</p>

Expand Down
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
],
"require": {
"php": "^7.3 || ^8.0",
"atomastic/arrays": "^1.0"
"atomastic/arrays": "^2.0"
},
"autoload":{
"psr-4": {
Expand Down
9 changes: 6 additions & 3 deletions src/Registry.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
namespace Atomastic\Registry;

use Atomastic\Arrays\Arrays;
use Exception;

final class Registry
{
Expand Down Expand Up @@ -44,21 +45,23 @@ public static function getInstance(): Registry
*/
protected function __construct()
{

}

/**
* Prevent the instance from being cloned (which would create a second instance of it)
*/
protected function __clone()
{

}

/**
* Prevent from being unserialized (which would create a second instance of it)
*/
public function __wakeup()
{
throw new \Exception("Cannot unserialize a Registry.");
throw new Exception("Cannot unserialize a Registry.");
}

/**
Expand Down Expand Up @@ -93,7 +96,7 @@ public function has($keys): bool
/**
* Get item from the registry.
*
* @param string $key The name of the item to fetch.
* @param string $key The keys of the registry item to get.
* @param mixed $default Default value
*/
public function get(string $key, $default = null)
Expand All @@ -104,7 +107,7 @@ public function get(string $key, $default = null)
/**
* Delete a items from the registry.
*
* @param array|string $keys Keys
* @param array|string $keys Keys.
*/
public function delete($keys): self
{
Expand Down

0 comments on commit 3c6bd40

Please sign in to comment.