Skip to content

Commit

Permalink
Registry 5.0.0
Browse files Browse the repository at this point in the history
  • Loading branch information
Awilum committed Jul 3, 2022
1 parent e4f092c commit 6eebea1
Show file tree
Hide file tree
Showing 8 changed files with 42 additions and 46 deletions.
42 changes: 11 additions & 31 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -1,22 +1,13 @@
name: CI
on: ['push', 'pull_request']
jobs:
phpstan:
name: PHP Static Analysis
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: PHPStan
uses: docker://oskarstark/phpstan-ga
with:
args: analyse src/ -c phpstan.neon
tests:
name: Unit Tests for PHP ${{ matrix.php }} - ${{ matrix.os }} - ${{ matrix.dependency-version }}
ci:
name: PHP ${{ matrix.php }} - ${{ matrix.os }} - ${{ matrix.dependency-version }}
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
php: ['7.4', '8.0', '8.1']
os: [ubuntu-latest, macos-latest]
php: ['8.1']
dependency-version: [prefer-stable]

steps:
Expand All @@ -27,7 +18,7 @@ jobs:
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php }}
extensions: fileinfo, spl, json, dom, mbstring, pcntl
extensions: pcntl, mcrypt, openssl
ini-values: disable_functions, error_reporting=E_ALL
tools: composer:v2
coverage: xdebug
Expand All @@ -37,28 +28,17 @@ jobs:
echo "::add-matcher::${{ runner.tool_cache }}/php.json"
echo "::add-matcher::${{ runner.tool_cache }}/phpunit.json"
- name: Install PHP 7 dependencies
- name: Install PHP 8.1 dependencies
run: composer update --${{ matrix.dependency-version }} --no-interaction --no-progress
if: "matrix.php < 8"

- name: Install PHP 8 dependencies
if: "matrix.php >= 8"
run: composer update --${{ matrix.dependency-version }} --no-interaction --no-progress

- name: Run Tests for PHP 7.4
if: "matrix.php == 7.4"
run: ./vendor/bin/pest --coverage

- name: Run Tests for PHP 8.0
if: "matrix.php == 8.0"
run: ./vendor/bin/pest --coverage


- name: PHP Static Analysis for PHP 8.1
run: ./vendor/bin/phpstan

- name: Run Tests for PHP 8.1
if: "matrix.php == 8.1"
run: ./vendor/bin/pest --coverage

support:
needs: [phpstan, tests]
needs: [ci]
name: Discord Notification
runs-on: ubuntu-latest
steps:
Expand Down
7 changes: 6 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
<a name="5.0.0"></a>
# [5.0.0](https://github.com/glowyphp/registry) (2022-07-03)
* Moving to PHP 8.1
* Use union types.

<a name="4.0.0"></a>
# [4.0.0](https://github.com/glowyphp/csrf) (2021-12-23)
# [4.0.0](https://github.com/glowyphp/registry) (2021-12-23)
* Released under Glowy PHP Organization.
* Add PHP 8.1 support.
* Updated dependencies.
Expand Down
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
The MIT License (MIT)

Copyright (c) 2022 Sergey Romanenko
Copyright (c) Sergey Romanenko

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
4 changes: 1 addition & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,7 @@ Registry Package provides a fluent, object-oriented interface for storing data g
</p>

<p align="center">
<a href="https://github.com/glowyphp/registry/releases"><img alt="Version" src="https://img.shields.io/github/release/glowyphp/registry.svg?label=version&style=for-the-badge"></a>
<a href="https://github.com/glowyphp/registry"><img src="https://img.shields.io/badge/license-MIT-blue.svg?style=for-the-badge" alt="License"></a>
<a href="https://packagist.org/packages/glowy/registry"><img src="https://poser.pugx.org/glowy/registry/downloads?style=for-the-badge" alt="Total downloads"></a><img src="http://poser.pugx.org/glowy/registry/require/php?style=for-the-badge">
<img src="https://img.shields.io/badge/license-MIT-blue.svg?label=License" alt="License MIT"> <a href="https://packagist.org/packages/glowy/registry"><img src="https://poser.pugx.org/glowy/registry/downloads" alt="Total downloads"></a> <img alt="GitHub Repo stars" src="https://img.shields.io/github/stars/glowyphp/registry?label=Stars"> <img alt="GitHub forks" src="https://img.shields.io/github/forks/glowyphp/registry?label=Forks"> <a href="https://hitsofcode.com"><img alt="Hits of Code" src="https://hitsofcode.com/github/glowyphp/registry?branch=5.x"></a> <a href="https://discord.gg/ewQkqgfBAc"><img src="https://img.shields.io/discord/423097982498635778.svg?logo=discord&label=Discord%20Chat" alt="Discord"></a>
</p>

<br>
Expand Down
24 changes: 17 additions & 7 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,13 @@
"authors": [
{
"name": "Sergey Romanenko",
"email": "[email protected]",
"homepage": "https://github.com/Awilum"
"email": "[email protected]",
"homepage": "https://awilum.github.io"
}
],
"require": {
"php": "^7.4 || ^8.0",
"glowy/arrays": "^4.0"
"php": "^8.1",
"glowy/arrays": "^5.0"
},
"autoload":{
"psr-4": {
Expand All @@ -30,8 +30,18 @@
},
"require-dev": {
"doctrine/coding-standard": "9.0.0",
"pestphp/pest": "^1.21.1",
"phpstan/phpstan": "^1.2.0",
"symfony/var-dumper": "^5.4.0"
"pestphp/pest": "^1.21.3",
"phpstan/phpstan": "^1.8.0",
"victorjonsson/markdowndocs": "dev-master"
},
"config": {
"apcu-autoloader": true,
"optimize-autoloader": true,
"platform-check": false,
"sort-packages": true,
"allow-plugins": {
"pestphp/pest-plugin": true,
"dealerdirect/phpcodesniffer-composer-installer": true
}
}
}
4 changes: 2 additions & 2 deletions src/Registry.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,12 @@ class Registry extends Arrays
/**
* Registry instance
*/
private static ?Registry $instance = null;
private static Registry|null $instance = null;

/**
* Registry storage
*/
private static ?Arrays $storage = null;
private static Arrays|null $storage = null;

/**
* Gets the instance via lazy initialization (created on first usage)
Expand Down
4 changes: 3 additions & 1 deletion src/helpers.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,15 @@

declare(strict_types=1);

namespace Glowy\Registry;

use Glowy\Registry\Registry;

if (! function_exists('registry')) {
/**
* Gets the instance via lazy initialization (created on first usage)
*/
function registry(): Registry
function registry(): \Glowy\Registry\Registry
{
return Registry::getInstance();
}
Expand Down
1 change: 1 addition & 0 deletions tests/RegistryTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
declare(strict_types = 1);

use Glowy\Registry\Registry;
use function Glowy\Registry\registry;

test('test getInstance() method', function() {
$this->assertInstanceOf(Registry::class, Registry::getInstance());
Expand Down

0 comments on commit 6eebea1

Please sign in to comment.