Skip to content

Commit

Permalink
Merge pull request #30 from ARCANEDEV/update-github_actions
Browse files Browse the repository at this point in the history
Using GitHub Actions for testing
  • Loading branch information
arcanedev-maroc authored Feb 19, 2020
2 parents c2c5eb5 + f306f8e commit 38d560f
Show file tree
Hide file tree
Showing 28 changed files with 1,022 additions and 903 deletions.
10 changes: 5 additions & 5 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
# This file is for unifying the coding style for different editors and IDEs
# editorconfig.org

root = true

[*]
end_of_line = lf
charset = utf-8
end_of_line = lf
insert_final_newline = true
indent_style = space
indent_size = 4
trim_trailing_whitespace = true
insert_final_newline = true

[*.md]
trim_trailing_whitespace = false

[*.{yml,yaml}]
indent_size = 2
1 change: 0 additions & 1 deletion .gitattributes
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,5 @@
.gitattributes export-ignore
.gitignore export-ignore
.scrutinizer.yml export-ignore
.travis.yml export-ignore
phpunit.xml.dist export-ignore
CONTRIBUTING.md export-ignore
46 changes: 46 additions & 0 deletions .github/workflows/run-tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
name: run-tests

on: [push]

jobs:
tests:
runs-on: ubuntu-latest

strategy:
fail-fast: true
matrix:
php: [7.2, 7.3, 7.4]
laravel: [6.*]
dependency-version: [prefer-lowest, prefer-stable]

name: PHP ${{ matrix.php }} - ${{ matrix.dependency-version }}

steps:
- name: Checkout code
uses: actions/checkout@v1

- name: Cache dependencies
uses: actions/cache@v1
with:
path: ~/.composer/cache/files
key: dependencies-laravel-${{ matrix.laravel }}-php-${{ matrix.php }}-composer-${{ hashFiles('composer.json') }}

- name: Setup PHP
uses: shivammathur/setup-php@v1
with:
php-version: ${{ matrix.php }}
extensions: curl, mbstring, zip, pcntl, pdo, sqlite, pdo_sqlite, iconv
coverage: xdebug

- name: Install dependencies
run: composer update --${{ matrix.dependency-version }} --prefer-dist --no-interaction --no-suggest

- name: Execute tests
run: |
mkdir -p build/logs
vendor/bin/phpunit --coverage-text --coverage-clover=coverage.clover
- name: Scrutinizer CI
run: |
wget https://scrutinizer-ci.com/ocular.phar
php ocular.phar code-coverage:upload --format=php-clover coverage.clover
2 changes: 1 addition & 1 deletion .scrutinizer.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ checks:
tools:
external_code_coverage:
timeout: 600
runs: 2
runs: 6
php_code_sniffer:
enabled: true
config:
Expand Down
25 changes: 0 additions & 25 deletions .travis.yml

This file was deleted.

2 changes: 1 addition & 1 deletion LICENSE.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
The MIT License (MIT)

Copyright (c) 2016-2019 ARCANEDEV - LaravelHtml
Copyright (c) 2016-2020 ARCANEDEV - LaravelHtml

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
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Laravel HTML & Forms [![Packagist License][badge_license]](LICENSE.md) [![For Laravel][badge_laravel]][link-github-repo]

[![Travis Status][badge_build]][link-travis]
[![Github Workflow Status][badge_build]][link-github-status]
[![Coverage Status][badge_coverage]][link-scrutinizer]
[![Scrutinizer Code Quality][badge_quality]][link-scrutinizer]
[![SensioLabs Insight][badge_insight]][link-insight]
Expand Down Expand Up @@ -48,7 +48,7 @@ If you discover any security related issues, please email arcanedev.maroc@gmail.

[badge_laravel]: https://img.shields.io/badge/Laravel-5.1%20to%206.x-orange.svg?style=flat-square
[badge_license]: https://img.shields.io/packagist/l/arcanedev/laravel-html.svg?style=flat-square
[badge_build]: https://img.shields.io/travis/ARCANEDEV/LaravelHtml.svg?style=flat-square
[badge_build]: https://img.shields.io/github/workflow/status/ARCANEDEV/LaravelHtml/run-tests?style=flat-square
[badge_coverage]: https://img.shields.io/scrutinizer/coverage/g/ARCANEDEV/LaravelHtml.svg?style=flat-square
[badge_quality]: https://img.shields.io/scrutinizer/g/ARCANEDEV/LaravelHtml.svg?style=flat-square
[badge_insight]: https://img.shields.io/sensiolabs/i/dfcc38f2-7302-4c01-90ff-2d6c21782682.svg?style=flat-square
Expand All @@ -59,9 +59,9 @@ If you discover any security related issues, please email arcanedev.maroc@gmail.

