Skip to content

Commit 82fdde1

Browse files
committed
added supporting of 8.0, 8.1
1 parent ea48432 commit 82fdde1

File tree

20 files changed

+205
-128
lines changed

20 files changed

+205
-128
lines changed

.gitattributes

Lines changed: 0 additions & 5 deletions
This file was deleted.

.github/workflows/build.yml

Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
name: Build
2+
on:
3+
push:
4+
branches: [master]
5+
pull_request:
6+
branches: [master]
7+
8+
jobs:
9+
testing:
10+
name: PHP ${{ matrix.php }}
11+
runs-on: ubuntu-latest
12+
strategy:
13+
matrix:
14+
php:
15+
- 5.6
16+
- 7.0
17+
- 7.1
18+
- 7.2
19+
- 7.3
20+
- 7.4
21+
- 8.0
22+
- 8.1
23+
steps:
24+
- uses: actions/checkout@v2
25+
26+
- name: Install PHP
27+
uses: shivammathur/setup-php@v2
28+
with:
29+
php-version: ${{ matrix.php }}
30+
ini-values: date.timezone='UTC'
31+
extensions: xmlwriter
32+
tools: composer:v2
33+
34+
- name: Get Composer Cache Directory
35+
id: composer-cache
36+
run: echo "::set-output name=dir::$(composer config cache-files-dir)"
37+
38+
- name: Cache Composer packages
39+
uses: actions/cache@v2
40+
with:
41+
path: ${{ steps.composer-cache.outputs.dir }}
42+
key: php${{ matrix.php }}-composer-${{ hashFiles('**/composer.json') }}
43+
restore-keys: php${{ matrix.php }}-composer-
44+
45+
- name: Install dependencies
46+
run: composer install --no-plugins
47+
48+
- name: Run test suite
49+
run: XDEBUG_MODE=coverage ./vendor/bin/phpunit
50+
51+
- name: Upload coverage results to Coveralls
52+
env:
53+
COVERALLS_REPO_TOKEN: ${{ secrets.GITHUB_TOKEN }}
54+
run: |
55+
composer global require php-coveralls/php-coveralls
56+
php-coveralls --coverage_clover=build/logs/clover.xml -v

.gitignore

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,4 +6,6 @@
66
/logs
77
/phpunit.xml.dist
88
/.idea
9-
/.php_cs.cache
9+
/.php-cs-fixer.cache
10+
/docker-compose.yml
11+
/.phpunit.result.cache

.travis.yml

Lines changed: 0 additions & 17 deletions
This file was deleted.

CHANGELOG.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,11 @@ php-html-form
99
- *Dep*: Deprecated.
1010
- *Fix*: Fixed.
1111

12+
2.0.1 [2022-01-30]
13+
------------------
14+
15+
- Add: Support PHP 8.0, 8.1.
16+
1217
2.0.0 [2020-02-11]
1318
------------------
1419

Dockerfile

Lines changed: 0 additions & 27 deletions
This file was deleted.

LICENSE.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ The MIT License (MIT)
22

33
Copyright (c) 2016 Adam Wathan <[email protected]>
44

5-
Copyright (c) 2017 Vasily Belosloodcev <bupy765@gmail.com>
5+
Copyright (c) 2022 Vasily Belosloodcev <vasily.belosloodcev@gmail.com>
66

77
Permission is hereby granted, free of charge, to any person obtaining a copy
88
of this software and associated documentation files (the "Software"), to deal

README.md

Lines changed: 32 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,15 @@
1-
Form
2-
====
1+
php-html-form
2+
===
33

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

77

