Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Drop Support for PHP 5 #15

Merged
merged 13 commits into from
Apr 27, 2022
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
14 changes: 9 additions & 5 deletions .github/workflows/php7.yml → .github/workflows/php70.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Build PHP 7
name: Build PHP 7.0

on:
push:
Expand All @@ -9,11 +9,12 @@ on:
jobs:
test:
runs-on: ${{ matrix.os }}

strategy:
fail-fast: true
matrix:
os: [ ubuntu-latest ]
php: [7.1, 7.0, 5.6]
php: [7.0]

name: PHP${{matrix.php}} - ${{matrix.os}}

Expand All @@ -25,11 +26,14 @@ jobs:
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php }}
extensions: mysqli, mbstring
extensions: mysqli, mbstring, sqlsrv
tools: phpunit:5.7.27, composer

- name: Install Dependencies
run: composer install --prefer-source --no-interaction --no-dev

- name: Execute Tests
run: phpunit

- name: CodeCov
uses: codecov/codecov-action@v1
39 changes: 39 additions & 0 deletions .github/workflows/php71.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
name: Build PHP 7.1

on:
push:
branches: [ master ]
pull_request:
branches: [ master ]

jobs:
test:
runs-on: ${{ matrix.os }}

strategy:
fail-fast: true
matrix:
os: [ ubuntu-latest ]
php: [7.1]

name: PHP${{matrix.php}} - ${{matrix.os}}

steps:
- name: Clone Repo
uses: actions/checkout@v1

- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php }}
extensions: mysqli, mbstring, sqlsrv
tools: phpunit:5.7.27, composer

- name: Install Dependencies
run: composer install --prefer-source --no-interaction --no-dev

- name: Execute Tests
run: phpunit

- name: CodeCov
uses: codecov/codecov-action@v1
41 changes: 41 additions & 0 deletions .github/workflows/php72.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
name: Build PHP 7.2

on:
push:
branches: [ master ]
pull_request:
branches: [ master ]

jobs:
test:
runs-on: ${{ matrix.os }}

strategy:
fail-fast: true
matrix:
os: [ ubuntu-latest ]
php: [7.2]

name: PHP${{matrix.php}} - ${{matrix.os}}

steps:
- name: Clone Repo
uses: actions/checkout@v1

- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php }}
extensions: mysqli, mbstring, sqlsrv
tools: phpunit:8.5.13

- name: Install Dependencies
run: composer install --prefer-source --no-interaction --no-dev

- name: Execute Tests
run: phpunit

- name: CodeCov
uses: codecov/codecov-action@v1


42 changes: 42 additions & 0 deletions .github/workflows/php73.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
name: Build PHP 7.3

on:
push:
branches: [ master ]
pull_request:
branches: [ master ]

jobs:
test:
runs-on: ${{ matrix.os }}

strategy:
fail-fast: true
matrix:
os: [ ubuntu-latest ]
php: [7.3]

name: PHP${{matrix.php}} - ${{matrix.os}}

steps:
- name: Clone Repo
uses: actions/checkout@v1

- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php }}
extensions: mysqli, mbstring, sqlsrv
tools: phpunit:8.5.13

- name: Install Dependencies
run: composer install --prefer-source --no-interaction --no-dev

- name: Execute Tests
run: phpunit

- name: CodeCov
uses: codecov/codecov-action@v1



42 changes: 42 additions & 0 deletions .github/workflows/php74.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
name: Build PHP 7.4

on:
push:
branches: [ master ]
pull_request:
branches: [ master ]

jobs:
test:
runs-on: ${{ matrix.os }}

strategy:
fail-fast: true
matrix:
os: [ ubuntu-latest ]
php: [7.4]

name: PHP${{matrix.php}} - ${{matrix.os}}

steps:
- name: Clone Repo
uses: actions/checkout@v1

- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php }}
extensions: mysqli, mbstring, sqlsrv
tools: phpunit:8.5.13

- name: Install Dependencies
run: composer install --prefer-source --no-interaction --no-dev

- name: Execute Tests
run: phpunit

- name: CodeCov
uses: codecov/codecov-action@v1



41 changes: 41 additions & 0 deletions .github/workflows/php80.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
name: Build PHP 8.0

on:
push:
branches: [ master ]
pull_request:
branches: [ master ]

