Skip to content

Commit 13dcc6f

Browse files
authored
Dropped php7.1 and 7.2 updated some packages. (#321)
* 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]>
1 parent ae51788 commit 13dcc6f

File tree

9 files changed

+30
-19
lines changed

9 files changed

+30
-19
lines changed

.github/workflows/ci.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ jobs:
2222
strategy:
2323
fail-fast: false
2424
matrix:
25-
php-versions: ['7.0', '7.1', '7.2', '7.3', '7.4', '8.0']
25+
php-versions: ['7.2', '7.3', '7.4', '8.0']
2626
steps:
2727
- name: Checkout
2828
uses: actions/checkout@v2
@@ -74,7 +74,7 @@ jobs:
7474
run: vendor/bin/phpunit tests/System/;
7575
continue-on-error: ${{matrix.php-versions == '8.0' }} # [temp-php8]
7676
- name: Running static analysis
77-
run: vendor/bin/phpstan analyse -l 5 bin/ src/ tests/ public/;
77+
run: vendor/bin/phpstan analyse -c phpstan.neon;
7878
continue-on-error: ${{matrix.php-versions == '8.0' }} # [temp-php8]
7979
- name: Running PHPMD
8080
run: vendor/bin/phpmd src/ text config/PHPMD/rules.xml;

composer.json

+4-4
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@
3434
"source": "https://github.com/phpList/core"
3535
},
3636
"require": {
37-
"php": "^7.0|^8.0",
37+
"php": "^7.2|^8.0",
3838
"doctrine/orm": "^2.5.0",
3939
"doctrine/common": "^2.6.0",
4040
"doctrine/doctrine-bundle": "^1.8.0",
@@ -43,7 +43,7 @@
4343
"symfony/dependency-injection": "^3.4.37",
4444
"symfony/config": "^3.4.37",
4545
"symfony/yaml": "^3.4.37",
46-
"jms/serializer-bundle": "^2.3",
46+
"jms/serializer-bundle": "^3.8.0",
4747
"sensio/framework-extra-bundle": "^5.1.0",
4848
"sensio/distribution-bundle": "^5.0.6"
4949
},
@@ -53,8 +53,8 @@
5353
"phpunit/dbunit": "^3.0.0",
5454
"guzzlehttp/guzzle": "^6.3.0",
5555
"squizlabs/php_codesniffer": "^3.2.0",
56-
"phpstan/phpstan": "^0.7.0",
57-
"nette/caching": "^2.5.0 || ^3.0.0",
56+
"phpstan/phpstan": "^0.7.0|0.12.57",
57+
"nette/caching": "^2.5.0|^3.0.0",
5858
"nikic/php-parser": "^3.1.0",
5959
"phpmd/phpmd": "^2.6.0",
6060
"composer/composer": "^1.6.0",

phpstan.neon

+10
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
parameters:
2+
level: 5
3+
paths:
4+
- bin
5+
- src
6+
- tests
7+
- public
8+
ignoreErrors:
9+
- '#Cannot call method (?:willReturn|shouldBeCalledOnce|shouldNotBeCalled|shouldBeCalled|shouldNotHaveBeenCalled)\(\) on .*\.#'
10+
- '#Call to an undefined method [a-zA-Z0-9\\_]+::willReturn\(\)#'

src/Core/Bootstrap.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ protected function __clone()
7575
public static function getInstance(): Bootstrap
7676
{
7777
if (self::$instance === null) {
78-
self::$instance = new static();
78+
self::$instance = new self;
7979
}
8080

8181
return self::$instance;

src/TestingSupport/Traits/DatabaseTestTrait.php

+2-2
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ protected function initializeDatabaseTester()
8080
{
8181
$this->dataSet = new CsvDataSet();
8282

83-
$this->databaseTester = null;
83+
unset($this->databaseTester);
8484
$this->getDatabaseTester()->setSetUpOperation($this->getSetUpOperation());
8585
}
8686

@@ -98,7 +98,7 @@ protected function tearDownDatabaseTest()
9898

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

103103
Bootstrap::purgeInstance();
104104
}

tests/Integration/Domain/Repository/Messaging/SubscriberListRepositoryTest.php

+3-3
Original file line numberDiff line numberDiff line change
@@ -230,8 +230,8 @@ public function findsAssociatedSubscriptions()
230230
$this->getDataSet()->addTable(static::SUBSCRIPTION_TABLE_NAME, __DIR__ . '/../Fixtures/Subscription.csv');
231231
$this->applyDatabaseChanges();
232232

