From 49f1b6b97f4a17242c49b94afbea51f332988dbf Mon Sep 17 00:00:00 2001 From: microThread Date: Mon, 4 Mar 2019 19:57:48 +0200 Subject: [PATCH 01/17] [*]: CS Fix [*]: Update title/description in README.md & composer.json --- README.md | 2 +- composer.json | 4 ++-- phpcs.xml.dist | 3 --- 3 files changed, 3 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index ae3b6ba..fa542b3 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -# DotArray - Sail through array using the dot notation +# PHP Dot-Array :: Sail through array using the dot notation

~ Enjoy your :coffee: ~

diff --git a/composer.json b/composer.json index 23331db..46eff2e 100644 --- a/composer.json +++ b/composer.json @@ -1,9 +1,9 @@ { "name": "binary-cube/dot-array", - "description": "Navigate through array using JSON Dot notation path.", + "description": "PHP Dot-Array :: Sail through array using the dot notation", "keywords": [ - "DotArray", "dot-array", "array", "dot", "php-array", "php-array-json-path" + "DotArray", "dot-array", "array", "dot", "php-array", "php-array-json-path", "php" ], "type": "library", diff --git a/phpcs.xml.dist b/phpcs.xml.dist index 74d1ea3..a33c136 100644 --- a/phpcs.xml.dist +++ b/phpcs.xml.dist @@ -229,9 +229,6 @@ - - - From 1ce6bdfc112a38cd058855044b33d4d4b4ec82b9 Mon Sep 17 00:00:00 2001 From: microThread Date: Fri, 3 May 2019 15:14:54 +0300 Subject: [PATCH 02/17] [*]: CS Updates --- phpcs.xml.dist | 1 + 1 file changed, 1 insertion(+) diff --git a/phpcs.xml.dist b/phpcs.xml.dist index a33c136..f73483f 100644 --- a/phpcs.xml.dist +++ b/phpcs.xml.dist @@ -162,6 +162,7 @@ + From bdc5fe9bceeaecb3c3ab7c9a3d7347c3f5e3874f Mon Sep 17 00:00:00 2001 From: microThread Date: Tue, 18 Jun 2019 20:13:23 +0300 Subject: [PATCH 03/17] Create .readthedocs.yml --- .readthedocs.yml | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100644 .readthedocs.yml diff --git a/.readthedocs.yml b/.readthedocs.yml new file mode 100644 index 0000000..a36db8a --- /dev/null +++ b/.readthedocs.yml @@ -0,0 +1,23 @@ +# .readthedocs.yml +# Read the Docs configuration file +# See https://docs.readthedocs.io/en/stable/config-file/v2.html for details + +# Required +version: 2 + +# Build documentation in the docs/ directory with Sphinx +sphinx: + configuration: docs/conf.py + +# Build documentation with MkDocs +#mkdocs: +# configuration: mkdocs.yml + +# Optionally build your docs in additional formats such as PDF and ePub +formats: all + +# Optionally set the version of Python and requirements required to build your docs +python: + version: 3.7 + install: + - requirements: docs/requirements.txt From b600b9ac8f5edeed5aea75f4056877a9286dc424 Mon Sep 17 00:00:00 2001 From: microThread Date: Tue, 18 Jun 2019 20:16:31 +0300 Subject: [PATCH 04/17] Create requirements.txt --- docs/requirements.txt | 2 ++ 1 file changed, 2 insertions(+) create mode 100644 docs/requirements.txt diff --git a/docs/requirements.txt b/docs/requirements.txt new file mode 100644 index 0000000..38e3db8 --- /dev/null +++ b/docs/requirements.txt @@ -0,0 +1,2 @@ +Sphinx>=1.8.0 +sphinx_rtd_theme>=0.4.0 From 38c8b096c623d48686aebb9a32ab28ca44ab52b1 Mon Sep 17 00:00:00 2001 From: microThread Date: Tue, 18 Jun 2019 20:40:00 +0300 Subject: [PATCH 05/17] Create conf.py --- docs/conf.py | 54 ++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 54 insertions(+) create mode 100644 docs/conf.py diff --git a/docs/conf.py b/docs/conf.py new file mode 100644 index 0000000..ddc6d67 --- /dev/null +++ b/docs/conf.py @@ -0,0 +1,54 @@ +# Configuration file for the Sphinx documentation builder. +# +# This file only contains a selection of the most common options. For a full +# list see the documentation: +# http://www.sphinx-doc.org/en/master/config + +# -- Path setup -------------------------------------------------------------- + +# If extensions (or modules to document with autodoc) are in another directory, +# add these directories to sys.path here. If the directory is relative to the +# documentation root, use os.path.abspath to make it absolute, like shown here. +# +# import os +# import sys +# sys.path.insert(0, os.path.abspath('.')) + + +# -- Project information ----------------------------------------------------- + +project = 'DotArray' +copyright = '2019, Banciu N. Cristian Mihai' + +# The full version, including alpha/beta/rc tags +release = '1.0' + + +# -- General configuration --------------------------------------------------- + +# Add any Sphinx extension module names here, as strings. They can be +# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom +# ones. +extensions = [ +] + +# Add any paths that contain templates here, relative to this directory. +templates_path = ['_templates'] + +# List of patterns, relative to source directory, that match files and +# directories to ignore when looking for source files. +# This pattern also affects html_static_path and html_extra_path. +exclude_patterns = ['_build'] + + +# -- Options for HTML output ------------------------------------------------- + +# The theme to use for HTML and HTML Help pages. See the documentation for +# a list of builtin themes. +# +html_theme = 'sphinx_rtd_theme' + +# Add any paths that contain custom static files (such as style sheets) here, +# relative to this directory. They are copied after the builtin static files, +# so a file named "default.css" will overwrite the builtin "default.css". +html_static_path = ['_static'] From 00b4800da9232f177badba73ef1d700ae456dee4 Mon Sep 17 00:00:00 2001 From: microThread Date: Tue, 18 Jun 2019 20:48:10 +0300 Subject: [PATCH 06/17] Update requirements.txt --- docs/requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/requirements.txt b/docs/requirements.txt index 38e3db8..57880fa 100644 --- a/docs/requirements.txt +++ b/docs/requirements.txt @@ -1,2 +1,2 @@ -Sphinx>=1.8.0 +Sphinx>=2.1.0 sphinx_rtd_theme>=0.4.0 From 56aef7deab3c7b012b390dc04f4f11f46bc7b258 Mon Sep 17 00:00:00 2001 From: microThread Date: Tue, 18 Jun 2019 20:50:35 +0300 Subject: [PATCH 07/17] Create index.rst --- docs/index.rst | 5 +++++ 1 file changed, 5 insertions(+) create mode 100644 docs/index.rst diff --git a/docs/index.rst b/docs/index.rst new file mode 100644 index 0000000..3751eea --- /dev/null +++ b/docs/index.rst @@ -0,0 +1,5 @@ +.. title:: PHP Dot-Array :: Sail through array using the dot notation + +==================== +Dot-Array +==================== From b414188fd64b8d1a2ad234ba0c9c32195ed73176 Mon Sep 17 00:00:00 2001 From: microThread Date: Tue, 18 Jun 2019 20:52:48 +0300 Subject: [PATCH 08/17] Update conf.py --- docs/conf.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/conf.py b/docs/conf.py index ddc6d67..ea2b18b 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -17,7 +17,7 @@ # -- Project information ----------------------------------------------------- -project = 'DotArray' +project = 'Dot-Array' copyright = '2019, Banciu N. Cristian Mihai' # The full version, including alpha/beta/rc tags From 470e8c452fbc494a7c5529b75f2b9687168523a9 Mon Sep 17 00:00:00 2001 From: microThread Date: Tue, 18 Jun 2019 20:54:27 +0300 Subject: [PATCH 09/17] Update conf.py --- docs/conf.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/conf.py b/docs/conf.py index ea2b18b..ddc6d67 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -17,7 +17,7 @@ # -- Project information ----------------------------------------------------- -project = 'Dot-Array' +project = 'DotArray' copyright = '2019, Banciu N. Cristian Mihai' # The full version, including alpha/beta/rc tags From 9e2cfc0a5c52ac1844643ccde99e663f0671b44e Mon Sep 17 00:00:00 2001 From: microThread Date: Tue, 18 Jun 2019 21:56:01 +0300 Subject: [PATCH 10/17] Update index.rst --- docs/index.rst | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/index.rst b/docs/index.rst index 3751eea..77ee93f 100644 --- a/docs/index.rst +++ b/docs/index.rst @@ -1,5 +1,5 @@ -.. title:: PHP Dot-Array :: Sail through array using the dot notation +.. title:: PHP DotArray Library:: Sail through array using the DOT notation ==================== -Dot-Array +DotArray ==================== From 67bb5c018d27f18f98d51eb1abdf889b1c0ccee5 Mon Sep 17 00:00:00 2001 From: microThread Date: Tue, 18 Jun 2019 21:56:15 +0300 Subject: [PATCH 11/17] Create overview.rst --- docs/overview.rst | 1 + 1 file changed, 1 insertion(+) create mode 100644 docs/overview.rst diff --git a/docs/overview.rst b/docs/overview.rst new file mode 100644 index 0000000..8b13789 --- /dev/null +++ b/docs/overview.rst @@ -0,0 +1 @@ + From 8823b58e7fdfae1b24857024425b6702913b0bf5 Mon Sep 17 00:00:00 2001 From: microThread Date: Tue, 18 Jun 2019 21:57:13 +0300 Subject: [PATCH 12/17] Create quickstart.rst --- docs/quickstart.rst | 1 + 1 file changed, 1 insertion(+) create mode 100644 docs/quickstart.rst diff --git a/docs/quickstart.rst b/docs/quickstart.rst new file mode 100644 index 0000000..8b13789 --- /dev/null +++ b/docs/quickstart.rst @@ -0,0 +1 @@ + From 0c2cb6c982366592a12a2983a995fd835044dfde Mon Sep 17 00:00:00 2001 From: microThread Date: Thu, 20 Jun 2019 09:57:24 +0300 Subject: [PATCH 13/17] [*]: Documentation for Sphinx (part 1) --- docs/conf.py | 16 +++++++ docs/index.rst | 21 +++++++++ docs/overview.rst | 107 ++++++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 144 insertions(+) diff --git a/docs/conf.py b/docs/conf.py index ddc6d67..fe09287 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -30,6 +30,7 @@ # extensions coming with Sphinx (named 'sphinx.ext.*') or your custom # ones. extensions = [ + 'sphinxcontrib.phpdomain' ] # Add any paths that contain templates here, relative to this directory. @@ -52,3 +53,18 @@ # relative to this directory. They are copied after the builtin static files, # so a file named "default.css" will overwrite the builtin "default.css". html_static_path = ['_static'] + + +# -- Custom ------------------------------------------------- +import sphinx_rtd_theme +html_theme = "sphinx_rtd_theme" +html_theme_path = [sphinx_rtd_theme.get_html_theme_path()] + +# Set up PHP syntax highlights +from sphinx.highlighting import lexers +from pygments.lexers.web import PhpLexer + +lexers["php"] = PhpLexer(startinline=True, linenos=1) +lexers["php-annotations"] = PhpLexer(startinline=True, linenos=1) +primary_domain = "php" + diff --git a/docs/index.rst b/docs/index.rst index 77ee93f..272ca40 100644 --- a/docs/index.rst +++ b/docs/index.rst @@ -3,3 +3,24 @@ ==================== DotArray ==================== + +DotArray is a simple PHP Library that can access an array in a dotted manner. + +- Easy to use. +- Support to access complex keys that are having dot in the name. +- Fluent access. +- Possibility to search & filter items. +- Dot access can, also, works in the "old school" array way (Vanilla PHP). + +.. code-block:: php + + DotArray::create(['config' => ['some.dotted.key' => 'value']])->get('config.{some.dotted.key}') + +User Guide +========== + +.. toctree:: + :maxdepth: 2 + + overview + quickstart diff --git a/docs/overview.rst b/docs/overview.rst index 8b13789..3915814 100644 --- a/docs/overview.rst +++ b/docs/overview.rst @@ -1 +1,108 @@ +======== +Overview +======== +Requirements +============ + +#. PHP 7.1 + +.. _installation: + + +Installation +============ + +The recommended way to install DotArray is with +`Composer `_. Composer is a dependency management tool +for PHP that allows you to declare the dependencies your project needs and +installs them into your project. + +.. code-block:: bash + + # Install Composer + curl -sS https://getcomposer.org/installer | php + +You can add DotArray as a dependency using the composer.phar CLI: + +.. code-block:: bash + + php composer.phar require binary-cube/dot-array + +Alternatively, you can specify DotArray as a dependency in your project's +existing composer.json file: + +.. code-block:: js + + { + "require": { + "binary-cube/dot-array": "*" + } + } + +After installing, you need to require Composer's autoloader: + +.. code-block:: php + + require 'vendor/autoload.php'; + +You can find out more on how to install Composer, configure autoloading, and +other best-practices for defining dependencies at `getcomposer.org `_. + + +License +======= + +Licensed using the `MIT license `_. + + Copyright (c) 2018 Binary Cube + + Permission is hereby granted, free of charge, to any person obtaining a copy + of this software and associated documentation files (the "Software"), to deal + in the Software without restriction, including without limitation the rights + to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + copies of the Software, and to permit persons to whom the Software is + furnished to do so, subject to the following conditions: + + The above copyright notice and this permission notice shall be included in all + copies or substantial portions of the Software. + + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + SOFTWARE. + + +Bugs and feature requests +========================= + +Have a bug or a feature request? +Please first read the issue guidelines and search for existing and closed issues. +If your problem or idea is not addressed yet, `please open a new issue `_. + + +Contributing +============ + +All contributions are more than welcomed. +Contributions may close an issue, fix a bug (reported or not reported), add new design blocks, +improve the existing code, add new feature, and so on. +In the interest of fostering an open and welcoming environment, +we as contributors and maintainers pledge to making participation in our project and our community a harassment-free experience for everyone, +regardless of age, body size, disability, ethnicity, gender identity and expression, level of experience, nationality, +personal appearance, race, religion, or sexual identity and orientation. +`Read the full Code of Conduct `_. + + +Versioning +=========== + +Through the development of new versions, we're going use the `Semantic Versioning `_. + +Example: `1.0.0`. +- Major release: increment the first digit and reset middle and last digits to zero. Introduces major changes that might break backward compatibility. E.g. 2.0.0 +- Minor release: increment the middle digit and reset last digit to zero. It would fix bugs and also add new features without breaking backward compatibility. E.g. 1.1.0 +- Patch release: increment the third digit. It would fix bugs and keep backward compatibility. E.g. 1.0.1 From 36aaa13c5a5cc82ac2517530e9e4f4a76ee1d302 Mon Sep 17 00:00:00 2001 From: microThread Date: Thu, 20 Jun 2019 10:02:59 +0300 Subject: [PATCH 14/17] [*]: Sphinx added sphinxcontrib-phpdomain>=0.6.1 on requirements --- docs/requirements.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/docs/requirements.txt b/docs/requirements.txt index 57880fa..855d66c 100644 --- a/docs/requirements.txt +++ b/docs/requirements.txt @@ -1,2 +1,3 @@ Sphinx>=2.1.0 sphinx_rtd_theme>=0.4.0 +sphinxcontrib-phpdomain>=0.6.1 From 5059f0de9afdb3783c8afab7720342b778442bb8 Mon Sep 17 00:00:00 2001 From: microThread Date: Thu, 20 Jun 2019 18:50:02 +0300 Subject: [PATCH 15/17] Update index.rst --- docs/index.rst | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) diff --git a/docs/index.rst b/docs/index.rst index 272ca40..6e62723 100644 --- a/docs/index.rst +++ b/docs/index.rst @@ -4,6 +4,36 @@ DotArray ==================== +.. raw:: html + + + + + + + + + + + + + + + + + + + + + + + + + + + + + DotArray is a simple PHP Library that can access an array in a dotted manner. - Easy to use. From e9226970c9350681c8841178da4f80defd941a7f Mon Sep 17 00:00:00 2001 From: microThread Date: Thu, 20 Jun 2019 18:57:17 +0300 Subject: [PATCH 16/17] Update index.rst --- docs/index.rst | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/docs/index.rst b/docs/index.rst index 6e62723..d7fc8be 100644 --- a/docs/index.rst +++ b/docs/index.rst @@ -6,6 +6,10 @@ DotArray .. raw:: html + + + + @@ -34,6 +38,8 @@ DotArray +

+ DotArray is a simple PHP Library that can access an array in a dotted manner. - Easy to use. From 32da333bfc7f532d241a501a5dc18304d88052f5 Mon Sep 17 00:00:00 2001 From: microThread Date: Thu, 20 Jun 2019 18:58:47 +0300 Subject: [PATCH 17/17] Update index.rst --- docs/index.rst | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/docs/index.rst b/docs/index.rst index d7fc8be..662b240 100644 --- a/docs/index.rst +++ b/docs/index.rst @@ -6,35 +6,35 @@ DotArray .. raw:: html - + - + - + - + - + - + - + - +