Skip to content

Commit

Permalink
Dropped php7.1 and 7.2 updated some packages. (#321)
Browse files Browse the repository at this point in the history
* removed travis-ci and added github actions build status to readme

Signed-off-by: fenn-cs <[email protected]>

* added php 8 to ci, updated build name

Signed-off-by: fenn-cs <[email protected]>

* added alternate php versions

Signed-off-by: fenn-cs <[email protected]>

* dropped php7.0, php7.1, updated jms/serializer

Signed-off-by: fenn-cs <[email protected]>
  • Loading branch information
Fenn-CS authored Mar 2, 2021
1 parent ae51788 commit 13dcc6f
Show file tree
Hide file tree
Showing 9 changed files with 30 additions and 19 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ jobs:
strategy:
fail-fast: false
matrix:
php-versions: ['7.0', '7.1', '7.2', '7.3', '7.4', '8.0']
php-versions: ['7.2', '7.3', '7.4', '8.0']
steps:
- name: Checkout
uses: actions/checkout@v2
Expand Down Expand Up @@ -74,7 +74,7 @@ jobs:
run: vendor/bin/phpunit tests/System/;
continue-on-error: ${{matrix.php-versions == '8.0' }} # [temp-php8]
- name: Running static analysis
run: vendor/bin/phpstan analyse -l 5 bin/ src/ tests/ public/;
run: vendor/bin/phpstan analyse -c phpstan.neon;
continue-on-error: ${{matrix.php-versions == '8.0' }} # [temp-php8]
- name: Running PHPMD
run: vendor/bin/phpmd src/ text config/PHPMD/rules.xml;
Expand Down
8 changes: 4 additions & 4 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
"source": "https://github.com/phpList/core"
},
"require": {
"php": "^7.0|^8.0",
"php": "^7.2|^8.0",
"doctrine/orm": "^2.5.0",
"doctrine/common": "^2.6.0",
"doctrine/doctrine-bundle": "^1.8.0",
Expand All @@ -43,7 +43,7 @@
"symfony/dependency-injection": "^3.4.37",
"symfony/config": "^3.4.37",
"symfony/yaml": "^3.4.37",
"jms/serializer-bundle": "^2.3",
"jms/serializer-bundle": "^3.8.0",
"sensio/framework-extra-bundle": "^5.1.0",
"sensio/distribution-bundle": "^5.0.6"
},
Expand All @@ -53,8 +53,8 @@
"phpunit/dbunit": "^3.0.0",
"guzzlehttp/guzzle": "^6.3.0",
"squizlabs/php_codesniffer": "^3.2.0",
"phpstan/phpstan": "^0.7.0",
"nette/caching": "^2.5.0 || ^3.0.0",
"phpstan/phpstan": "^0.7.0|0.12.57",
"nette/caching": "^2.5.0|^3.0.0",
"nikic/php-parser": "^3.1.0",
"phpmd/phpmd": "^2.6.0",
"composer/composer": "^1.6.0",
Expand Down
10 changes: 10 additions & 0 deletions phpstan.neon
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
parameters:
level: 5
paths:
- bin
- src
- tests
- public
ignoreErrors:
- '#Cannot call method (?:willReturn|shouldBeCalledOnce|shouldNotBeCalled|shouldBeCalled|shouldNotHaveBeenCalled)\(\) on .*\.#'
- '#Call to an undefined method [a-zA-Z0-9\\_]+::willReturn\(\)#'
2 changes: 1 addition & 1 deletion src/Core/Bootstrap.php
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ protected function __clone()
public static function getInstance(): Bootstrap
{
if (self::$instance === null) {
self::$instance = new static();
self::$instance = new self;
}

return self::$instance;
Expand Down
4 changes: 2 additions & 2 deletions src/TestingSupport/Traits/DatabaseTestTrait.php
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ protected function initializeDatabaseTester()
{
$this->dataSet = new CsvDataSet();

$this->databaseTester = null;
unset($this->databaseTester);
$this->getDatabaseTester()->setSetUpOperation($this->getSetUpOperation());
}

Expand All @@ -98,7 +98,7 @@ protected function tearDownDatabaseTest()

// Destroy the tester after the test is run to keep DB connections
// from piling up.
$this->databaseTester = null;
unset($this->databaseTester);

Bootstrap::purgeInstance();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -230,8 +230,8 @@ public function findsAssociatedSubscriptions()
$this->getDataSet()->addTable(static::SUBSCRIPTION_TABLE_NAME, __DIR__ . '/../Fixtures/Subscription.csv');
$this->applyDatabaseChanges();

/** @var SubscriberList $model */
$id = 2;
/** @var SubscriberList $model */
$model = $this->subject->find($id);
$subscriptions = $model->getSubscriptions();

Expand All @@ -253,8 +253,8 @@ public function findsAssociatedSubscribers()
$this->getDataSet()->addTable(static::SUBSCRIPTION_TABLE_NAME, __DIR__ . '/../Fixtures/Subscription.csv');
$this->applyDatabaseChanges();

/** @var SubscriberList $model */
$id = 2;
/** @var SubscriberList $model */
$model = $this->subject->find($id);
$subscribers = $model->getSubscribers();

Expand All @@ -276,8 +276,8 @@ public function removeAlsoRemovesAssociatedSubscriptions()

$initialNumberOfSubscriptions = count($this->subscriptionRepository->findAll());

/** @var SubscriberList $model */
$id = 2;
/** @var SubscriberList $model */
$model = $this->subject->find($id);

$numberOfAssociatedSubscriptions = count($model->getSubscriptions());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -237,8 +237,8 @@ public function findsAssociatedSubscriptions()
$this->getDataSet()->addTable(static::SUBSCRIPTION_TABLE_NAME, __DIR__ . '/../Fixtures/Subscription.csv');
$this->applyDatabaseChanges();

/** @var Subscriber $model */
$id = 1;
/** @var Subscriber $model */
$model = $this->subject->find($id);
$subscriptions = $model->getSubscriptions();

Expand All @@ -260,8 +260,8 @@ public function findsAssociatedSubscribedLists()
$this->getDataSet()->addTable(static::SUBSCRIPTION_TABLE_NAME, __DIR__ . '/../Fixtures/Subscription.csv');
$this->applyDatabaseChanges();

/** @var Subscriber $model */
$id = 1;
/** @var Subscriber $model */
$model = $this->subject->find($id);
$subscribedLists = $model->getSubscribedLists();

Expand All @@ -283,8 +283,8 @@ public function removeAlsoRemovesAssociatedSubscriptions()

$initialNumberOfSubscriptions = count($this->subscriptionRepository->findAll());

/** @var Subscriber $model */
$id = 2;
/** @var Subscriber $model */
$model = $this->subject->find($id);

$numberOfAssociatedSubscriptions = count($model->getSubscriptions());
Expand Down
5 changes: 3 additions & 2 deletions tests/Unit/Composer/ModuleFinderTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,7 @@ public function modulesWithoutBundlesDataProvider(): array
*/
private function buildMockPackagesWithModuleConfiguration(array $extrasSets): array
{
/** @var PackageInterface[][] $moduleSets */
$moduleSets = [];
foreach ($extrasSets as $packageName => $extrasSet) {
$moduleSet = $this->buildSingleMockPackageWithModuleConfiguration($extrasSet);
Expand Down Expand Up @@ -108,9 +109,9 @@ private function buildSingleMockPackageWithModuleConfiguration(array $extrasSet)
* @param array $extras
* @param string $packageName
*
* @return PackageInterface|ProphecySubjectInterface
* @return ProphecySubjectInterface
*/
private function buildPackageProphecyWithExtras(array $extras, string $packageName): PackageInterface
private function buildPackageProphecyWithExtras(array $extras, string $packageName): ProphecySubjectInterface
{
/** @var PackageInterface|ObjectProphecy $packageProphecy */
$packageProphecy = $this->prophesize(PackageInterface::class);
Expand Down
4 changes: 2 additions & 2 deletions tests/Unit/Composer/PackageRepositoryTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ class PackageRepositoryTest extends TestCase
private $composer = null;

/**
* @var WritableRepositoryInterface|ProphecySubjectInterface
* @var WritableRepositoryInterface|ObjectProphecy
*/
private $localRepositoryProphecy = null;

Expand Down Expand Up @@ -111,7 +111,7 @@ public function findAllExcludesDuplicates()
/** @var PackageInterface|ObjectProphecy $dependencyAliasProphecy */
$dependencyAliasProphecy = $this->prophesize(PackageInterface::class);
$dependencyAliasProphecy->getName()->willReturn($packageName);
/** @var PackageInterface|ProphecySubjectInterface $dependency1 */
/** @var PackageInterface|ProphecySubjectInterface $dependencyAlias */
$dependencyAlias = $dependencyAliasProphecy->reveal();
$this->localRepositoryProphecy->getPackages()->willReturn([$dependency, $dependencyAlias]);

Expand Down

0 comments on commit 13dcc6f

Please sign in to comment.