Skip to content

Commit

Permalink
php8.0 support
Browse files Browse the repository at this point in the history
  • Loading branch information
fab2s committed Jun 16, 2021
1 parent e3fc8dc commit d393347
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 5 deletions.
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
language: php

php:
- 7.1
- 7.2
- 7.3
- 7.4
- 8.0

before_script:
- composer self-update
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Strings

[![Build Status](https://travis-ci.org/fab2s/Strings.svg?branch=master)](https://travis-ci.org/fab2s/Strings) [![Total Downloads](https://poser.pugx.org/fab2s/strings/downloads)](//packagist.org/packages/fab2s/strings) [![Monthly Downloads](https://poser.pugx.org/fab2s/strings/d/monthly)](//packagist.org/packages/fab2s/strings) [![Latest Stable Version](https://poser.pugx.org/fab2s/strings/v/stable)](https://packagist.org/packages/fab2s/strings) [![Scrutinizer Code Quality](https://scrutinizer-ci.com/g/fab2s/strings/badges/quality-score.png?b=master)](https://scrutinizer-ci.com/g/fab2s/Strings/?branch=master) [![PRs Welcome](https://img.shields.io/badge/PRs-welcome-brightgreen.svg?style=flat)](http://makeapullrequest.com) [![License](https://poser.pugx.org/fab2s/strings/license)](https://packagist.org/packages/fab2s/strings)
[![Build Status](https://travis-ci.com/fab2s/Strings.svg?branch=master)](https://travis-ci.com/fab2s/Strings) [![Total Downloads](https://poser.pugx.org/fab2s/strings/downloads)](//packagist.org/packages/fab2s/strings) [![Monthly Downloads](https://poser.pugx.org/fab2s/strings/d/monthly)](//packagist.org/packages/fab2s/strings) [![Latest Stable Version](https://poser.pugx.org/fab2s/strings/v/stable)](https://packagist.org/packages/fab2s/strings) [![Scrutinizer Code Quality](https://scrutinizer-ci.com/g/fab2s/strings/badges/quality-score.png?b=master)](https://scrutinizer-ci.com/g/fab2s/Strings/?branch=master) [![PRs Welcome](https://img.shields.io/badge/PRs-welcome-brightgreen.svg?style=flat)](http://makeapullrequest.com) [![License](https://poser.pugx.org/fab2s/strings/license)](https://packagist.org/packages/fab2s/strings)

A purely static String Helper to handle more advanced utf8 string manipulations

Expand Down Expand Up @@ -91,7 +91,7 @@ As it requires `Utf8`, `Strings` requires [mb_string](https://php.net/mb_string)

## Requirements

`Strings` is tested against php 7.1, 7.2, 7.3 and 7.4
`Strings` is tested against php 7.2, 7.3, 7.4 and 8.0

## Contributing

Expand Down
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
"MIT"
],
"require" : {
"php": ">=7.1",
"php": "^7.1|^8.0",
"ext-mbstring": "*",
"fab2s/utf8": "^1.0",
"fab2s/bom": "^1.0"
Expand Down
12 changes: 11 additions & 1 deletion tests/StringsTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -182,6 +182,12 @@ public function normalizeWsData(): array
'maxConsecutive' => 1,
'expected' => "this is one text \nwith tons of ws and LF's \r\neverywhere",
],
[
'input' => " this is one text \nwith " . json_decode('"\u2009"') . json_decode('"\u2008"') . json_decode('"\u200A"') . "tons of ws \t\tand LF's \r\neverywhere ",
'includeTabs' => true,
'maxConsecutive' => 1,
'expected' => " this is one text \nwith tons of ws and LF's \r\neverywhere ",
],
[
'input' => "this is one more text \nwith tons of ws \t\tand LF's \r\neverywhere",
'includeTabs' => false,
Expand All @@ -208,6 +214,10 @@ public function singleWsIzeData(): array
'input' => "this is a text \nwith tons of ws \t\tand LF's \r\neverywhere",
'expected' => "this is a text \nwith tons of ws \tand LF's \r\neverywhere",
],
[
'input' => " this is a text \nwith tons of ws \t\tand LF's \r\neverywhere ",
'expected' => " this is a text \nwith tons of ws \tand LF's \r\neverywhere ",
],
[
'input' => "this is a text \f\nwith" . json_decode('"\u2009"') . json_decode('"\u2009"') . "tons of ws \t \tand LF's \r\neverywhere",
'expected' => "this is a text \f\nwith" . json_decode('"\u2009"') . "tons of ws \t \tand LF's \r\neverywhere",
Expand All @@ -224,7 +234,7 @@ public function filterData(): array
// input, expected
["this is a \x00text \n\nwith \rws \t\tand LF's \r\neverywh\0ere", "this is a text\n\nwith\nws \t\tand LF's\neverywhere"],
["this is another text \0\nwith \r\rws \t\tand LF's \r\neverywhere", "this is another text\nwith\n\nws \t\tand LF's\neverywhere"],
['this is yet an' . json_decode('"\uFEFF"') . "other text \0\nwith \n\rws \t\tand LF's \r\nevery" . json_decode('"\u200B"') . 'where !!ù€@à!!', "this is yet another text\nwith\n\nws \t\tand LF's\neverywhere !!ù€@à!!"],
['this is yet an' . json_decode('"\uFEFF"') . "other text \0\nwith \n\rws \t\tand LF's \r\nevery" . json_decode('"\u200B"') . 'where', "this is yet another text\nwith\n\nws \t\tand LF's\neverywhere"],
];
}
}

0 comments on commit d393347

Please sign in to comment.