8-
[![Latest Stable Version](https://poser.pugx.org/bupy7/php-html-form/v/stable)](https://packagist.org/packages/bupy7/php-html-form)
8+
[![Stable Version](https://poser.pugx.org/bupy7/php-html-form/v/stable)](https://packagist.org/packages/bupy7/php-html-form)
9+
[![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)
10+
[![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)
911
[![Total Downloads](https://poser.pugx.org/bupy7/php-html-form/downloads)](https://packagist.org/packages/bupy7/php-html-form)
10-
[![Latest Unstable Version](https://poser.pugx.org/bupy7/php-html-form/v/unstable)](https://packagist.org/packages/bupy7/php-html-form)
1112
[![License](https://poser.pugx.org/bupy7/php-html-form/license)](https://packagist.org/packages/bupy7/php-html-form)
12-
[![Build Status](https://travis-ci.org/bupy7/php-html-form.svg?branch=master)](https://travis-ci.org/bupy7/php-html-form)
13-
[![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)
1413

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

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

2322
Installation
24-
------------
23+
---
2524

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

3332
Basic Usage
34-
-----------
33+
---
3534

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

4746
Getting Started
48-
---------------
47+
---
4948

5049
First, instantiate a FormBuilder...
5150

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

6564

6665
Opening a Form
67-
--------------
66+
---
6867

6968
```php
7069
// <form method="POST">
@@ -92,7 +91,7 @@ Opening a Form
9291
```
9392

9493
Text and Password Fields
95-
------------------------
94+
---
9695

9796
Text and password fields share the same interface.
9897

@@ -119,7 +118,7 @@ Other available methods:
119118
- `enable()`
120119

121120
Textareas
122-
---------
121+
---
123122

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

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

137136
Checkboxes and Radio Buttons
138-
----------------------------
137+
---
139138

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

160159
Selects
161-
-------
160+
---
162161

163162
```php
164163
// <select name="birth_year"></select>
@@ -215,7 +214,7 @@ $options = [
215214
```
216215

217216
Buttons
218-
-------
217+
---
219218

220219
```php
221220
// <button type="button">Click Me</button>
@@ -232,15 +231,15 @@ Buttons
232231
```
233232

234233
Hidden Inputs
235-
-------------
234+
---
236235

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

242241
Labels
243-
------
242+
---
244243

245244
**Basic Label**
246245
```php
@@ -261,7 +260,7 @@ Labels
261260
```
262261

263262
Setting Attributes
264-
------------------
263+
---
265264

266265
```php
267266
// Attributes can be set with attribute(...)
@@ -282,7 +281,7 @@ Setting Attributes
282281
```
283282

284283
Error Messages
285-
--------------
284+
---
286285

287286
FormBuilder also allows you to easily retrieve error messages for your form elements. To do so, just
288287
implement the `ErrorStoreInterface` and pass it to the FormBuilder:
@@ -321,7 +320,7 @@ token to your form easily like so:
321320
```
322321
323322
Data Binding
324-
------------
323+
---
325324
326325
Sometimes you might have a form where all of the fields match properties on some sort of object or array
327326
in your system, and you want the user to be able to edit that data. Data binding makes this really easy by
@@ -343,24 +342,24 @@ $model->email = "[email protected]";
343342
344343
> Note: Be sure to `bind` before creating any other form elements.
345344
346-
Run tests
347-
---------
345+
Testing
346+
---
348347
349-
**Using Docker:**
348+
Run tests:
350349
351-
```bash
352-
$ docker-compose up -d
353-
$ docker-compose exec php sh
354-
$ composer test:run
350+
```
351+
$ ./vendor/bin/phpunit --no-coverage
355352
```
356353
357-
**Any another way:**
354+
Run tests with coverage:
358355
359-
```bash
360-
$ composer test:run
361356
```
357+
$ XDEBUG_MODE=coverage ./vendor/bin/phpunit
358+
```
359+
360+
HTML coverage path: `build/coverage/index.html`
362361
363362
License
364-
-------
363+
---
365364
366365
php-html-form is released under the [MIT License](LICENSE.md).

composer.json

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -11,16 +11,13 @@
1111
"email": "[email protected]"
1212
}
1313
],
14-
"version": "2.0.0",
1514
"license": "MIT",
1615
"require": {
1716
"php": ">=5.6"
1817
},
1918
"require-dev": {
20-
"mockery/mockery": "^1.3.1",
21-
"php-coveralls/php-coveralls": "^2.2.0",
22-
"phpunit/phpunit": ">=5.5 <6.0.0",
23-
"friendsofphp/php-cs-fixer": "^2.16.1"
19+
"mockery/mockery": ">=1.3.5",
20+
"phpunit/phpunit": ">=5.7.27"
2421
},
2522
"autoload": {
2623
"psr-0": {
@@ -31,8 +28,6 @@
3128
"classmap": ["tests/"]
3229
},
3330
"scripts": {
34-
"test:run": "./vendor/bin/phpunit --no-coverage",
35-
"test:run-with-cov": "./vendor/bin/phpunit",
36-
"cs:fix": "./vendor/bin/php-cs-fixer fix --config=./phpcs.php"
31+
"cs:fix": "php-cs-fixer fix --config=./phpcs.php --verbose"
3732
}
3833
}

docker-compose.yml

Lines changed: 0 additions & 14 deletions
This file was deleted.

0 commit comments

Comments
 (0)