Skip to content

Commit

Permalink
Merge branch hotfix/v2.3.28
Browse files Browse the repository at this point in the history
  • Loading branch information
roadiz-ci committed Sep 24, 2024
1 parent 86dd046 commit 403b47c
Show file tree
Hide file tree
Showing 33 changed files with 1,391 additions and 2,031 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/run-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,8 @@ jobs:
${{ runner.os }}-php-${{ matrix.php-version }}-
- name: Install Dependencies
run: composer install --no-scripts --no-ansi --no-interaction --no-progress
- name: Run atoum unit tests
run: vendor/bin/atoum -d tests
- name: Run Unit tests
run: vendor/bin/phpunit -v --whitelist ./src tests
- name: Run PHP Code Sniffer
run: vendor/bin/phpcs -p ./src
- name: Run PHPStan
Expand Down
4 changes: 0 additions & 4 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,7 +1,3 @@
#
# Roadiz
#
/pimple.json

# Ignore Google webmaster tool verification
/google*.html
Expand Down
2 changes: 1 addition & 1 deletion LICENSE.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
The MIT License (MIT)

Copyright © 2023 Ambroise Maupate
Copyright © 2024 Ambroise Maupate

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the “Software”), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

Expand Down
13 changes: 0 additions & 13 deletions Makefile

This file was deleted.

30 changes: 18 additions & 12 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,26 +25,27 @@
"ext-zip": "*",
"ext-simplexml": "*",
"ext-fileinfo": "*",
"doctrine/orm": "~2.17.0",
"doctrine/orm": "~2.19.0",
"enshrined/svg-sanitize": "^0.15",
"guzzlehttp/guzzle": "^7.2.0",
"guzzlehttp/psr7": "^2.0",
"intervention/image": "^2.5",
"league/flysystem": "^3.0",
"monolog/monolog": "^1.24.0 || ^2.1.1",
"symfony/asset": "5.4.*",
"symfony/console": "5.4.*",
"symfony/event-dispatcher": "5.4.*",
"symfony/filesystem": "5.4.*",
"symfony/finder": "5.4.*",
"symfony/http-foundation": "5.4.*",
"symfony/options-resolver": "5.4.*",
"symfony/serializer": "5.4.*",
"symfony/asset": "6.4.*",
"symfony/console": "6.4.*",
"symfony/event-dispatcher": "6.4.*",
"symfony/filesystem": "6.4.*",
"symfony/finder": "6.4.*",
"symfony/http-foundation": "6.4.*",
"symfony/options-resolver": "6.4.*",
"symfony/serializer": "6.4.*",
"twig/twig": "^3.1"
},
"require-dev": {
"php-coveralls/php-coveralls": "^2.4",
"atoum/atoum": "^4.0.0",
"phpunit/phpunit": "^9.5",
"api-platform/metadata": "^3.2.12",
"squizlabs/php_codesniffer": "^3.5",
"phpstan/phpstan": "^1.5.3",
"phpstan/phpstan-doctrine": "^1.3"
Expand All @@ -54,6 +55,11 @@
"RZ\\Roadiz\\Documents\\": "src/"
}
},
"autoload-dev": {
"psr-4": {
"RZ\\Roadiz\\Documents\\Tests\\": "tests/"
}
},
"config": {
"allow-plugins": {
"composer/package-versions-deprecated": true,
Expand All @@ -62,8 +68,8 @@
},
"extra": {
"branch-alias": {
"dev-master": "2.2.x-dev",
"dev-develop": "2.3.x-dev"
"dev-master": "2.3.x-dev",
"dev-develop": "2.4.x-dev"
}
}
}
11 changes: 0 additions & 11 deletions docker-compose.yml

This file was deleted.

6 changes: 3 additions & 3 deletions phpstan.neon
Original file line number Diff line number Diff line change
@@ -1,12 +1,14 @@
parameters:
level: max
level: 7
paths:
- src
excludePaths:
- */node_modules/*
- */bower_components/*
- */static/*
ignoreErrors:
- identifier: missingType.iterableValue
- identifier: missingType.generics
- '#Call to an undefined method Doctrine\\Persistence\\ObjectRepository#'
- '#Call to an undefined method Doctrine\\Persistence\\ObjectManager#'
- '#Call to an undefined method Doctrine\\ORM\\EntityRepository#'
Expand All @@ -20,8 +22,6 @@ parameters:
- '#but returns Doctrine\\Common\\Collections\\ReadableCollection<int, [^\>]+>#'
- '#does not accept Doctrine\\Common\\Collections\\ReadableCollection<int, [^\>]+>#'
reportUnmatchedIgnoredErrors: false
checkMissingIterableValueType: false
checkGenericClassInNonGenericObjectType: false

includes:
- vendor/phpstan/phpstan-doctrine/extension.neon
Expand Down
4 changes: 2 additions & 2 deletions src/Console/DocumentClearFolderCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -36,9 +36,9 @@ protected function getDocumentQueryBuilder(FolderInterface $folder): QueryBuilde
protected function execute(InputInterface $input, OutputInterface $output): int
{
$this->io = new SymfonyStyle($input, $output);
$folderId = $input->getArgument('folderId');

$folderId = intval($input->getArgument('folderId'));
if ($folderId <= 0) {
if (!\is_numeric($folderId) || $folderId <= 0) {
throw new \InvalidArgumentException('Folder ID must be a valid ID');
}
$em = $this->getManager();
Expand Down
5 changes: 1 addition & 4 deletions src/DocumentArchiver.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,8 @@
*/
final class DocumentArchiver
{
private FilesystemOperator $documentsStorage;

public function __construct(FilesystemOperator $documentsStorage)
public function __construct(private readonly FilesystemOperator $documentsStorage)
{
$this->documentsStorage = $documentsStorage;
}

/**
Expand Down
25 changes: 6 additions & 19 deletions src/DownscaleImageManager.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,27 +16,14 @@

final class DownscaleImageManager
{
protected EntityManagerInterface $em;
protected ?LoggerInterface $logger;
protected int $maxPixelSize = 0;
protected string $rawImageSuffix = ".raw";
protected ImageManager $imageManager;
private FilesystemOperator $documentsStorage;

public function __construct(
EntityManagerInterface $em,
FilesystemOperator $documentsStorage,
ImageManager $imageManager,
?LoggerInterface $logger = null,
int $maxPixelSize = 0,
string $rawImageSuffix = ".raw"
private readonly EntityManagerInterface $em,
private readonly FilesystemOperator $documentsStorage,
private readonly ImageManager $imageManager,
private readonly ?LoggerInterface $logger = null,
private readonly int $maxPixelSize = 0,
private readonly string $rawImageSuffix = ".raw"
) {
$this->maxPixelSize = $maxPixelSize;
$this->rawImageSuffix = $rawImageSuffix;
$this->em = $em;
$this->logger = $logger;
$this->imageManager = $imageManager;
$this->documentsStorage = $documentsStorage;
}

/**
Expand Down
8 changes: 1 addition & 7 deletions src/Exceptions/DocumentWithoutFileException.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,17 +8,11 @@

final class DocumentWithoutFileException extends \RuntimeException
{
private DocumentInterface $document;

public function __construct(DocumentInterface $document)
public function __construct(private readonly DocumentInterface $document)
{
$this->document = $document;
parent::__construct(sprintf('Document (%s) does not have a file on system.', (string) $document));
}

/**
* @return DocumentInterface
*/
public function getDocument(): DocumentInterface
{
return $this->document;
Expand Down
Loading

0 comments on commit 403b47c

Please sign in to comment.