11# AnyDataset
22
33[ ![ Opensource ByJG] ( https://img.shields.io/badge/opensource-byjg-success.svg )] ( http://opensource.byjg.com )
4- [ ![ Build Status] ( https://github.com/byjg/anydataset/actions/workflows/phpunit.yml/badge.svg?branch=master )] ( https://github.com/byjg/anydataset/actions/workflows/phpunit.yml )
4+ [ ![ Build Status] ( https://github.com/byjg/php- anydataset/actions/workflows/phpunit.yml/badge.svg?branch=master )] ( https://github.com/byjg/php- anydataset/actions/workflows/phpunit.yml )
55[ ![ Opensource ByJG] ( https://img.shields.io/badge/opensource-byjg-success.svg )] ( http://opensource.byjg.com )
6- [ ![ GitHub source] ( https://img.shields.io/badge/Github-source-informational?logo=github )] ( https://github.com/byjg/anydataset/ )
6+ [ ![ GitHub source] ( https://img.shields.io/badge/Github-source-informational?logo=github )] ( https://github.com/byjg/php- anydataset/ )
77[ ![ GitHub license] ( https://img.shields.io/github/license/byjg/anydataset.svg )] ( https://opensource.byjg.com/opensource/licensing.html )
8- [ ![ GitHub release] ( https://img.shields.io/github/release/byjg/anydataset.svg )] ( https://github.com/byjg/anydataset/releases/ )
9- [ ![ Scrutinizer Code Quality] ( https://scrutinizer-ci.com/g/byjg/anydataset/badges/quality-score.png?b=master )] ( https://scrutinizer-ci.com/g/byjg/anydataset/?branch=master )
10- [ ![ Code Coverage] ( https://scrutinizer-ci.com/g/byjg/anydataset/badges/coverage.png?b=master )] ( https://scrutinizer-ci.com/g/byjg/anydataset/?branch=master )
8+ [ ![ GitHub release] ( https://img.shields.io/github/release/byjg/anydataset.svg )] ( https://github.com/byjg/php- anydataset/releases/ )
9+ [ ![ Scrutinizer Code Quality] ( https://scrutinizer-ci.com/g/byjg/php- anydataset/badges/quality-score.png?b=master )] ( https://scrutinizer-ci.com/g/byjg/php- anydataset/?branch=master )
10+ [ ![ Code Coverage] ( https://scrutinizer-ci.com/g/byjg/php- anydataset/badges/coverage.png?b=master )] ( https://scrutinizer-ci.com/g/byjg/php- anydataset/?branch=master )
1111
1212Anydataset Core Module. Anydataset is an agnostic data source abstraction layer in PHP.
1313
@@ -21,18 +21,18 @@ Anydataset Core Module. Anydataset is an agnostic data source abstraction layer
2121
2222{:.table}
2323
24- | Object | Data Source | Read | Write | Reference |
25- | ---------------------- | --------------------- | :----:| :-----:| ----------------------- |
26- | DbDriverInterface | Relational DB | yes | yes | [ Github] ( https://github.com/byjg/anydataset-db ) |
27- | AnyDataSet | Anydataset | yes | yes | [ Github] ( https://github.com/byjg/anydataset ) |
28- | ArrayDataSet | Array | yes | no | [ Github] ( https://github.com/byjg/anydataset-array ) |
29- | TextFileDataSet | Delimited Fields | yes | no | [ Github] ( https://github.com/byjg/anydataset-text ) |
30- | FixedTextFileDataSet | Fixed Size fields | yes | no | [ Github] ( https://github.com/byjg/anydataset-text ) |
31- | XmlDataSet | Xml | yes | no | [ Github] ( https://github.com/byjg/anydataset-xml ) |
32- | JSONDataSet | Json | yes | no | [ Github] ( https://github.com/byjg/anydataset-json ) |
33- | SparQLDataSet | SparQl Repositories | yes | no | [ Github] ( https://github.com/byjg/anydataset-sparql ) |
34- | NoSqlDocumentInterface | NoSql Document Based | yes | yes | [ Github] ( https://github.com/byjg/anydataset-nosql ) |
35- | KeyValueInterface | NoSql Key/Value Based | yes | yes | [ Github] ( https://github.com/byjg/anydataset-nosql ) |
24+ | Object | Data Source | Read | Write | Reference |
25+ | ------------------------ | ----------------------- | :----:| :-----:| ----------------------------------------------------- |
26+ | DbDriverInterface | Relational DB | yes | yes | [ Github] ( https://github.com/byjg/anydataset-db ) |
27+ | AnyDataSet | Anydataset | yes | yes | [ Github] ( https://github.com/byjg/anydataset ) |
28+ | ArrayDataSet | Array | yes | no | [ Github] ( https://github.com/byjg/anydataset-array ) |
29+ | TextFileDataSet | Delimited Fields | yes | no | [ Github] ( https://github.com/byjg/anydataset-text ) |
30+ | FixedTextFileDataSet | Fixed Size fields | yes | no | [ Github] ( https://github.com/byjg/anydataset-text ) |
31+ | XmlDataSet | Xml | yes | no | [ Github] ( https://github.com/byjg/anydataset-xml ) |
32+ | JSONDataSet | Json | yes | no | [ Github] ( https://github.com/byjg/anydataset-json ) |
33+ | SparQLDataSet | SparQl Repositories | yes | no | [ Github] ( https://github.com/byjg/anydataset-sparql ) |
34+ | NoSqlDocumentInterface | NoSql Document Based | yes | yes | [ Github] ( https://github.com/byjg/anydataset-nosql ) |
35+ | KeyValueInterface | NoSql Key/Value Based | yes | yes | [ Github] ( https://github.com/byjg/anydataset-nosql ) |
3636
3737## Examples
3838
@@ -72,7 +72,7 @@ print_r($iterator->toArray());
7272$iterator = $dataset->getIterator();
7373while ($iterator->hasNext()) {
7474 $row = $iterator->moveNext();
75-
75+
7676 print_r($row->get("field1"));
7777}
7878```
@@ -97,7 +97,7 @@ $output = RowOutput::getInstance()
9797 ->addFormat("field1", "Test {field1}")
9898 ->addFormat("field2", "Showing {} and {field3}");
9999 ->addCustomFormat("field3", function ($row, $field, $value) {
100- // return the formatted output.
100+ // return the formatted output.
101101 // $row: The row object with all values
102102 // $field: The field has been processed
103103 // $value: The field value
@@ -126,10 +126,10 @@ $validator = RowValidator::getInstance()
126126 ->regexValidation("field4", '/\d{4}-\d{2}-\d{2}/')
127127 ->customValidation("field3", function($value) {
128128 // Return any string containing the error message if validation FAILS
129- // otherwise, just return null and the valition will pass.
129+ // otherwise, just return null and the valition will pass.
130130 });
131131
132- $validator->validate($row) // Will return an array with the error messages. Empty array if not errors.
132+ $validator->validate($row) // Will return an array with the error messages. Empty array if not errors.
133133```
134134
135135## Formatters
@@ -139,7 +139,7 @@ AnyDataset comes with an extensible set to format the AnyDataset. The interface
139139``` php
140140namespace ByJG\AnyDataset\Core\Formatter;
141141
142- interface FormatterInterface
142+ interface FormatterInterface
143143{
144144 /**
145145 * Return the object in your original format, normally as object
@@ -177,12 +177,14 @@ Example:
177177$formatter = new XmlFormatter($anydataset->getIterator());
178178$formatter->raw(); // Return a DOM object
179179$formatter->toText(); // Return the XML as a text
180- $formatter->saveToFile("/path/to/file.xml"); // Save the XML Text to a file.
180+ $formatter->saveToFile("/path/to/file.xml"); // Save the XML Text to a file.
181181```
182182
183183## Install
184184
185- Just type: ` composer require "byjg/anydataset=4.1.*" `
185+ ``` bash
186+ composer require " byjg/anydataset"
187+ ```
186188
187189## Running Unit tests
188190
0 commit comments