Skip to content

Commit

Permalink
The library now fully supports PHP 8.0 and min PHP version now bumped…
Browse files Browse the repository at this point in the history
… to PHP 7.3+,. Updated docblocks where was previously using my previous GitHub username. phpunit test cases and xml manifest now fully compatible with PHPUnit 9. README file explains how to install older versions of this lib to support older PHP versions. CI is now using GitHub Actions instead of TravisCI.
  • Loading branch information
allebb committed Dec 23, 2020
1 parent 065c6dd commit e9069eb
Show file tree
Hide file tree
Showing 11 changed files with 1,369 additions and 419 deletions.
69 changes: 69 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
name: build

on: [ push, pull_request ]

jobs:
build-test:
name: Collection (PHP ${{ matrix.php-versions }})
runs-on: ubuntu-latest

strategy:
fail-fast: false
matrix:
php-versions: [ '7.3', '7.4', '8.0' ]

steps:
- name: Checkout
uses: actions/checkout@v2

- name: Setup PHP, with composer and extensions
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php-versions }}
coverage: xdebug

- name: Get composer cache directory
id: composer-cache
run: echo "::set-output name=dir::$(composer config cache-files-dir)"

#- name: Cache composer dependencies
# uses: actions/cache@v2
# with:
# path: ${{ steps.composer-cache.outputs.dir }}
# # Use composer.json for key, if composer.lock is not committed.
# # key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.json') }}
# key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }}
# restore-keys: ${{ runner.os }}-composer-

- name: Install Composer dependencies
run: composer install --no-progress --prefer-dist --optimize-autoloader

#- name: PHPUnit Tests
# uses: php-actions/phpunit@v1
# with:
# bootstrap: vendor/autoload.php
# configuration: phpunit.xml
# args: --coverage-text
# memory_limit: 256M

- name: PHPUnit Tests
run: vendor/bin/phpunit --coverage-clover=coverage.xml

- name: Upload code coverage to Codecov
uses: codecov/codecov-action@v1
with:
token: ${{ secrets.CODECOV_TOKEN }}
file: ./coverage.xml
flags: tests
name: codedev-umbrella
yml: ./codedev.yml
fail_ci_if_error: true

# For code coverage report we are uploading our code coverage report to scrutinizer
- name: Downloading scrutinizer ocular.phar
run: wget https://scrutinizer-ci.com/ocular.phar

# Uploading reports for analysis
- name: Uploading code coverage to scrutinize
continue-on-error: true
run: php ocular.phar code-coverage:upload --format=php-clover coverage.xml
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,5 @@
/report
composer.phar
.DS_Store
Thumbs.db
Thumbs.db
.phpunit.result.cache
26 changes: 0 additions & 26 deletions .travis.yml

This file was deleted.

31 changes: 14 additions & 17 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
# Collection

[![Build Status](https://travis-ci.org/allebb/collection.svg)](https://travis-ci.org/allebb/collection)
[![Code Coverage](https://scrutinizer-ci.com/g/allebb/collection/badges/coverage.png?b=master)](https://scrutinizer-ci.com/g/allebb/collection/?branch=master)
[![Build](https://github.com/allebb/collection/workflows/build/badge.svg)](https://github.com/allebb/collection/actions)
[![Code Coverage](https://codecov.io/gh/allebb/collection/branch/master/graph/badge.svg)](https://codecov.io/gh/allebb/collection)
[![Scrutinizer Code Quality](https://scrutinizer-ci.com/g/allebb/collection/badges/quality-score.png?b=master)](https://scrutinizer-ci.com/g/allebb/collection/?branch=master)
[![Code Climate](https://codeclimate.com/github/allebb/collection/badges/gpa.svg)](https://codeclimate.com/github/allebb/collection)
[![Latest Stable Version](https://poser.pugx.org/ballen/collection/v/stable)](https://packagist.org/packages/ballen/collection)
Expand All @@ -15,9 +14,11 @@ This library is developed and maintained by myself for various personal projects
Requirements
------------

This library is developed and tested for PHP 5.6+
This library is developed and tested for PHP 7.3+

This library is unit tested against PHP 7.3, 7.4 and 8.0!

This library is unit tested against PHP 5.6, 7.0, 7.1, 7.2, 7.3 and 7.4!
If you need to use an older version of PHP, you should instead install the 1.x version of this library (see below for details).

License
-------
Expand All @@ -27,21 +28,17 @@ This client library is released under the MIT license, a [copy of the license](h
Setup
-----

To install the package into your project (assuming you are using the Composer package manager) you can simply execute the following command from your terminal in the root of your project folder:

```composer require ballen/collection```

Alternatively you can manually add this library to your project using the following steps, simply edit your project's composer.json file and add the following lines (or update your existing require section with the library like so):
To install the latest version of this package into your project (assuming you are using the Composer package manager) you can simply execute the following command from your terminal in the root of your project folder:

```json
"require": {
"ballen/collection": "^1.0"
}
```shell
composer require ballen/collection
```

Then install the package like so:
**If you need to use an older version of PHP, version 1.x.x supports PHP 5.6, 7.0, 7.1 and 7.2, you can install this version using Composer with this command instead:**

```composer install --no-dev```
```shell
composer require ballen/collection ^1.0
```

Usage
-----
Expand All @@ -62,7 +59,7 @@ Tests and coverage

This library is fully unit tested using [PHPUnit](https://phpunit.de/).

I use [TravisCI](https://travis-ci.org/) for continuous integration, which triggers unit tests each time a commit is pushed.
I use [GitHub Actions](https://github.com/) for continuous integration, which triggers unit tests each time a commit is pushed.

If you wish to run the tests yourself you should run the following:

Expand Down
51 changes: 28 additions & 23 deletions composer.json
Original file line number Diff line number Diff line change
@@ -1,26 +1,31 @@
{
"name": "ballen/collection",
"description": "A Collection library which provides OOP replacement for the traditional array data structure.",
"type": "library",
"keywords": ["collection", "list", "array"],
"license": "MIT",
"authors": [
{
"name": "Bobby Allen",
"email": "[email protected]",
"homepage": "http://bobbyallen.me",
"role": "Developer"
}
],
"require": {
"php": ">=5.3.0"
},
"require-dev": {
"phpunit/phpunit": "4.8.*"
},
"autoload": {
"psr-4": {
"Ballen\\Collection\\": "lib/"
}
"name": "ballen/collection",
"description": "A Collection library which provides OOP replacement for the traditional array data structure.",
"type": "library",
"keywords": [
"collection",
"list",
"array"
],
"license": "MIT",
"authors": [
{
"name": "Bobby Allen",
"email": "[email protected]",
"homepage": "http://bobbyallen.me",
"role": "Developer"
}
],
"require": {
"php": ">=7.3.0",
"ext-json": "*"
},
"require-dev": {
"phpunit/phpunit": "^9.0"
},
"autoload": {
"psr-4": {
"Ballen\\Collection\\": "lib/"
}
}
}
Loading

0 comments on commit e9069eb

Please sign in to comment.