Skip to content

Commit

Permalink
Prepare for 2.0.0
Browse files Browse the repository at this point in the history
  • Loading branch information
oanhnn committed Jul 14, 2020
1 parent 68e1810 commit a90c0eb
Show file tree
Hide file tree
Showing 21 changed files with 324 additions and 137 deletions.
103 changes: 103 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,103 @@
name: CI

on:
push:
branches:
- 'master'
- 'develop'
- 'releases/*'
tags:
- '*'
pull_request:
branches:
- 'master'

jobs:
# check-sercurity:
# name: '[PHP] Check security'
# runs-on: ubuntu-latest
# steps:
# - name: Checkout
# uses: actions/checkout@v2
# with:
# fetch-depth: 1
# - name: Setting up PHP
# uses: shivammathur/setup-php@v2
# with:
# php-version: 7.4
# extensions: curl, json
# tools: symfony
# - name: Run check security
# run: symfony security:check

check-coding-style:
name: '[PHP] Check coding style'
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
with:
fetch-depth: 1
- name: Setting up PHP
uses: shivammathur/setup-php@v2
with:
php-version: 7.4
tools: phpcs
- name: Check coding style
run: phpcs --standard=phpcs.xml.dist

run-test:
name: '[PHP] Test PHP${{ matrix.php }} - Laravel v${{ matrix.LARAVEL }} ${{ matrix.COMPOSER_ARGS }}'
strategy:
matrix:
php:
- 7.2
- 7.3
- 7.4
LARAVEL:
- 7.*
COMPOSER_ARGS:
- --prefer-lowest
- --prefer-stable
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
with:
fetch-depth: 1
- name: Setting up PHP
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php }}
extensions: curl, dom, json, mbstring, openssl
coverage: pcov
ini-values: pcov.directory=src
tools: composer
- name: Check PHP
run: |
php -v
php -m
composer -v
- name: Get Composer Cache Directory
id: composer-cache
run: echo "::set-output name=dir::$(composer config cache-files-dir)"
- name: Cache dependencies
uses: actions/cache@v1
with:
path: ${{ steps.composer-cache.outputs.dir }}
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.json') }}
restore-keys: ${{ runner.os }}-composer-
- name: Install composer dependencies
run: |
composer require --no-interaction --no-update "illuminate/support:${{ matrix.LARAVEL }}"
composer update --no-interaction --no-suggest --prefer-dist ${{ matrix.COMPOSER_ARGS }}
- name: Run PHPUnit
run: php -d pcov.enabled=1 vendor/bin/phpunit --coverage-clover=build/logs/clover.xml
- name: Update test coverage
if: matrix.php == '7.4' && matrix.LARAVEL == '7.*' && contains(matrix.COMPOSER_ARGS, 'stable')
env:
COVERALLS_RUN_LOCALLY: 1
COVERALLS_REPO_TOKEN: ${{ secrets.COVERALLS_REPO_TOKEN }}
run: |
composer require php-coveralls/php-coveralls
php vendor/bin/php-coveralls --coverage_clover=build/logs/clover.xml -v
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ composer.lock
phpunit.xml
phpcs.xml
vendor
build
storage
*.log
.phpunit.result.cache
Expand Down
74 changes: 0 additions & 74 deletions .travis.yml

This file was deleted.

17 changes: 17 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,22 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.



## [2.0.0] - 2020-07-14

### Added
- Support Laravel 7.0+
- Chain driver

### Changed
- Bump php to require 7.2+ and Larave to require 7.0+
- Using Github Workflow instead of TravisCI

### Removed
- Support Laravel 5.x and 6.x




## [1.0.0] - 2019-11-11

### Added
Expand All @@ -50,3 +66,4 @@ First release

[Unreleased]: https://github.com/oanhnn/laravel-fakeid/compare/v1.0.0...develop
[1.0.0]: https://github.com/oanhnn/laravel-fakeid/compare/v0.1.0...v1.0.0
[1.0.0]: https://github.com/oanhnn/laravel-fakeid/compare/v1.0.0...v2.0.0
20 changes: 11 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,20 +1,20 @@
# Laravel FakeID

