Skip to content

Commit

Permalink
[core] Work on PHP 8 (#1445)
Browse files Browse the repository at this point in the history
  • Loading branch information
siad007 authored Nov 19, 2020
1 parent 2d2c6c7 commit f5ddaa1
Show file tree
Hide file tree
Showing 5 changed files with 19 additions and 33 deletions.
12 changes: 5 additions & 7 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ php:
- 7.3
- 7.4
- 8.0snapshot
- 8.1snapshot
- master

env:
Expand Down Expand Up @@ -44,28 +43,27 @@ before_install:
install:
- |
if [[ "$DEPS" == "LOW" ]]; then
composer install --prefer-dist --no-progress --no-interaction --no-suggest;
composer update --optimize-autoloader --prefer-dist --prefer-stable --no-progress --no-interaction --no-suggest --prefer-lowest;
composer install --prefer-dist --no-progress --no-interaction;
composer update --optimize-autoloader --prefer-dist --prefer-stable --no-progress --no-interaction --prefer-lowest;
else
composer install --optimize-autoloader --prefer-dist --no-progress --no-interaction --no-suggest;
composer install --optimize-autoloader --prefer-dist --no-progress --no-interaction;
fi
script:
- echo "=== TESTING PHING ==="
- cd test
- ../bin/phing -debug -Dtests.codecoverage=false -listener "phing.listener.StatisticsListener"
- ../bin/phing -verbose -Dtests.codecoverage=false -listener "phing.listener.StatisticsListener"
- cd ..

jobs:
allow_failures:
- php: 8.0snapshot
- php: 8.1snapshot
- php: master
- php: nightly
include:
- php: nightly
env: DEPS="IGNORE"
install: composer update --optimize-autoloader --prefer-dist --prefer-stable --no-progress --no-interaction --no-suggest --ignore-platform-reqs
install: composer update --optimize-autoloader --prefer-dist --prefer-stable --no-progress --no-interaction --ignore-platform-reqs

- stage: test with coverage
php: 7.4
Expand Down
17 changes: 2 additions & 15 deletions classes/phing/filters/StripPhpComments.php
Original file line number Diff line number Diff line change
Expand Up @@ -31,26 +31,13 @@
*/
class StripPhpComments extends BaseFilterReader implements ChainableReader
{
/**
* The read-ahead character, used for effectively pushing a single
* character back. -1 indicates that no character is in the buffer.
*/
private $readAheadCh = -1;

/**
* Whether or not the parser is currently in the middle of a string
* literal.
*
* @var boolean
*/
private $inString = false;

/**
* Returns the stream without Php comments.
*
* @param int $len
* @param int|null $len
* @return string the resulting stream, or -1
* if the end of the resulting stream has been reached
* @throws IOException
*/
public function read($len = null)
{
Expand Down
7 changes: 4 additions & 3 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -55,16 +55,17 @@
"aws/aws-sdk-php": "^3.112",
"guzzlehttp/guzzle": "^7.1",
"jawira/plantuml-encoding": "^1.0",
"mikey179/vfsstream": "^1.6",
"mikey179/vfsstream": "^1.6.8",
"monolog/monolog": "^1.25 || ^2.0",
"pdepend/pdepend": "^2.5.2",
"pear/archive_tar": "~1.4.7",
"pear/console_getopt": "^v1.4.3",
"pear/mail": "^1.4",
"pear/mail_mime": "^1.10",
"pear/net_growl": "dev-master",
"pear/pear-core-minimal": "~1.10.9",
"pear/pear-core-minimal": "^1.10.10",
"pear/versioncontrol_git": "dev-master",
"pear/versioncontrol_svn": "~0.5",
"pear/versioncontrol_svn": "^0.5.2",
"phploc/phploc": "^7.0",
"phpmd/phpmd": "~2.8",
"phpunit/phpunit": "^9.4",
Expand Down
12 changes: 6 additions & 6 deletions composer.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions test/classes/phing/filters/util/StripPhpCommentsTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -39,9 +39,9 @@ public function tearDown(): void
$this->executeTarget("cleanup");
}

public function testSortFilter()
public function testStripPhpComments()
{
$this->executeTarget("testStripPhpComments");
$this->executeTarget(__FUNCTION__);

$expectedFile = $this->getProject()->resolveFile("expected/stripphpcomments.test");
$resultFile = $this->getProject()->resolveFile("result/stripphpcomments.test");
Expand Down

0 comments on commit f5ddaa1

Please sign in to comment.