Skip to content

Commit

Permalink
Adding build/testing against PHP 7.4.
Browse files Browse the repository at this point in the history
  • Loading branch information
allebb committed Jan 30, 2020
1 parent 3789029 commit d05f6a0
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 11 deletions.
6 changes: 0 additions & 6 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,9 +1,6 @@
language: php

php:
- 5.3
- 5.4
- 5.5
- 5.6
- 7.0
- 7.1
Expand All @@ -14,9 +11,6 @@ php:

matrix:
allow_failures:
- php: 5.3
- php: 5.4
- php: 5.5
- php: 5.6
- php: 7.0
- php: nightly
Expand Down
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ Requirements

* PHP >= 5.4.0

This library is unit tested against PHP 5.4, 5.5, 5.6, 7.0, 7.1, 7.2, 7.3 and the PHP nightly builds!
This library is unit tested against PHP 5.6, 7.0, 7.1, 7.2, 7.3 and 7.4!

License
-------
Expand All @@ -36,7 +36,7 @@ Alternately you can add it to your ``composer.json`` file manually in the `requi
```php
"ballen/linguist": "^1.0"
```
Then install the package by running the ``composer update ballen/linguist`` command.
Then install the package by running the ``composer install`` command.

Examples
--------
Expand All @@ -48,7 +48,7 @@ Tests and coverage

This library is fully unit tested using [PHPUnit](https://phpunit.de/).

I use [TravisCI](https://travis-ci.org/) for continuous integration, which triggers tests for PHP 5.4, 5.5, 5.6, 7.0, 7.1, 7.2, 7.3 and the PHP nightly build every time a commit is pushed.
I use [TravisCI](https://travis-ci.org/) for continuous integration, which triggers tests for PHP 55.6, 7.0, 7.1, 7.2, 7.3, 7.4 and the PHP nightly build every time a commit is pushed.

If you wish to run the tests yourself you should run the following:

Expand Down
2 changes: 1 addition & 1 deletion src/Transformers/HtmlTransformer.php
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ class HtmlTransformer extends Transformer implements TransformerInterface
private function transform($string)
{

$string = preg_replace("/(http|https|ftp|ftps)\:\/\/[a-zA-Z0-9\-\.]+\.[a-zA-Z]{2,3}(\/\S*)?/", "<a href=\"$0\">$0</a> ", $string);
$string = preg_replace(Transformer::URL_REGEX, "<a href=\"$0\">$0</a> ", $string);

foreach (array_keys($this->tags) as $tagtype) {
$tagconf = $this->tags[$tagtype];
Expand Down
2 changes: 1 addition & 1 deletion src/Transformers/MarkdownTansformer.php
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ class MarkdownTansformer extends Transformer implements TransformerInterface
private function transform($string)
{

$string = preg_replace("/(http|https|ftp|ftps)\:\/\/[a-zA-Z0-9\-\.]+\.[a-zA-Z]{2,3}(\/\S*)?/", "[$0]($0) ", $string);
$string = preg_replace(Transformer::URL_REGEX, "[$0]($0) ", $string);

foreach (array_keys($this->tags) as $tagtype) {
$tagconf = $this->tags[$tagtype];
Expand Down
2 changes: 2 additions & 0 deletions src/Transformers/Transformer.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@
abstract class Transformer
{

const URL_REGEX = "/(http|https|ftp|ftps)\:\/\/[a-zA-Z0-9\-\.]+\.[a-zA-Z]{2,3}(\/\S*)?/";

/**
* Strips HTML tags from the given string.
* @param string $message The string that does/may contain HTML tags.
Expand Down

0 comments on commit d05f6a0

Please sign in to comment.