Skip to content

Commit aee3d9e

Browse files
authored
Merge pull request #14 from byjg/5.0.0
Documentation Change
2 parents 9623098 + dcdc122 commit aee3d9e

File tree

4 files changed

+38
-40
lines changed

4 files changed

+38
-40
lines changed

.github/workflows/phpunit.yml

Lines changed: 9 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,6 @@ on:
88
pull_request:
99
branches:
1010
- master
11-
schedule:
12-
- cron: "0 8 * * 1"
1311

1412
jobs:
1513
Build:
@@ -18,25 +16,23 @@ jobs:
1816
strategy:
1917
matrix:
2018
php-version:
19+
- "8.2"
2120
- "8.1"
2221
- "8.0"
2322
- "7.4"
24-
- "7.3"
25-
- "7.2"
26-
- "7.1"
2723

2824
steps:
29-
- uses: actions/checkout@v2
25+
- uses: actions/checkout@v4
3026
- run: composer install
3127
- run: ./vendor/bin/phpunit
3228
- run: ./vendor/bin/psalm
3329

3430
Documentation:
35-
runs-on: 'ubuntu-latest'
36-
needs: Build
3731
if: github.ref == 'refs/heads/master'
38-
env:
39-
DOC_GITHUB_TOKEN: '${{ secrets.DOC_TOKEN }}'
40-
steps:
41-
- uses: actions/checkout@v2
42-
- run: curl https://opensource.byjg.com/add-doc.sh | bash /dev/stdin php anydataset
32+
needs: Build
33+
uses: byjg/byjg.github.io/.github/workflows/add-doc.yaml@master
34+
with:
35+
folder: php
36+
project: ${{ github.event.repository.name }}
37+
secrets: inherit
38+

README.md

Lines changed: 26 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
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

1212
Anydataset 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();
7373
while ($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
140140
namespace 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

composer.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,15 +9,15 @@
99
"prefer-stable": true,
1010
"minimum-stability": "dev",
1111
"require": {
12-
"php": ">=5.6.0",
12+
"php": ">=7.4",
1313
"byjg/xmlutil": "4.9.*",
1414
"byjg/serializer": "4.9.*"
1515
},
1616
"suggest": {
1717
"ext-dom": "*"
1818
},
1919
"require-dev": {
20-
"phpunit/phpunit": "5.7.*|7.4.*|^9.5",
20+
"phpunit/phpunit": "^9.6",
2121
"vimeo/psalm": "^4.24"
2222
},
2323
"license": "MIT"

src/IteratorFilterFormatter.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ abstract public function getRelation($name, $relation, $value, &$param);
2828
abstract public function format($filters, $tableName = null, &$params = [], $returnFields = "*");
2929

3030
/**
31-
* Get Filter
31+
* Get Filter
3232
*
3333
* @param array $filters
3434
* @param array $param

0 commit comments

Comments
 (0)