Skip to content

Commit

Permalink
added supporting of 8.0, 8.1
Browse files Browse the repository at this point in the history
  • Loading branch information
bupy7 committed Jan 30, 2022
1 parent ea48432 commit 82fdde1
Show file tree
Hide file tree
Showing 20 changed files with 205 additions and 128 deletions.
5 changes: 0 additions & 5 deletions .gitattributes

This file was deleted.

56 changes: 56 additions & 0 deletions .github/workflows/build.yml
@@ -0,0 +1,56 @@
name: Build
on:
push:
branches: [master]
pull_request:
branches: [master]

jobs:
testing:
name: PHP ${{ matrix.php }}
runs-on: ubuntu-latest
strategy:
matrix:
php:
- 5.6
- 7.0
- 7.1
- 7.2
- 7.3
- 7.4
- 8.0
- 8.1
steps:
- uses: actions/checkout@v2

- name: Install PHP
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php }}
ini-values: date.timezone='UTC'
extensions: xmlwriter
tools: composer:v2

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

- name: Cache Composer packages
uses: actions/cache@v2
with:
path: ${{ steps.composer-cache.outputs.dir }}
key: php${{ matrix.php }}-composer-${{ hashFiles('**/composer.json') }}
restore-keys: php${{ matrix.php }}-composer-

- name: Install dependencies
run: composer install --no-plugins

- name: Run test suite
run: XDEBUG_MODE=coverage ./vendor/bin/phpunit

- name: Upload coverage results to Coveralls
env:
COVERALLS_REPO_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
composer global require php-coveralls/php-coveralls
php-coveralls --coverage_clover=build/logs/clover.xml -v
4 changes: 3 additions & 1 deletion .gitignore
Expand Up @@ -6,4 +6,6 @@
/logs
/phpunit.xml.dist
/.idea
/.php_cs.cache
/.php-cs-fixer.cache
/docker-compose.yml
/.phpunit.result.cache
17 changes: 0 additions & 17 deletions .travis.yml

This file was deleted.

5 changes: 5 additions & 0 deletions CHANGELOG.md
Expand Up @@ -9,6 +9,11 @@ php-html-form
- *Dep*: Deprecated.
- *Fix*: Fixed.

2.0.1 [2022-01-30]
------------------

- Add: Support PHP 8.0, 8.1.

2.0.0 [2020-02-11]
------------------

Expand Down
27 changes: 0 additions & 27 deletions Dockerfile

This file was deleted.

2 changes: 1 addition & 1 deletion LICENSE.md
Expand Up @@ -2,7 +2,7 @@ The MIT License (MIT)

Copyright (c) 2016 Adam Wathan <adam.wathan@gmail.com>

Copyright (c) 2017 Vasily Belosloodcev <bupy765@gmail.com>
Copyright (c) 2022 Vasily Belosloodcev <vasily.belosloodcev@gmail.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
65 changes: 32 additions & 33 deletions README.md
@@ -1,16 +1,15 @@
Form
====
php-html-form
===