233-
/** @var SubscriberList $model */
234233
$id = 2;
234+
/** @var SubscriberList $model */
235235
$model = $this->subject->find($id);
236236
$subscriptions = $model->getSubscriptions();
237237

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

256-
/** @var SubscriberList $model */
257256
$id = 2;
257+
/** @var SubscriberList $model */
258258
$model = $this->subject->find($id);
259259
$subscribers = $model->getSubscribers();
260260

@@ -276,8 +276,8 @@ public function removeAlsoRemovesAssociatedSubscriptions()
276276

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

279-
/** @var SubscriberList $model */
280279
$id = 2;
280+
/** @var SubscriberList $model */
281281
$model = $this->subject->find($id);
282282

283283
$numberOfAssociatedSubscriptions = count($model->getSubscriptions());

tests/Integration/Domain/Repository/Subscription/SubscriberRepositoryTest.php

+3-3
Original file line numberDiff line numberDiff line change
@@ -237,8 +237,8 @@ public function findsAssociatedSubscriptions()
237237
$this->getDataSet()->addTable(static::SUBSCRIPTION_TABLE_NAME, __DIR__ . '/../Fixtures/Subscription.csv');
238238
$this->applyDatabaseChanges();
239239

240-
/** @var Subscriber $model */
241240
$id = 1;
241+
/** @var Subscriber $model */
242242
$model = $this->subject->find($id);
243243
$subscriptions = $model->getSubscriptions();
244244

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

263-
/** @var Subscriber $model */
264263
$id = 1;
264+
/** @var Subscriber $model */
265265
$model = $this->subject->find($id);
266266
$subscribedLists = $model->getSubscribedLists();
267267

@@ -283,8 +283,8 @@ public function removeAlsoRemovesAssociatedSubscriptions()
283283

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

286-
/** @var Subscriber $model */
287286
$id = 2;
287+
/** @var Subscriber $model */
288288
$model = $this->subject->find($id);
289289

290290
$numberOfAssociatedSubscriptions = count($model->getSubscriptions());

tests/Unit/Composer/ModuleFinderTest.php

+3-2
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,7 @@ public function modulesWithoutBundlesDataProvider(): array
7979
*/
8080
private function buildMockPackagesWithModuleConfiguration(array $extrasSets): array
8181
{
82+
/** @var PackageInterface[][] $moduleSets */
8283
$moduleSets = [];
8384
foreach ($extrasSets as $packageName => $extrasSet) {
8485
$moduleSet = $this->buildSingleMockPackageWithModuleConfiguration($extrasSet);
@@ -108,9 +109,9 @@ private function buildSingleMockPackageWithModuleConfiguration(array $extrasSet)
108109
* @param array $extras
109110
* @param string $packageName
110111
*
111-
* @return PackageInterface|ProphecySubjectInterface
112+
* @return ProphecySubjectInterface
112113
*/
113-
private function buildPackageProphecyWithExtras(array $extras, string $packageName): PackageInterface
114+
private function buildPackageProphecyWithExtras(array $extras, string $packageName): ProphecySubjectInterface
114115
{
115116
/** @var PackageInterface|ObjectProphecy $packageProphecy */
116117
$packageProphecy = $this->prophesize(PackageInterface::class);

tests/Unit/Composer/PackageRepositoryTest.php

+2-2
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ class PackageRepositoryTest extends TestCase
3636
private $composer = null;
3737

3838
/**
39-
* @var WritableRepositoryInterface|ProphecySubjectInterface
39+
* @var WritableRepositoryInterface|ObjectProphecy
4040
*/
4141
private $localRepositoryProphecy = null;
4242

@@ -111,7 +111,7 @@ public function findAllExcludesDuplicates()
111111
/** @var PackageInterface|ObjectProphecy $dependencyAliasProphecy */
112112
$dependencyAliasProphecy = $this->prophesize(PackageInterface::class);
113113
$dependencyAliasProphecy->getName()->willReturn($packageName);
114-
/** @var PackageInterface|ProphecySubjectInterface $dependency1 */
114+
/** @var PackageInterface|ProphecySubjectInterface $dependencyAlias */
115115
$dependencyAlias = $dependencyAliasProphecy->reveal();
116116
$this->localRepositoryProphecy->getPackages()->willReturn([$dependency, $dependencyAlias]);
117117

0 commit comments

Comments
 (0)