[![Latest Version](https://img.shields.io/packagist/v/oanhnn/laravel-fakeid.svg)](https://packagist.org/packages/oanhnn/laravel-fakeid)
[![Software License](https://img.shields.io/github/license/oanhnn/laravel-fakeid.svg)](LICENSE)
[![Build Status](https://img.shields.io/travis/oanhnn/laravel-fakeid/master.svg)](https://travis-ci.org/oanhnn/laravel-fakeid)
[![Coverage Status](https://img.shields.io/coveralls/github/oanhnn/laravel-fakeid/master.svg)](https://coveralls.io/github/oanhnn/laravel-fakeid?branch=master)
[![Build Status](https://github.com/oanhnn/laravel-fakeid/workflows/CI/badge.svg)](https://github.com/oanhnn/laravel-fakeid/actions)
[![Coverage Status](https://img.shields.io/coveralls/github/oanhnn/laravel-fakeid/master.svg)](https://coveralls.io/github/oanhnn/laravel-fakeid)
[![Latest Version](https://img.shields.io/packagist/v/oanhnn/laravel-fakeid.svg?label=latest%20version)](https://packagist.org/packages/oanhnn/laravel-fakeid)
[![Total Downloads](https://img.shields.io/packagist/dt/oanhnn/laravel-fakeid.svg)](https://packagist.org/packages/oanhnn/laravel-fakeid)
[![Requires PHP](https://img.shields.io/travis/php-v/oanhnn/laravel-fakeid.svg)](https://travis-ci.org/oanhnn/laravel-fakeid)
[![Requires PHP](https://img.shields.io/packagist/php-v/oanhnn/laravel-fakeid.svg)](https://packagist.org/packages/oanhnn/laravel-fakeid)
[![Software License](https://img.shields.io/github/license/oanhnn/laravel-fakeid.svg)](LICENSE)

Easy fake model ID on URL Laravel 5.5+ Application.
Easy fake model ID on URL Laravel Application.

## Requirements

* php >=7.1.3
* Laravel 5.5+
* php >=7.2
* Laravel 7.0+

> Laravel 6.0+ requires php 7.2+
> Laravel 5.5+ using version 1.x (require php 7.1.3+)
## Installation

Expand Down Expand Up @@ -101,6 +101,8 @@ class MyModel extends Model implements ShouldFakeId
> | hashids | int[] | string | int[] |
> | hex | string | string | string |
> | optimus | int | int | int |
> | prefix | string | string | string |
> | chain | string | string | string |
### Custom driver

Expand Down
17 changes: 11 additions & 6 deletions composer.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "oanhnn/laravel-fakeid",
"type": "library",
"description": "Using fake id on URL in Laravel 5.5+ application",
"description": "Using fake id on URL in Laravel application",
"keywords": [
"laravel",
"package",
Expand All @@ -25,16 +25,21 @@
"Laravel\\FakeId\\": "src/"
}
},
"autoload-dev": {
"psr-4": {
"Tests\\": "tests/"
}
},
"require": {
"php": "^7.1.3",
"illuminate/support": "^5.5|^6.0"
"php": "^7.2.5",
"illuminate/support": "^7.0"
},
"require-dev": {
"hashids/hashids": "^3.0|^4.0",
"jenssegers/optimus": "^1.0",
"orchestra/testbench": "^3.5|^4.0",
"phpunit/phpunit": "^6.3|^7.0|^8.0",
"squizlabs/php_codesniffer": "^3.2"
"orchestra/testbench": "^5.0",
"phpunit/phpunit": "^8.0|^9.0",
"squizlabs/php_codesniffer": "^3.5"
},
"suggest": {
"hashids/hashids": "For using hashids driver (version >= 3.0)",
Expand Down
6 changes: 0 additions & 6 deletions phpcs.xml.dist
Original file line number Diff line number Diff line change
Expand Up @@ -32,13 +32,7 @@
</properties>
</rule>

<rule ref="PSR1.Classes.ClassDeclaration">
<exclude-pattern>tests/bootstrap.php</exclude-pattern>
</rule>

<!-- Paths to check -->
<file>src</file>
<file>tests</file>

<!-- <exclude-pattern>tests/bootstrap.php</exclude-pattern> -->
</ruleset>
2 changes: 1 addition & 1 deletion phpunit.xml.dist
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
xsi:noNamespaceSchemaLocation="vendor/phpunit/phpunit/phpunit.xsd"
backupGlobals="false"
backupStaticAttributes="false"
bootstrap="tests/bootstrap.php"
bootstrap="vendor/autoload.php"
colors="true"
convertErrorsToExceptions="true"
convertNoticesToExceptions="true"
Expand Down
4 changes: 2 additions & 2 deletions src/Drivers/Base64Driver.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ class Base64Driver implements Driver
*/
public function encode($data)
{
return strtr(base64_encode($data), ['+' => '-', '/' => '_', '=' => '']);
return \strtr(\base64_encode($data), ['+' => '-', '/' => '_', '=' => '']);
}

/**
Expand All @@ -32,6 +32,6 @@ public function encode($data)
*/
public function decode($data)
{
return base64_decode(strtr($data, ['-' => '+', '_' => '/']), false);
return \base64_decode(\strtr($data, ['-' => '+', '_' => '/']), false);
}
}

0 comments on commit a90c0eb

Please sign in to comment.