Skip to content

Commit

Permalink
upgrade
Browse files Browse the repository at this point in the history
- adding PHP8 support
- dropping unsupported versions
- upgrading to phpunit v9
- removing dependency for phpunit v7 due its dependency to php7.1
- running tests and code analysis on PHP8
- symfony/flex changed default branch name
  • Loading branch information
unixslayer committed Apr 15, 2021
1 parent 9c4dd67 commit 0551dbc
Show file tree
Hide file tree
Showing 71 changed files with 638 additions and 168 deletions.
8 changes: 8 additions & 0 deletions .docheader
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
/**
* This file is part of prooph/event-store-symfony-bundle.
* (c) 2014-%year% Alexander Miertsch <kontakt@codeliner.ws>
* (c) 2015-%year% Sascha-Oliver Prolic <saschaprolic@googlemail.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
28 changes: 6 additions & 22 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ env:
before_install:
- mv ~/.phpenv/versions/$(phpenv version-name)/etc/conf.d/xdebug.ini{,.disabled} || echo "xdebug not available"
- composer self-update
- composer global require --no-progress --no-scripts --no-plugins symfony/flex dev-master
- composer global require --no-progress --no-scripts --no-plugins symfony/flex dev-main

install:
- travis_retry composer update -n --prefer-dist --prefer-stable
Expand All @@ -28,23 +28,6 @@ script:

jobs:
include:
- php: 7.1
env: LOWEST SYMFONY_DEPRECATIONS_HELP=weak SYMFONY_REQUIRE="3.4.*"
install:
- composer require --dev lendable/symfony-messenger-polyfill --no-update
- travis_retry composer update -n --prefer-lowest --prefer-stable --prefer-dist

- php: 7.2
install:
- composer require --dev symfony/messenger --no-update
- travis_retry composer update -n --prefer-dist

- php: 7.3
install:
- composer require --dev symfony/messenger --no-update
- travis_retry composer update -n --prefer-dist


# Test against latest Symfony 3.4
- php: 7.4
env: SYMFONY_REQUIRE="3.4.*"
Expand All @@ -67,17 +50,18 @@ jobs:
- travis_retry composer update -n --prefer-dist

- stage: Code Quality
env: CODING_STANDARDS
php: 7.4
env: CODING_STANDARDS=1
php: 8.0
install:
- composer require --dev symfony/messenger --no-update
- travis_retry composer update -n --prefer-dist
script:
- ./vendor/bin/php-cs-fixer fix -v --diff --dry-run
- ./vendor/bin/phpstan analyse -c phpstan.neon -l 7 src
- ./vendor/bin/phpstan analyse -c phpstan.neon -l 6 src

- stage: Coverage
php: 7.4
php: 8.0
env: XDEBUG_MODE=coverage
install:
- composer require --dev symfony/messenger --no-update
- travis_retry composer update -n --prefer-dist
Expand Down
35 changes: 17 additions & 18 deletions LICENSE.md
Original file line number Diff line number Diff line change
@@ -1,29 +1,28 @@
New BSD License
===============

Copyright (c) 2016 - 2019, Alexander Miertsch <kontakt@codeliner.ws> and Sascha-Oliver Prolic <saschaprolic@googlemail.com>
Copyright (c) 2014-2021, Alexander Miertsch
Copyright (c) 2015-2021, Sascha-Oliver Prolic
All rights reserved.

Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:

* Redistributions of source code must retain the above copyright notice,
this list of conditions and the following disclaimer.
* Redistributions of source code must retain the above copyright notice, this
list of conditions and the following disclaimer.

* Redistributions in binary form must reproduce the above copyright notice,
this list of conditions and the following disclaimer in the documentation
and/or other materials provided with the distribution.
* Neither the names of the copyright holders nor the names of its
contributors may be used to endorse or promote products derived from this
software without specific prior written permission.

* Neither the name of prooph nor the names of its
contributors may be used to endorse or promote products derived from
this software without specific prior written permission.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
POSSIBILITY OF SUCH DAMAGE.
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
9 changes: 5 additions & 4 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@
}
},
"require": {
"php": "^7.1",
"php": "^7.4|^8.0",
"ext-pdo": "*",
"ext-json": "*",
"symfony/config": "^3.4 || ^4.4 || ^5.0",
Expand All @@ -63,12 +63,12 @@
},
"require-dev": {
"prooph/pdo-event-store": "^1.12",
"phpunit/phpunit": "^7 || ^8",
"phpunit/phpunit": "^8 || ^9",
"symfony/yaml" : "^3.4 || ^4.4 || ^5.0",
"bookdown/bookdown": "1.x-dev as 1.0.0",
"prooph/bookdown-template": "^0.2.3",
"friendsofphp/php-cs-fixer": "^2.8.1",
"prooph/php-cs-fixer-config": "^0.2.1",
"prooph/php-cs-fixer-config": "^0.4",
"matthiasnoback/symfony-dependency-injection-test": "^3.1 || ^4.1",
"phpstan/phpstan": "^0.12"
},
Expand All @@ -89,7 +89,8 @@
"cs-fix": "php-cs-fixer fix -v --diff",
"test": "phpunit --no-coverage",
"test-coverage": "phpunit",
"docs": "bookdown doc/bookdown.json"
"docs": "bookdown doc/bookdown.json",
"phpstan": "phpstan analyse -c phpstan.neon -l 6 src"
},
"archive": {
"exclude": [
Expand Down
26 changes: 12 additions & 14 deletions phpunit.xml.dist
Original file line number Diff line number Diff line change
@@ -1,22 +1,20 @@
<?xml version="1.0" encoding="UTF-8"?>
<!-- disable strict to debug tests -->
<phpunit bootstrap="vendor/autoload.php"
colors="true"
convertErrorsToExceptions="true"
convertNoticesToExceptions="true"
convertWarningsToExceptions="false"
backupGlobals="true"
backupStaticAttributes="false">

<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" bootstrap="vendor/autoload.php" colors="true"
convertErrorsToExceptions="true" convertNoticesToExceptions="true" convertWarningsToExceptions="false"
backupGlobals="true" backupStaticAttributes="false"
xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/9.3/phpunit.xsd">
<coverage includeUncoveredFiles="true" processUncoveredFiles="true">
<include>
<directory suffix=".php">./src</directory>
</include>
<report>
<text outputFile="php://stdout" showOnlySummary="true"/>
</report>
</coverage>
<testsuites>
<testsuite name="Prooph Event Store Bundle Test Suite">
<directory>./test</directory>
</testsuite>
</testsuites>

<filter>
<whitelist addUncoveredFilesFromWhitelist="true" processUncoveredFilesFromWhitelist="true">
<directory suffix=".php">./src</directory>
</whitelist>
</filter>
</phpunit>
9 changes: 9 additions & 0 deletions src/Command/AbstractProjectionCommand.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,14 @@
<?php

/**
* This file is part of prooph/event-store-symfony-bundle.
* (c) 2014-2021 Alexander Miertsch <kontakt@codeliner.ws>
* (c) 2015-2021 Sascha-Oliver Prolic <saschaprolic@googlemail.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/

declare(strict_types=1);

namespace Prooph\Bundle\EventStore\Command;
Expand Down
9 changes: 9 additions & 0 deletions src/Command/FormatsOutput.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,14 @@
<?php

/**
* This file is part of prooph/event-store-symfony-bundle.
* (c) 2014-2021 Alexander Miertsch <kontakt@codeliner.ws>
* (c) 2015-2021 Sascha-Oliver Prolic <saschaprolic@googlemail.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/

declare(strict_types=1);

namespace Prooph\Bundle\EventStore\Command;
Expand Down
9 changes: 9 additions & 0 deletions src/Command/ProjectionDeleteCommand.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,14 @@
<?php

/**
* This file is part of prooph/event-store-symfony-bundle.
* (c) 2014-2021 Alexander Miertsch <kontakt@codeliner.ws>
* (c) 2015-2021 Sascha-Oliver Prolic <saschaprolic@googlemail.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/

declare(strict_types=1);

namespace Prooph\Bundle\EventStore\Command;
Expand Down
21 changes: 14 additions & 7 deletions src/Command/ProjectionNamesCommand.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,14 @@
<?php

/**
* This file is part of prooph/event-store-symfony-bundle.
* (c) 2014-2021 Alexander Miertsch <kontakt@codeliner.ws>
* (c) 2015-2021 Sascha-Oliver Prolic <saschaprolic@googlemail.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/

declare(strict_types=1);

namespace Prooph\Bundle\EventStore\Command;
Expand Down Expand Up @@ -47,8 +56,8 @@ protected function configure(): void
->setDescription('Shows a list of all projection names. Can be filtered.')
->addArgument(self::ARGUMENT_FILTER, InputArgument::OPTIONAL, 'Filter by this string')
->addOption(self::OPTION_REGEX, 'r', InputOption::VALUE_NONE, 'Enable regex syntax for filter')
->addOption(self::OPTION_LIMIT, 'l', InputOption::VALUE_REQUIRED, 'Limit the result set', 20)
->addOption(self::OPTION_OFFSET, 'o', InputOption::VALUE_REQUIRED, 'Offset for result set', 0)
->addOption(self::OPTION_LIMIT, 'l', InputOption::VALUE_REQUIRED, 'Limit the result set', '20')
->addOption(self::OPTION_OFFSET, 'o', InputOption::VALUE_REQUIRED, 'Offset for result set', '0')
->addOption(self::OPTION_MANAGER, 'm', InputOption::VALUE_REQUIRED, 'Manager for result set', null);
}

Expand Down Expand Up @@ -81,10 +90,8 @@ protected function execute(InputInterface $input, OutputInterface $output)
$output->writeln('</action>');

$names = [];
/** @var int $offset */
$offset = $input->getOption(self::OPTION_OFFSET);
/** @var int $limit */
$limit = $input->getOption(self::OPTION_LIMIT);
$offset = (int) $input->getOption(self::OPTION_OFFSET);
$limit = (int) $input->getOption(self::OPTION_LIMIT);
$maxNeeded = $offset + $limit;

