Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implement StoreInterface #10

Merged
merged 5 commits into from
Aug 15, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
136 changes: 73 additions & 63 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,63 +1,73 @@
# ItalyStrap Config API

[![Build status](https://github.com/ItalyStrap/config/actions/workflows/test.yml/badge.svg)](https://github.com/ItalyStrap/config/actions/workflows/test.yml?query=workflow%3Atest)
[![Latest Stable Version](https://img.shields.io/packagist/v/italystrap/config.svg)](https://packagist.org/packages/italystrap/config)
[![Total Downloads](https://img.shields.io/packagist/dt/italystrap/config.svg)](https://packagist.org/packages/italystrap/config)
[![Latest Unstable Version](https://img.shields.io/packagist/vpre/italystrap/config.svg)](https://packagist.org/packages/italystrap/config)
[![License](https://img.shields.io/packagist/l/italystrap/config.svg)](https://packagist.org/packages/italystrap/config)
![PHP from Packagist](https://img.shields.io/packagist/php-v/italystrap/config)

ItalyStrap Config Module - a simple and useful configuration package the OOP way

## Table Of Contents

* [Installation](#installation)
* [Basic Usage](#basic-usage)
* [Advanced Usage](#advanced-usage)
* [Contributing](#contributing)
* [License](#license)

## Installation

The best way to use this package is through Composer:

```CMD
composer require italystrap/config
```

## Basic Usage

```php
use ItalyStrap\Config\Config;

$config = new Config($configObjOrArrayOptional, $configDefaultOptional);

$value = $config->get('key', $optionalDefaultValue);

```

## Advanced Usage

You can see more advanced example in the tests' folder.

## Contributing

All feedback / bug reports / pull requests are welcome.

## License

Copyright (c) 2019 Enea Overclokk, ItalyStrap

This code is licensed under the [MIT](LICENSE).

## Credits

Ideas for the Config::class from:
- [Tonya Mork](https://github.com/wpfulcrum/config)
- [Alain Schlesser](https://github.com/brightnucleus/config)

For the Notation Array Search:
- https://github.com/balambasik/input/blob/master/src/Input.php

For some ideas:
- [ChatGPT](https://chat.openai.com)
# ItalyStrap Config API

[![Build status](https://github.com/ItalyStrap/config/actions/workflows/test.yml/badge.svg)](https://github.com/ItalyStrap/config/actions/workflows/test.yml?query=workflow%3Atest)
[![Latest Stable Version](https://img.shields.io/packagist/v/italystrap/config.svg)](https://packagist.org/packages/italystrap/config)
[![Total Downloads](https://img.shields.io/packagist/dt/italystrap/config.svg)](https://packagist.org/packages/italystrap/config)
[![Latest Unstable Version](https://img.shields.io/packagist/vpre/italystrap/config.svg)](https://packagist.org/packages/italystrap/config)
[![License](https://img.shields.io/packagist/l/italystrap/config.svg)](https://packagist.org/packages/italystrap/config)
![PHP from Packagist](https://img.shields.io/packagist/php-v/italystrap/config)

ItalyStrap Config Module - a simple and useful configuration package the OOP way

## Table Of Contents

* [Installation](#installation)
* [Basic Usage](#basic-usage)
* [Advanced Usage](#advanced-usage)
* [Contributing](#contributing)
* [License](#license)

## Installation

The best way to use this package is through Composer:

```CMD
composer require italystrap/config
```

## Basic Usage

```php
use ItalyStrap\Config\Config;

$config = new Config($configObjOrArrayOptional, $configDefaultOptional);

$value = $config->get('key', $optionalDefaultValue);

```

## Advanced Usage

You can see more advanced example in the tests' folder.

## Deprecation

List of all deprecated method that will be removed in the next major release.

* `Config::push()` => `Config::set()`
* `Config::add()` => `Config::set()`
* `Config::remove()` => `Config::delete()`
* `Config::all()` => `Config::toArray()`
* `ConfigThemeMods::class`

## Contributing

All feedback / bug reports / pull requests are welcome.

## License

Copyright (c) 2019 Enea Overclokk, ItalyStrap

This code is licensed under the [MIT](LICENSE).

## Credits

Ideas for the Config::class from:
- [Tonya Mork](https://github.com/wpfulcrum/config)
- [Alain Schlesser](https://github.com/brightnucleus/config)

For the Notation Array Search:
- https://github.com/balambasik/input/blob/master/src/Input.php

For some ideas:
- [ChatGPT](https://chat.openai.com)
260 changes: 131 additions & 129 deletions composer.json
Original file line number Diff line number Diff line change
@@ -1,129 +1,131 @@
{
"name": "italystrap/config",
"description": "ItalyStrap Config Module - a simple and useful configuration package the OOP way",
"keywords": ["Config", "Configuration Object"],
"type": "library",
"license": "MIT",
"authors": [
{
"name": "Enea Overclokk",
"email": "info@overclokk.net",
"homepage": "https://www.italystrap.com",
"role": "Developer"
}
],
"minimum-stability": "stable",
"require": {
"php" : ">=7.4"
},
"require-dev": {
"lucatume/wp-browser": "^3.1",
"lucatume/function-mocker-le": "^1.0",
"codeception/module-asserts": "^1.0",
"phpspec/prophecy-phpunit": "^2.0",

"squizlabs/php_codesniffer": "^3.7",
"phpcompatibility/php-compatibility": "^9.3",
"dealerdirect/phpcodesniffer-composer-installer": "^0.7.2",

"vimeo/psalm": "^4.26",
"humanmade/psalm-plugin-wordpress": "^2.0.3",

"phpbench/phpbench": "^1.2",
"phpmetrics/phpmetrics": "^2.8",

"rector/rector": "^0.15.17",
"infection/infection": "^0.26.6",
"infection/codeception-adapter": "^0.4.1",
"italystrap/event": "dev-master",
"italystrap/debug": "^2.1"
},
"autoload": {
"psr-4": {
"ItalyStrap\\Config\\": "src/"
},
"classmap": [
"legacy/"
]
},
"autoload-dev": {
"classmap": [
"tests/"
],
"psr-4": {
"ItalyStrap\\Tests\\": "tests/src",
"ItalyStrap\\Tests\\Unit\\": "tests/unit",
"ItalyStrap\\Tests\\Stubs\\": "tests/_data/Stubs"
},
"files": [
]
},
"suggest": {
"italystrap/event": "EventDispatcher for WordPress"
},
"scripts": {
"qa": [
"@cs",
"@psalm",
"@unit",
"@clean",
"@infection",
"@examples"
],
"tests": [
"@unit",
"@infection"
],
"cs": [
"@php vendor/bin/phpcs -p --ignore=./tests/_support/* ./src/ ./tests/"
],
"cs:fix": [
"@php vendor/bin/phpcbf -p --ignore=./tests/_support/* ./src/ ./tests/"
],
"psalm": [
"@php vendor/bin/psalm --no-cache"
],
"unit": [
"@php vendor/bin/codecept run unit"
],
"unit:debug": [
"@php vendor/bin/codecept run unit --debug"
],
"infection": [
"@php vendor/bin/infection --threads=4"
],
"bench": [
"@php vendor/bin/phpbench run --report=stats"
],
"bench:prev": [
"@php vendor/bin/phpbench run --report=stats --tag=original"
],
"bench:compare:prev": [
"@php vendor/bin/phpbench run --report=stats --ref=original"
],
"metrics": [
"@php vendor/bin/phpmetrics --report-html='./tests/_output/report' ./src"
],
"insights": [
"@php vendor/bin/phpinsights"
],
"clean": [
"@php vendor/bin/codecept clean"
],
"examples": [
"@php index.php"
]
},
"support" : {
"issues": "https://github.com/ItalyStrap/config/issues",
"source": "https://github.com/ItalyStrap/config"
},
"config": {
"allow-plugins": {
"codeception/c3": true,
"composer/package-versions-deprecated": true,
"dealerdirect/phpcodesniffer-composer-installer": true,
"infection/extension-installer": true
}
}
}
{
"name": "italystrap/config",
"description": "ItalyStrap Config Module - a simple and useful configuration package the OOP way",
"keywords": ["Config", "Configuration Object"],
"type": "library",
"license": "MIT",
"authors": [
{
"name": "Enea Overclokk",
"email": "info@overclokk.net",
"homepage": "https://www.italystrap.com",
"role": "Developer"
}
],
"minimum-stability": "stable",
"require": {
"php" : ">=7.4",
"italystrap/storage": "^1.0.0"
},
"require-dev": {
"lucatume/wp-browser": "^3.1",
"lucatume/function-mocker-le": "^1.0",
"codeception/module-asserts": "^1.0",
"phpspec/prophecy-phpunit": "^2.0",

"squizlabs/php_codesniffer": "^3.7",
"phpcompatibility/php-compatibility": "^9.3",
"dealerdirect/phpcodesniffer-composer-installer": "^0.7.2",

"vimeo/psalm": "^4.26",
"humanmade/psalm-plugin-wordpress": "^2.0.3",

"phpbench/phpbench": "^1.2",
"phpmetrics/phpmetrics": "^2.8",

"rector/rector": "^0.15.17",
"infection/infection": "^0.26.6",
"infection/codeception-adapter": "^0.4.1",
"italystrap/debug": "^2.1",
"italystrap/event": "dev-master",
"italystrap/storage-tests": "dev-master"
},
"autoload": {
"psr-4": {
"ItalyStrap\\Config\\": "src/"
},
"classmap": [
"legacy/"
]
},
"autoload-dev": {
"classmap": [
"tests/"
],
"psr-4": {
"ItalyStrap\\Tests\\": "tests/src",
"ItalyStrap\\Tests\\Unit\\": "tests/unit",
"ItalyStrap\\Tests\\Stubs\\": "tests/_data/Stubs"
},
"files": [
]
},
"suggest": {
"italystrap/event": "EventDispatcher for WordPress"
},
"scripts": {
"qa": [
"@cs",
"@psalm",
"@unit",
"@clean",
"@infection",
"@examples"
],
"tests": [
"@unit",
"@infection"
],
"cs": [
"@php vendor/bin/phpcs -p --ignore=./tests/_support/* ./src/ ./tests/"
],
"cs:fix": [
"@php vendor/bin/phpcbf -p --ignore=./tests/_support/* ./src/ ./tests/"
],
"psalm": [
"@php vendor/bin/psalm --no-cache"
],
"unit": [
"@php vendor/bin/codecept run unit"
],
"unit:debug": [
"@php vendor/bin/codecept run unit --debug"
],
"infection": [
"@php vendor/bin/infection --threads=4"
],
"bench": [
"@php vendor/bin/phpbench run --report=stats"
],
"bench:prev": [
"@php vendor/bin/phpbench run --report=stats --tag=original"
],
"bench:compare:prev": [
"@php vendor/bin/phpbench run --report=stats --ref=original"
],
"metrics": [
"@php vendor/bin/phpmetrics --report-html='./tests/_output/report' ./src"
],
"insights": [
"@php vendor/bin/phpinsights"
],
"clean": [
"@php vendor/bin/codecept clean"
],
"examples": [
"@php index.php"
]
},
"support" : {
"issues": "https://github.com/ItalyStrap/config/issues",
"source": "https://github.com/ItalyStrap/config"
},
"config": {
"allow-plugins": {
"codeception/c3": true,
"composer/package-versions-deprecated": true,
"dealerdirect/phpcodesniffer-composer-installer": true,
"infection/extension-installer": true
}
}
}
Loading
Loading