Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
66 changes: 66 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
name: PHP Test and Coverage
on:
pull_request:
push:
branches:
- master

jobs:
test:
runs-on: ubuntu-latest
strategy:
matrix:
php: [ 8.3, 8.4 ]
include:
- php: 8.4
coverage: yes
steps:
- name: Checkout code
uses: actions/checkout@v3

- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php }}
extensions: mbstring, xml
coverage: ${{ matrix.coverage == 'yes' }}

- name: Cache dependencies
uses: actions/cache@v3
with:
path: ~/.composer/cache
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }}
restore-keys: ${{ runner.os }}-composer-

- name: Install dependencies
run: composer install --prefer-source

- name: Prepare test coverage (if applicable)
if: ${{ matrix.coverage == 'yes' }}
run: |
curl -L https://codeclimate.com/downloads/test-reporter/test-reporter-latest-linux-amd64 > ./cc-test-reporter
chmod +x ./cc-test-reporter
./cc-test-reporter before-build

- name: Run tests without coverage
if: ${{ matrix.coverage != 'yes' }}
run: composer test

- name: Run tests with coverage
if: ${{ matrix.coverage == 'yes' }}
run: composer testc
env:
XDEBUG_MODE: coverage

- name: Code checks
if: ${{ matrix.coverage == 'yes' }}
run: composer check-code
env:
XDEBUG_MODE: coverage
PHP_CS_FIXER_IGNORE_ENV: true

- name: Upload test coverage (if applicable)
if: ${{ matrix.coverage == 'yes' }}
run: ./cc-test-reporter after-build --coverage-input-type clover --exit-code 0
env:
CC_TEST_REPORTER_ID: ${{ secrets.CC_TEST_REPORTER_ID }}
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
vendor/
.idea
.php_cs.cache
.phpunit.cache
13 changes: 8 additions & 5 deletions .php_cs → .php-cs-fixer.php
Original file line number Diff line number Diff line change
@@ -1,8 +1,12 @@
<?php

declare(strict_types=1);

$finder = PhpCsFixer\Finder::create()
->exclude('vendor')
->in(__DIR__);
return PhpCsFixer\Config::create()

return (new PhpCsFixer\Config())
->setUsingCache(true)
->setRules([
'@PSR2' => true,
Expand All @@ -14,7 +18,7 @@
'indentation_type' => true,
'blank_line_after_namespace' => true,
'line_ending' => true,
'lowercase_constants' => true,
'constant_case' => ['case' => 'lower'], // Replaces lowercase_constants
'lowercase_keywords' => true,
'no_closing_tag' => true,
'single_line_after_imports' => true,
Expand All @@ -23,16 +27,15 @@
'whitespace_after_comma_in_array' => true,
'blank_line_after_opening_tag' => true,
'no_empty_statement' => true,
'no_extra_consecutive_blank_lines' => true,
'no_extra_blank_lines' => true, // Replaces no_extra_consecutive_blank_lines
'function_typehint_space' => true,
'no_leading_namespace_whitespace' => true,
'no_blank_lines_after_class_opening' => true,
'no_blank_lines_after_phpdoc' => true,
'phpdoc_scalar' => true,
'phpdoc_types' => true,
'no_leading_import_slash' => true,
'no_extra_consecutive_blank_lines' => ['use'],
'blank_line_before_return' => true,
'blank_line_before_statement' => ['statements' => ['return']], // Replaces blank_line_before_return
'self_accessor' => false,
'no_short_bool_cast' => true,
'no_trailing_comma_in_singleline_array' => true,
Expand Down
36 changes: 0 additions & 36 deletions .travis.yml

This file was deleted.

2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# PHP Functional
[![Build Status](https://travis-ci.org/widmogrod/php-functional.svg)](https://travis-ci.org/widmogrod/php-functional)
![Build Status](https://github.com/widmogrod/php-functional/actions/workflows/ci.yml/badge.svg)
[![Test Coverage](https://api.codeclimate.com/v1/badges/895bddc952aefca0d82a/test_coverage)](https://codeclimate.com/github/widmogrod/php-functional/test_coverage)
[![Maintainability](https://api.codeclimate.com/v1/badges/895bddc952aefca0d82a/maintainability)](https://codeclimate.com/github/widmogrod/php-functional/maintainability)
## Introduction
Expand Down
8 changes: 4 additions & 4 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,13 @@
"name": "widmogrod/php-functional",
"description": "Functors, Applicative and Monads are fascinating concept. Purpose of this library is to explore them in OOP PHP world.",
"require": {
"php": "^7.1|^8.0",
"php": ">=8.3",
"functional-php/fantasy-land": "^1"
},
"require-dev": {
"phpunit/phpunit": "^6",
"friendsofphp/php-cs-fixer": "^2",
"giorgiosironi/eris": "^0.9"
"phpunit/phpunit": "^11.5.1",
"friendsofphp/php-cs-fixer": "^v3.65.0",
"giorgiosironi/eris": "^1.0.0"
},
"license": "MIT",
"authors": [
Expand Down
Loading
Loading