[link-author]: https://github.com/arcanedev-maroc
[link-github-repo]: https://github.com/ARCANEDEV/LaravelHtml
[link-github-status]: https://github.com/ARCANEDEV/LaravelHtml/actions
[link-github-issues]: https://github.com/ARCANEDEV/LaravelHtml/issues
[link-contributors]: https://github.com/ARCANEDEV/LaravelHtml/graphs/contributors
[link-packagist]: https://packagist.org/packages/arcanedev/laravel-html
[link-travis]: https://travis-ci.org/ARCANEDEV/LaravelHtml
[link-scrutinizer]: https://scrutinizer-ci.com/g/ARCANEDEV/LaravelHtml/?branch=master
[link-insight]: https://insight.sensiolabs.com/projects/dfcc38f2-7302-4c01-90ff-2d6c21782682
8 changes: 4 additions & 4 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,13 @@
"license": "MIT",
"require": {
"php": ">=7.2.0",
"arcanedev/php-html": "^3.0",
"arcanedev/support": "^5.0"
"arcanedev/php-html": "^3.1",
"arcanedev/support": "^5.1.1"
},
"require-dev": {
"ext-dom": "*",
"orchestra/testbench": "^4.0",
"mockery/mockery": "^1.0",
"orchestra/testbench": "^4.6",
"mockery/mockery": "^1.3.1",
"phpunit/phpcov": "^6.0",
"phpunit/phpunit": "^8.0"
},
Expand Down
24 changes: 10 additions & 14 deletions helpers.php
Original file line number Diff line number Diff line change
@@ -1,16 +1,17 @@
<?php

use Arcanedev\LaravelHtml\Contracts\FormBuilder;
use Arcanedev\LaravelHtml\Contracts\HtmlBuilder;
declare(strict_types=1);

use Arcanedev\LaravelHtml\Contracts\{FormBuilder, HtmlBuilder};
use Illuminate\Support\HtmlString;

if ( ! function_exists('form')) {
/**
* Get the Form Builder instance.
*
* @return \Arcanedev\LaravelHtml\Contracts\FormBuilder
*/
function form()
{
function form(): FormBuilder {
return app(FormBuilder::class);
}
}
Expand All @@ -21,8 +22,7 @@ function form()
*
* @return \Arcanedev\LaravelHtml\Contracts\HtmlBuilder
*/
function html()
{
function html(): HtmlBuilder {
return app(HtmlBuilder::class);
}
}
Expand All @@ -43,8 +43,7 @@ function html()
*
* @return \Illuminate\Support\HtmlString
*/
function link_to($url, $title = null, $attributes = [], $secure = null, $escaped = true)
{
function link_to(string $url, $title = null, array $attributes = [], $secure = null, $escaped = true): HtmlString {
return html()->link($url, $title, $attributes, $secure, $escaped);
}
}
Expand All @@ -60,8 +59,7 @@ function link_to($url, $title = null, $attributes = [], $secure = null, $escaped
*
* @return \Illuminate\Support\HtmlString
*/
function link_to_asset($url, $title = null, $attributes = [], $secure = null)
{
function link_to_asset(string $url, $title = null, array $attributes = [], $secure = null): HtmlString {
return html()->linkAsset($url, $title, $attributes, $secure);
}
}
Expand All @@ -78,8 +76,7 @@ function link_to_asset($url, $title = null, $attributes = [], $secure = null)
*
* @return \Illuminate\Support\HtmlString
*/
function link_to_route($name, $title = null, $params = [], $attributes = [], $escaped = true)
{
function link_to_route(string $name, $title = null, array $params = [], array $attributes = [], $escaped = true): HtmlString {
return html()->linkRoute($name, $title, $params, $attributes, $escaped);
}
}
Expand All @@ -96,8 +93,7 @@ function link_to_route($name, $title = null, $params = [], $attributes = [], $es
*
* @return \Illuminate\Support\HtmlString
*/
function link_to_action($action, $title = null, $params = [], $attributes = [], $escaped = true)
{
function link_to_action(string $action, $title = null, array $params = [], array $attributes = [], $escaped = true): HtmlString {
return html()->linkAction($action, $title, $params, $attributes, $escaped);
}
}
10 changes: 6 additions & 4 deletions src/AbstractBuilder.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
<?php namespace Arcanedev\LaravelHtml;
<?php

declare(strict_types=1);

namespace Arcanedev\LaravelHtml;

use Arcanedev\LaravelHtml\Traits\Componentable;
use BadMethodCallException;
Expand Down Expand Up @@ -43,9 +47,7 @@ public function __call($method, $parameters)
return $this->componentCall($method, $parameters);
}
catch (BadMethodCallException $e) {
// Continue
return $this->macroCall($method, $parameters);
}

return $this->macroCall($method, $parameters);
}
}
Loading

0 comments on commit 38d560f

Please sign in to comment.