This is fork of [adamwathan/form](https://github.com/adamwathan/form). There is only HTML-elements builder
without any support frameworks. Extension are supporting PHP from 5.6 to 7.x!
This is fork of [adamwathan/form](https://github.com/adamwathan/form). There is just HTML-elements builder
without any framework support. Extension are supporting PHP from 5.6 to 8.x!


[![Latest Stable Version](https://poser.pugx.org/bupy7/php-html-form/v/stable)](https://packagist.org/packages/bupy7/php-html-form)
[![Stable Version](https://poser.pugx.org/bupy7/php-html-form/v/stable)](https://packagist.org/packages/bupy7/php-html-form)
[![Build status](https://github.com/bupy7/php-html-form/actions/workflows/build.yml/badge.svg)](https://github.com/bupy7/php-html-form/actions/workflows/build.yml)
[![Coverage Status](https://coveralls.io/repos/github/bupy7/php-html-form/badge.svg?branch=master)](https://coveralls.io/github/bupy7/php-html-form?branch=master)
[![Total Downloads](https://poser.pugx.org/bupy7/php-html-form/downloads)](https://packagist.org/packages/bupy7/php-html-form)
[![Latest Unstable Version](https://poser.pugx.org/bupy7/php-html-form/v/unstable)](https://packagist.org/packages/bupy7/php-html-form)
[![License](https://poser.pugx.org/bupy7/php-html-form/license)](https://packagist.org/packages/bupy7/php-html-form)
[![Build Status](https://travis-ci.org/bupy7/php-html-form.svg?branch=master)](https://travis-ci.org/bupy7/php-html-form)
[![Coverage Status](https://coveralls.io/repos/bupy7/php-html-form/badge.svg?branch=master&service=github)](https://coveralls.io/github/bupy7/php-html-form?branch=master)

Boring name for a boring package. Builds form HTML with a fluent-ish, hopefully intuitive syntax.

Expand All @@ -21,7 +20,7 @@ Boring name for a boring package. Builds form HTML with a fluent-ish, hopefully
- [Data Binding](#data-binding)

Installation
------------
---

You can install this package via Composer by running this command in your terminal in the root of your
project:
Expand All @@ -31,7 +30,7 @@ $ composer require bupy7/php-html-form
```

Basic Usage
-----------
---

- [Getting Started](#getting-started)
- [Opening a Form](#opening-a-form)
Expand All @@ -45,7 +44,7 @@ Basic Usage
- [Setting Attributes](#setting-attributes)

Getting Started
---------------
---

First, instantiate a FormBuilder...

Expand All @@ -64,7 +63,7 @@ Next, use the FormBuilder to build an element. For example:


Opening a Form
--------------
---

```php
// <form method="POST">
Expand Down Expand Up @@ -92,7 +91,7 @@ Opening a Form
```

Text and Password Fields
------------------------
---

Text and password fields share the same interface.

Expand All @@ -119,7 +118,7 @@ Other available methods:
- `enable()`

Textareas
---------
---

Textareas share the same interface as regular text fields, with a couple of extra useful methods.

Expand All @@ -135,7 +134,7 @@ Textareas share the same interface as regular text fields, with a couple of extr
```

Checkboxes and Radio Buttons
----------------------------
---

```php
// <input type="checkbox" name="terms" value="1">
Expand All @@ -158,7 +157,7 @@ Checkboxes and Radio Buttons
```

Selects
-------
---

```php
// <select name="birth_year"></select>
Expand Down Expand Up @@ -215,7 +214,7 @@ $options = [
```

Buttons
-------
---

```php
// <button type="button">Click Me</button>
Expand All @@ -232,15 +231,15 @@ Buttons
```

Hidden Inputs
-------------
---

```php
// <input type="hidden" name="secret" value="my-secret-value">
<?= $builder->hidden('secret')->value('my-secret-value'); ?>
```

Labels
------
---

**Basic Label**
```php
Expand All @@ -261,7 +260,7 @@ Labels
```

Setting Attributes
------------------
---

```php
// Attributes can be set with attribute(...)
Expand All @@ -282,7 +281,7 @@ Setting Attributes
```

Error Messages
--------------
---

FormBuilder also allows you to easily retrieve error messages for your form elements. To do so, just
implement the `ErrorStoreInterface` and pass it to the FormBuilder:
Expand Down Expand Up @@ -321,7 +320,7 @@ token to your form easily like so:
```
Data Binding
------------
---
Sometimes you might have a form where all of the fields match properties on some sort of object or array
in your system, and you want the user to be able to edit that data. Data binding makes this really easy by
Expand All @@ -343,24 +342,24 @@ $model->email = "john@example.com";
> Note: Be sure to `bind` before creating any other form elements.
Run tests
---------
Testing
---
**Using Docker:**
Run tests:
```bash
$ docker-compose up -d
$ docker-compose exec php sh
$ composer test:run
```
$ ./vendor/bin/phpunit --no-coverage
```
**Any another way:**
Run tests with coverage:
```bash
$ composer test:run
```
$ XDEBUG_MODE=coverage ./vendor/bin/phpunit
```
HTML coverage path: `build/coverage/index.html`
License
-------
---
php-html-form is released under the [MIT License](LICENSE.md).
11 changes: 3 additions & 8 deletions composer.json
Expand Up @@ -11,16 +11,13 @@
"email": "vasily.belosloodcev@gmail.com"
}
],
"version": "2.0.0",
"license": "MIT",
"require": {
"php": ">=5.6"
},
"require-dev": {
"mockery/mockery": "^1.3.1",
"php-coveralls/php-coveralls": "^2.2.0",
"phpunit/phpunit": ">=5.5 <6.0.0",
"friendsofphp/php-cs-fixer": "^2.16.1"
"mockery/mockery": ">=1.3.5",
"phpunit/phpunit": ">=5.7.27"
},
"autoload": {
"psr-0": {
Expand All @@ -31,8 +28,6 @@
"classmap": ["tests/"]
},
"scripts": {
"test:run": "./vendor/bin/phpunit --no-coverage",
"test:run-with-cov": "./vendor/bin/phpunit",
"cs:fix": "./vendor/bin/php-cs-fixer fix --config=./phpcs.php"
"cs:fix": "php-cs-fixer fix --config=./phpcs.php --verbose"
}
}
14 changes: 0 additions & 14 deletions docker-compose.yml

This file was deleted.

21 changes: 13 additions & 8 deletions phpcs.php
@@ -1,5 +1,7 @@
<?php

declare(strict_types=1);

use PhpCsFixer\Finder;
use PhpCsFixer\Config;

Expand All @@ -8,11 +10,14 @@
->exclude(__DIR__ . '/vendor')
->exclude(__DIR__ . '/logs')
->exclude(__DIR__ . '/build');
return Config::create()
->setRules([
'@PSR2' => true,
'array_syntax' => [
'syntax' => 'short',
],
])
->setFinder($finder);

$config = new Config();
$config->setRules([
'@PSR2' => true,
'array_syntax' => [
'syntax' => 'short',
],
]);
$config->setFinder($finder);

return $config;

0 comments on commit 82fdde1

Please sign in to comment.