Skip to content

Commit

Permalink
Create basic array/object functionality
Browse files Browse the repository at this point in the history
  • Loading branch information
shadowhand committed Nov 3, 2023
1 parent cb66aca commit 3383e44
Show file tree
Hide file tree
Showing 15 changed files with 3,472 additions and 7 deletions.
66 changes: 66 additions & 0 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
name: CI

on:
pull_request:
push:
branches: [ main ]

jobs:
run:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
php:
- '8.2'
- '8.3'
minimum_versions: [false]
coverage: ['none']
include:
- description: 'Minimum version'
php: '8.2'
minimum_versions: true
- description: 'Log Code Coverage'
php: '8.2'
coverage: 'pcov'

name: PHP ${{ matrix.php }} ${{ matrix.description }}
steps:
- name: Checkout
uses: actions/checkout@v4

- uses: actions/cache@v3
with:
path: ~/.composer/cache/files
key: ${{ matrix.php }}

- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php }}
coverage: ${{ matrix.coverage }}

- name: Install dependencies
run: composer install
if: matrix.minimum_versions == false

- name: Install dependencies lower
run: composer update --no-interaction --prefer-lowest
if: matrix.minimum_versions == true

- name: Run PHPUnit tests
run: vendor/bin/phpunit --no-coverage
if: matrix.coverage == 'none'

- name: PHPUnit tests and Log Code coverage
run: vendor/bin/phpunit
if: matrix.coverage == 'pcov'

- name: Upload coverage reports to Codecov
uses: codecov/codecov-action@v4-beta
if: matrix.coverage == 'pcov'
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
with:
file: build/coverage.xml
fail_ci_if_error: true
25 changes: 25 additions & 0 deletions .github/workflows/static-analysis.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
name: Code style

on:
pull_request:
push:
branches: [ master ]

jobs:
php-cs-fixer:
name: PHP-CodeSniffer
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2

- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: '7.4'

- name: Install dependencies
run: composer install

- name: Run script
run: composer run check
8 changes: 4 additions & 4 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
.phpcs-cache
.phpunit.cache
composer.lock
composer.phar
/build/
/vendor/

# Commit your application's lock file https://getcomposer.org/doc/01-basic-usage.md#commit-your-composer-lock-file-to-version-control
# You may choose to ignore a library lock file http://getcomposer.org/doc/02-libraries.md#lock-file
# composer.lock
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
MIT License

Copyright (c) 2023 focusphp
Copyright (c) 2023 Woody Gilk <woody@shadowhand.com>

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
5 changes: 3 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
# data
A collection of tools for working with unstructured data, such as JSON
# focus/data

A collection of tools for working with unstructured data, such as JSON.
53 changes: 53 additions & 0 deletions composer.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
{
"name": "focus/data",
"description": "A collection of tools for working with unstructured data, such as JSON.",
"license": "MIT",
"type": "library",
"authors": [
{
"name": "Woody Gilk",
"email": "woody@shadowhand.com"
}
],
"require": {
"php": "^8.2",
"mtdowling/jmespath.php": "^2.7",
"psr/http-message": "^2.0"
},
"require-dev": {
"doctrine/coding-standard": "^12.0",
"ergebnis/composer-normalize": "^2.39",
"phpunit/phpunit": "^10.4"
},
"minimum-stability": "stable",
"autoload": {
"psr-4": {
"Focus\\Data\\": "src/"
}
},
"autoload-dev": {
"psr-4": {
"Focus\\Data\\Tests\\": "tests/"
}
},
"config": {
"allow-plugins": {
"dealerdirect/phpcodesniffer-composer-installer": true,
"ergebnis/composer-normalize": true
},
"sort-packages": true
},
"scripts": {
"check": "phpcs",
"test": "phpunit"
},
"tags": [
"json",
"data",
"dot",
"notation",
"path",
"array",
"object"
]
}
Loading

0 comments on commit 3383e44

Please sign in to comment.