Skip to content

Commit 490a067

Browse files
authored
Merge pull request #1 from markusguenther/feature/compatibility-flow8
FEATURE: Make package PHP 8 and Flow 8 compatible
2 parents e680773 + 2b03277 commit 490a067

File tree

5 files changed

+6
-54
lines changed

5 files changed

+6
-54
lines changed

Classes/AbsStorage.php

Lines changed: 1 addition & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -33,13 +33,6 @@
3333
*/
3434
class AbsStorage implements WritableStorageInterface
3535
{
36-
/**
37-
* Name which identifies this resource storage
38-
*
39-
* @var string
40-
*/
41-
protected $name = '';
42-
4336
/**
4437
* Name of the container which should be used as a storage
4538
*
@@ -96,9 +89,8 @@ class AbsStorage implements WritableStorageInterface
9689
* @param array $options Options for this storage
9790
* @throws Exception
9891
*/
99-
public function __construct(string $name, array $options = [])
92+
public function __construct(protected string $name, array $options = [])
10093
{
101-
$this->name = $name;
10294
$this->containerName = $name;
10395
foreach ($options as $key => $value) {
10496
switch ($key) {
@@ -123,7 +115,6 @@ public function __construct(string $name, array $options = [])
123115
/**
124116
* Initialize the Azure Blob Storage service instance
125117
*
126-
* @return void
127118
* @throws Exception
128119
*/
129120
public function initializeObject(): void
@@ -133,8 +124,6 @@ public function initializeObject(): void
133124

134125
/**
135126
* Returns the instance name of this storage
136-
*
137-
* @return string
138127
*/
139128
public function getName(): string
140129
{
@@ -143,8 +132,6 @@ public function getName(): string
143132

144133
/**
145134
* Returns the container name used as a storage
146-
*
147-
* @return string
148135
*/
149136
public function getContainerName(): string
150137
{
@@ -153,8 +140,6 @@ public function getContainerName(): string
153140

154141
/**
155142
* Returns the object key prefix
156-
*
157-
* @return string
158143
*/
159144
public function getKeyPrefix(): string
160145
{
@@ -389,7 +374,6 @@ public function getObjects(): array
389374
/**
390375
* Retrieve all Objects stored in this storage, filtered by the given collection name
391376
*
392-
* @param CollectionInterface $collection
393377
* @return StorageObject[]
394378
* @api
395379
*/

Classes/AbsTarget.php

Lines changed: 2 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -42,13 +42,6 @@
4242
class AbsTarget implements TargetInterface
4343
{
4444

45-
/**
46-
* Name which identifies this resource target
47-
*
48-
* @var string
49-
*/
50-
protected $name = '';
51-
5245
/**
5346
* Name of the Azure Blob Storage container which should be used for publication
5447
*
@@ -171,9 +164,8 @@ class AbsTarget implements TargetInterface
171164
* @param array $options Options for this target
172165
* @throws Exception
173166
*/
174-
public function __construct(string $name, array $options = [])
167+
public function __construct(protected string $name, array $options = [])
175168
{
176-
$this->name = $name;
177169
foreach ($options as $key => $value) {
178170
switch ($key) {
179171
case 'container':
@@ -246,7 +238,6 @@ public function __construct(string $name, array $options = [])
246238
/**
247239
* Initialize the Azure Blob Storage instance
248240
*
249-
* @return void
250241
* @throws BlobStorageException
251242
* @throws Exception
252243
*/
@@ -264,7 +255,7 @@ public function initializeObject(): void
264255
}
265256
$this->baseUri = $object->$methodName(
266257
[
267-
'targetClass' => get_class($this),
258+
'targetClass' => $this::class,
268259
'containerName' => $this->containerName,
269260
'keyPrefix' => $this->keyPrefix,
270261
'baseUri' => $this->baseUri,
@@ -286,17 +277,12 @@ public function getName(): string
286277

287278
/**
288279
* Returns the object key prefix
289-
*
290-
* @return string
291280
*/
292281
public function getKeyPrefix(): string
293282
{
294283
return $this->keyPrefix;
295284
}
296285

297-
/**
298-
* @return string
299-
*/
300286
public function getContainerName(): string
301287
{
302288
return $this->containerName;
@@ -306,7 +292,6 @@ public function getContainerName(): string
306292
* Publishes the whole collection to this target
307293
*
308294
* @param CollectionInterface $collection The collection to publish
309-
* @return void
310295
* @throws \Exception
311296
* @throws \Neos\Flow\Exception
312297
*/
@@ -358,11 +343,6 @@ public function publishCollection(CollectionInterface $collection): void
358343
}
359344

360345
/**
361-
* @param CollectionInterface $collection
362-
* @param AbsStorage $storage
363-
* @param array $existingObjects
364-
* @param array $obsoleteObjects
365-
* @return void
366346
* @throws \Neos\Flow\Exception
367347
*/
368348
private function publishCollectionFromDifferentAzureBlobStorage(CollectionInterface $collection, AbsStorage $storage, array $existingObjects, array &$obsoleteObjects): void
@@ -425,7 +405,6 @@ public function getPublicStaticResourceUri($relativePathAndFilename): string
425405
*
426406
* @param PersistentResource $resource The resource to publish
427407
* @param CollectionInterface $collection The collection the given resource belongs to
428-
* @return void
429408
* @throws Exception
430409
* @throws \Exception
431410
*/
@@ -524,8 +503,6 @@ public function getPublicPersistentResourceUri(PersistentResource $resource): st
524503
* Publishes the specified source file to this target, with the given relative path.
525504
*
526505
* @param resource $sourceStream
527-
* @param string $relativeTargetPathAndFilename
528-
* @param ResourceMetaDataInterface $metaData
529506
* @throws \Exception
530507
*/
531508
protected function publishFile($sourceStream, string $relativeTargetPathAndFilename, ResourceMetaDataInterface $metaData): void
@@ -596,9 +573,6 @@ protected function getRelativePublicationPathAndFilename(ResourceMetaDataInterfa
596573

597574
/**
598575
* Applies rawurlencode() to all path segments of the given $relativePathAndFilename
599-
*
600-
* @param string $relativePathAndFilename
601-
* @return string
602576
*/
603577
private function encodeRelativePathAndFilenameForUri(string $relativePathAndFilename): string
604578
{
@@ -607,9 +581,6 @@ private function encodeRelativePathAndFilenameForUri(string $relativePathAndFile
607581

608582
/**
609583
* Checks if the containers as storage and target are the same
610-
*
611-
* @param CollectionInterface $collection
612-
* @return bool
613584
*/
614585
private function isOneContainerSetup(CollectionInterface $collection): bool
615586
{

Classes/BlobServiceFactory.php

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,8 +34,6 @@ class BlobServiceFactory
3434
/**
3535
* Creates a new BlobRestProxy instance and authenticates against the Azure API
3636
*
37-
* @param string $credentialsProfileName
38-
* @return BlobRestProxy
3937
* @throws Exception
4038
*/
4139
public function create(string $credentialsProfileName = 'default'): BlobRestProxy

Classes/Command/AbsCommandController.php

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,6 @@ final class AbsCommandController extends CommandController
5151
* This command checks if the configured credentials and connectivity allows for connecting with the Azure API.
5252
*
5353
* @param string $container The container which is used for trying to upload and retrieve some test data
54-
* @return void
5554
*/
5655
public function connectCommand(string $container): void
5756
{
@@ -118,7 +117,7 @@ public function republishCommand(string $collection = 'persistent'): void
118117
} catch (\Exception $e) {
119118
$this->outputLine('<error>Publishing failed</error>');
120119
$this->outputLine($e->getMessage());
121-
$this->outputLine(get_class($e));
120+
$this->outputLine($e::class);
122121
exit(2);
123122
}
124123
$this->output->progressFinish();
@@ -205,7 +204,6 @@ public function updateResourceMetadataCommand(string $collection = 'persistent',
205204
}
206205

207206
/**
208-
* @param string $collectionName
209207
* @return array [CollectionInterface, TargetInterface]
210208
*/
211209
private function getResourceCollectionAndTarget(string $collectionName): array

composer.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,8 @@
2020
"MIT"
2121
],
2222
"require": {
23-
"neos/flow": "^7.0",
23+
"php": "^8.0",
24+
"neos/flow": "^7.0 || ^8.0",
2425
"microsoft/azure-storage-blob": "^1.5"
2526
},
2627
"autoload": {

0 commit comments

Comments
 (0)