jobs:
test:
runs-on: ${{ matrix.os }}
strategy:
fail-fast: true
matrix:
os: [ ubuntu-latest ]
php: [ 8.0 ]

name: PHP${{matrix.php}} - ${{matrix.os}}

steps:
- name: Clone Repo
uses: actions/checkout@v1

- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php }}
extensions: mysqli, mbstring, sqlsrv
tools: phpunit:8.5.13

- name: Shutdown Ubuntu MySQL
run: sudo service mysql stop

- name: Install Dependencies
run: composer install --prefer-source --no-interaction --no-dev

- name: Execute Tests
run: phpunit

- name: CodeCov
uses: codecov/codecov-action@v1
16 changes: 8 additions & 8 deletions .github/workflows/php8.yml → .github/workflows/php81.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Build PHP 7,8
name: Build PHP 8.1

on:
push:
Expand All @@ -9,11 +9,12 @@ on:
jobs:
test:
runs-on: ${{ matrix.os }}

strategy:
fail-fast: true
matrix:
os: [ ubuntu-latest ]
php: [ 8.0, 7.4, 7.3, 7.2]
php: [8.2]

name: PHP${{matrix.php}} - ${{matrix.os}}

Expand All @@ -25,15 +26,16 @@ jobs:
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php }}
extensions: mysqli, mbstring
tools: phpunit:8.5.13, composer
extensions: mysqli, mbstring, sqlsrv
tools: phpunit:9.5.20, composer


- name: Install Dependencies
run: composer install --prefer-source --no-interaction --no-dev

- name: Execute Tests
run: phpunit

- name: CodeCov
uses: codecov/codecov-action@v1

Expand All @@ -42,5 +44,3 @@ jobs:
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}


42 changes: 42 additions & 0 deletions .github/workflows/php82.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
name: Build PHP 8.2

on:
push:
branches: [ master, dev ]
pull_request:
branches: [ master ]

jobs:
test:
runs-on: ${{ matrix.os }}

strategy:
fail-fast: true
matrix:
os: [ ubuntu-latest ]
php: [8.2]

name: PHP${{matrix.php}} - ${{matrix.os}}

steps:
- name: Clone Repo
uses: actions/checkout@v1

- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php }}
extensions: mysqli, mbstring, sqlsrv
tools: phpunit:9.5.20, composer

- name: Shutdown Ubuntu MySQL
run: sudo service mysql stop

- name: Install Dependencies
run: composer install --prefer-source --no-interaction --no-dev

- name: Execute Tests
run: phpunit

- name: CodeCov
uses: codecov/codecov-action@v1
4 changes: 2 additions & 2 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
"name": "webfiori/ui",
"description": "A library that provides basic utilities for creating HTML documents.",
"require": {
"php": ">=5.6",
"webfiori/collections":"1.0.3"
"php": ">=7.0",
"webfiori/collections":"1.1.0"
},
"keywords": [
"library",
Expand Down
7 changes: 4 additions & 3 deletions src/Anchor.php
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ class Anchor extends HTMLNode {
* @param string $target The value to set for the attribute 'target'.
* Default is '_self'.
*/
public function __construct($href, $body, $target = '_self') {
public function __construct(string $href, $body, string $target = '_self') {
parent::__construct('a');
$this->setAttribute(self::$Attrs[1],$href);

Expand All @@ -78,7 +78,7 @@ public function __construct($href, $body, $target = '_self') {
*
* @since 1.0
*/
public function setHref($link) {
public function setHref(string $link) {
$trimmed = trim($link);

if (strlen($trimmed) > 0) {
Expand Down Expand Up @@ -110,11 +110,12 @@ public function setTarget($name) {
*
* @since 1.0
*/
public function setText($text,$escHtmlEntities = true) {
public function setText(string $text,$escHtmlEntities = true) : HTMLNode {
$node = $this->getChild(0);

if ($node->getNodeName() == '#TEXT') {
$node->setText($text,$escHtmlEntities);
}
return $this;
}
}
3 changes: 2 additions & 1 deletion src/CodeSnippet.php
Original file line number Diff line number Diff line change
Expand Up @@ -271,9 +271,10 @@ public function setCode($code) {
*
* @since 1.0
*/
public function setTitle($title) {
public function setTitle(string $title) : HTMLNode {
$this->titleNode->clear();
$this->titleNode->addText($title);
return $this;
}
private function _addLine() {
$span = new HTMLNode('span');
Expand Down
Loading