Skip to content

Commit

Permalink
chore: Bumped
Browse files Browse the repository at this point in the history
  • Loading branch information
roadiz-ci committed Apr 19, 2024
1 parent 3bf86b1 commit 19ef77e
Show file tree
Hide file tree
Showing 10 changed files with 43 additions and 26 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/run-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
php-version: ['8.1', '8.2', '8.3']
php-version: ['8.0', '8.1']
steps:
- uses: shivammathur/setup-php@v2
with:
Expand Down
19 changes: 19 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
language: php
sudo: required
php:
- 7.4
- 8.0
- 8.1
- nightly
env:
- XDEBUG_MODE=coverage
install:
- curl -s http://getcomposer.org/installer | php
- php composer.phar install --dev --no-interaction
script:
- vendor/bin/phpcs --report=full --report-file=./report.txt -p ./src
- vendor/bin/atoum -d tests
- vendor/bin/phpstan analyse -c phpstan.neon
jobs:
allow_failures:
- php: nightly
8 changes: 4 additions & 4 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,14 +18,14 @@
}
],
"require": {
"php": ">=8.1",
"php": ">=8.0",
"ext-json": "*",
"ext-gd": "*",
"ext-dom": "*",
"ext-zip": "*",
"ext-simplexml": "*",
"ext-fileinfo": "*",
"doctrine/orm": "~2.17.0",
"doctrine/orm": "<2.17",
"enshrined/svg-sanitize": "^0.15",
"guzzlehttp/guzzle": "^7.2.0",
"guzzlehttp/psr7": "^2.0",
Expand Down Expand Up @@ -62,8 +62,8 @@
},
"extra": {
"branch-alias": {
"dev-master": "2.2.x-dev",
"dev-develop": "2.3.x-dev"
"dev-master": "2.1.x-dev",
"dev-develop": "2.2.x-dev"
}
}
}
2 changes: 0 additions & 2 deletions phpstan.neon
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,6 @@ parameters:
- '#Doctrine\\ORM\\Mapping\\GeneratedValue constructor expects#'
- '#type mapping mismatch: property can contain Doctrine\\Common\\Collections\\Collection<int, [^\>]+> but database expects Doctrine\\Common\\Collections\\Collection&iterable<[^\>]+>#'
- '#should return Doctrine\\Common\\Collections\\Collection<int, [^\>]+Interface> but returns Doctrine\\Common\\Collections\\Collection<int, [^\>]+>#'
- '#but returns Doctrine\\Common\\Collections\\ReadableCollection<int, [^\>]+>#'
- '#does not accept Doctrine\\Common\\Collections\\ReadableCollection<int, [^\>]+>#'
reportUnmatchedIgnoredErrors: false
checkMissingIterableValueType: false
checkGenericClassInNonGenericObjectType: false
Expand Down
5 changes: 1 addition & 4 deletions src/AbstractDocumentFinder.php
Original file line number Diff line number Diff line change
Expand Up @@ -53,10 +53,7 @@ public function findPicturesWithFilename(string $fileName): iterable
{
$pathInfo = pathinfo($fileName);
$basename = $pathInfo['filename'];
$currentExtension = $pathInfo['extension'] ?? null;
if (null === $currentExtension) {
return [];
}
$currentExtension = $pathInfo['extension'];

Check failure on line 56 in src/AbstractDocumentFinder.php

View workflow job for this annotation

GitHub Actions / run-tests (8.1)

Offset 'extension' does not exist on array{dirname?: string, basename: string, extension?: string, filename: string}.
$extensionsList = [
'jpg',
'gif',
Expand Down
14 changes: 3 additions & 11 deletions src/DocumentArchiver.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,13 +24,13 @@ public function __construct(FilesystemOperator $documentsStorage)
}

/**
* @param iterable<DocumentInterface> $documents
* @param array $documents
* @param string $name
* @param bool $keepFolders
* @return string Zip file path
* @throws FilesystemException
*/
public function archive(iterable $documents, string $name, bool $keepFolders = true): string
public function archive(array $documents, string $name, bool $keepFolders = true): string
{
$filename = (new AsciiSlugger())->slug($name . ' ' . date('YmdHis'), '_') . '.zip';
$tmpFileName = sys_get_temp_dir() . DIRECTORY_SEPARATOR . $filename;
Expand Down Expand Up @@ -60,16 +60,8 @@ public function archive(iterable $documents, string $name, bool $keepFolders = t
return $tmpFileName;
}

/**
* @param iterable<DocumentInterface> $documents
* @param string $name
* @param bool $keepFolders
* @param bool $unlink
* @return BinaryFileResponse
* @throws FilesystemException
*/
public function archiveAndServe(
iterable $documents,
array $documents,
string $name,
bool $keepFolders = true,
bool $unlink = true
Expand Down
2 changes: 1 addition & 1 deletion src/DownscaleImageManager.php
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ public function processDocumentFromExistingRaw(?DocumentInterface $document = nu
null !== $this->createDocumentFromImage($document, $processImage, true)
&& null !== $this->logger
) {
$this->logger->info('Document has been downscaled.', ['path' => $documentPath, 'entity' => $document]);
$this->logger->info('Document has been downscaled.', ['path' => $documentPath]);
}
}
}
Expand Down
13 changes: 12 additions & 1 deletion src/Models/AdvancedDocumentInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,19 @@

namespace RZ\Roadiz\Documents\Models;

interface AdvancedDocumentInterface extends DocumentInterface, SizeableInterface, DisplayableInterface
interface AdvancedDocumentInterface extends DocumentInterface, SizeableInterface
{
/**
* @return string|null
*/
public function getImageAverageColor(): ?string;

/**
* @param string|null $imageAverageColor
* @return $this
*/
public function setImageAverageColor(?string $imageAverageColor): static;

/**
* @return int|null
*/
Expand Down
2 changes: 1 addition & 1 deletion src/Models/DocumentInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,7 @@ public function setRawDocument(?DocumentInterface $rawDocument = null): static;
public function isRaw(): bool;

/**
* @param bool $raw the raw
* @param boolean $raw the raw
* @return $this
*/
public function setRaw(bool $raw): static;
Expand Down
2 changes: 1 addition & 1 deletion src/Viewers/SvgDocumentViewer.php
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ class SvgDocumentViewer
* @param FilesystemOperator $documentsStorage
* @param DocumentInterface $document
* @param array $attributes
* @param bool $asObject Default false
* @param boolean $asObject Default false
* @param string $imageUrl Only needed if you set $asObject to true.
*/
public function __construct(
Expand Down

0 comments on commit 19ef77e

Please sign in to comment.