foreach ($managerNames as $managerName) {
Expand All @@ -100,7 +107,7 @@ protected function execute(InputInterface $input, OutputInterface $output)
$names[] = [$managerName, $projectionName];
}

if (\count($names) >= $maxNeeded) {
if (--$maxNeeded <= 0) {
break;
}
}
Expand Down
9 changes: 9 additions & 0 deletions src/Command/ProjectionResetCommand.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,14 @@
<?php

/**
* This file is part of prooph/event-store-symfony-bundle.
* (c) 2014-2021 Alexander Miertsch <kontakt@codeliner.ws>
* (c) 2015-2021 Sascha-Oliver Prolic <saschaprolic@googlemail.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/

declare(strict_types=1);

namespace Prooph\Bundle\EventStore\Command;
Expand Down
9 changes: 9 additions & 0 deletions src/Command/ProjectionRunCommand.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,14 @@
<?php

/**
* This file is part of prooph/event-store-symfony-bundle.
* (c) 2014-2021 Alexander Miertsch <kontakt@codeliner.ws>
* (c) 2015-2021 Sascha-Oliver Prolic <saschaprolic@googlemail.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/

declare(strict_types=1);

namespace Prooph\Bundle\EventStore\Command;
Expand Down
9 changes: 9 additions & 0 deletions src/Command/ProjectionStateCommand.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,14 @@
<?php

/**
* This file is part of prooph/event-store-symfony-bundle.
* (c) 2014-2021 Alexander Miertsch <kontakt@codeliner.ws>
* (c) 2015-2021 Sascha-Oliver Prolic <saschaprolic@googlemail.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/

declare(strict_types=1);

namespace Prooph\Bundle\EventStore\Command;
Expand Down
9 changes: 9 additions & 0 deletions src/Command/ProjectionStopCommand.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,14 @@
<?php

/**
* This file is part of prooph/event-store-symfony-bundle.
* (c) 2014-2021 Alexander Miertsch <kontakt@codeliner.ws>
* (c) 2015-2021 Sascha-Oliver Prolic <saschaprolic@googlemail.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/

declare(strict_types=1);

namespace Prooph\Bundle\EventStore\Command;
Expand Down
9 changes: 9 additions & 0 deletions src/Command/ProjectionStreamPositionsCommand.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,14 @@
<?php

/**
* This file is part of prooph/event-store-symfony-bundle.
* (c) 2014-2021 Alexander Miertsch <kontakt@codeliner.ws>
* (c) 2015-2021 Sascha-Oliver Prolic <saschaprolic@googlemail.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/

declare(strict_types=1);

namespace Prooph\Bundle\EventStore\Command;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,14 @@
<?php

/**
* This file is part of prooph/event-store-symfony-bundle.
* (c) 2014-2021 Alexander Miertsch <kontakt@codeliner.ws>
* (c) 2015-2021 Sascha-Oliver Prolic <saschaprolic@googlemail.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/

declare(strict_types=1);

namespace Prooph\Bundle\EventStore\DependencyInjection\Compiler;
Expand Down
10 changes: 6 additions & 4 deletions src/DependencyInjection/Compiler/MetadataEnricherPass.php
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
<?php

/**
* prooph (http://getprooph.org/)
* This file is part of prooph/event-store-symfony-bundle.
* (c) 2014-2021 Alexander Miertsch <kontakt@codeliner.ws>
* (c) 2015-2021 Sascha-Oliver Prolic <saschaprolic@googlemail.com>
*
* @see https://github.com/prooph/event-store-symfony-bundle for the canonical source repository
* @copyright Copyright (c) 2016 - 2019 Alexander Miertsch <kontakt@codeliner.ws>
* @license https://github.com/prooph/event-store-symfony-bundle/blob/master/LICENSE.md New BSD License
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/

declare(strict_types=1);
Expand Down
9 changes: 9 additions & 0 deletions src/DependencyInjection/Compiler/PluginLocatorPass.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,14 @@
<?php

/**
* This file is part of prooph/event-store-symfony-bundle.
* (c) 2014-2021 Alexander Miertsch <kontakt@codeliner.ws>
* (c) 2015-2021 Sascha-Oliver Prolic <saschaprolic@googlemail.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/

declare(strict_types=1);

namespace Prooph\Bundle\EventStore\DependencyInjection\Compiler;
Expand Down
Loading

0 comments on commit 0551dbc

Please sign in to comment.