mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2026-01-15 05:41:25 +00:00
Apply new rector rules regarding to PHP version to 8.4
This commit is contained in:
@@ -20,7 +20,7 @@ use Symfony\Component\Routing\Generator\UrlGeneratorInterface;
|
||||
|
||||
class TempUrlLocalStorageGenerator implements TempUrlGeneratorInterface
|
||||
{
|
||||
private const SIGNATURE_DURATION = 180;
|
||||
private const int SIGNATURE_DURATION = 180;
|
||||
|
||||
public function __construct(
|
||||
private readonly string $secret,
|
||||
|
||||
@@ -26,7 +26,7 @@ use Symfony\Component\EventDispatcher\EventDispatcherInterface;
|
||||
*/
|
||||
final readonly class TempUrlOpenstackGenerator implements TempUrlGeneratorInterface
|
||||
{
|
||||
private const CHARACTERS = '0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ';
|
||||
private const string CHARACTERS = '0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ';
|
||||
|
||||
private string $base_url;
|
||||
private string $key;
|
||||
|
||||
@@ -15,7 +15,7 @@ use Chill\DocStoreBundle\AsyncUpload\SignedUrl;
|
||||
|
||||
final class TempUrlGenerateEvent extends \Symfony\Contracts\EventDispatcher\Event
|
||||
{
|
||||
final public const NAME_GENERATE = 'async_uploader.generate_url';
|
||||
final public const string NAME_GENERATE = 'async_uploader.generate_url';
|
||||
|
||||
public function __construct(private readonly SignedUrl $data) {}
|
||||
|
||||
|
||||
@@ -69,7 +69,7 @@ final readonly class WebdavController
|
||||
throw new AccessDeniedHttpException();
|
||||
}
|
||||
|
||||
$response = (new DavResponse(''))
|
||||
$response = new DavResponse('')
|
||||
->setEtag($this->storedObjectManager->etag($storedObject))
|
||||
;
|
||||
|
||||
@@ -121,7 +121,7 @@ final readonly class WebdavController
|
||||
throw new AccessDeniedHttpException();
|
||||
}
|
||||
|
||||
return (new DavResponse($this->storedObjectManager->read($storedObject)))
|
||||
return new DavResponse($this->storedObjectManager->read($storedObject))
|
||||
->setEtag($this->storedObjectManager->etag($storedObject));
|
||||
}
|
||||
|
||||
@@ -152,7 +152,7 @@ final readonly class WebdavController
|
||||
throw new AccessDeniedHttpException();
|
||||
}
|
||||
|
||||
$response = (new DavResponse(''))
|
||||
$response = new DavResponse('')
|
||||
->setEtag($this->storedObjectManager->etag($storedObject))
|
||||
;
|
||||
|
||||
|
||||
@@ -68,15 +68,15 @@ class LoadDocumentACL extends AbstractFixture implements OrderedFixtureInterface
|
||||
$permissionsGroup->getName(),
|
||||
$scope->getName()['en']
|
||||
);
|
||||
$roleScopeUpdate = (new RoleScope())
|
||||
$roleScopeUpdate = new RoleScope()
|
||||
->setRole(PersonDocumentVoter::CREATE)
|
||||
->setScope($scope);
|
||||
$permissionsGroup->addRoleScope($roleScopeUpdate);
|
||||
$roleScopeCreate = (new RoleScope())
|
||||
$roleScopeCreate = new RoleScope()
|
||||
->setRole(PersonDocumentVoter::UPDATE)
|
||||
->setScope($scope);
|
||||
$permissionsGroup->addRoleScope($roleScopeCreate);
|
||||
$roleScopeDelete = (new RoleScope())
|
||||
$roleScopeDelete = new RoleScope()
|
||||
->setRole(PersonDocumentVoter::DELETE)
|
||||
->setScope($scope);
|
||||
$permissionsGroup->addRoleScope($roleScopeDelete);
|
||||
|
||||
@@ -25,7 +25,7 @@ class LoadDocumentCategory extends AbstractFixture implements OrderedFixtureInte
|
||||
|
||||
public function load(ObjectManager $manager): void
|
||||
{
|
||||
$category = (new DocumentCategory('chill-doc-store', 10))
|
||||
$category = new DocumentCategory('chill-doc-store', 10)
|
||||
->setDocumentClass(\Chill\DocStoreBundle\Entity\PersonDocument::class)
|
||||
->setName([
|
||||
'fr' => "Document d'identité",
|
||||
@@ -34,7 +34,7 @@ class LoadDocumentCategory extends AbstractFixture implements OrderedFixtureInte
|
||||
|
||||
$manager->persist($category);
|
||||
|
||||
$category = (new DocumentCategory('chill-doc-store', 20))
|
||||
$category = new DocumentCategory('chill-doc-store', 20)
|
||||
->setDocumentClass(\Chill\DocStoreBundle\Entity\PersonDocument::class)
|
||||
->setName([
|
||||
'fr' => 'Courrier reçu',
|
||||
|
||||
@@ -18,7 +18,7 @@ use Chill\DocStoreBundle\Dav\Exception\ParseRequestException;
|
||||
*/
|
||||
class PropfindRequestAnalyzer
|
||||
{
|
||||
private const KNOWN_PROPS = [
|
||||
private const array KNOWN_PROPS = [
|
||||
'resourceType',
|
||||
'contentType',
|
||||
'lastModified',
|
||||
|
||||
@@ -23,13 +23,13 @@ use Symfony\Component\DependencyInjection\ContainerBuilder;
|
||||
|
||||
class StorageConfigurationCompilerPass implements CompilerPassInterface
|
||||
{
|
||||
private const SERVICES_OPENSTACK = [
|
||||
private const array SERVICES_OPENSTACK = [
|
||||
\Chill\DocStoreBundle\AsyncUpload\Driver\OpenstackObjectStore\StoredObjectManager::class,
|
||||
TempUrlOpenstackGenerator::class,
|
||||
ConfigureOpenstackObjectStorageCommand::class,
|
||||
];
|
||||
|
||||
private const SERVICES_LOCAL_STORAGE = [
|
||||
private const array SERVICES_LOCAL_STORAGE = [
|
||||
\Chill\DocStoreBundle\AsyncUpload\Driver\LocalStorage\StoredObjectManager::class,
|
||||
TempUrlLocalStorageGenerator::class,
|
||||
StoredObjectContentToLocalStorageController::class,
|
||||
|
||||
@@ -44,10 +44,10 @@ use Symfony\Component\Validator\Constraints as Assert;
|
||||
class StoredObject implements Document, TrackCreationInterface
|
||||
{
|
||||
use TrackCreationTrait;
|
||||
final public const STATUS_EMPTY = 'empty';
|
||||
final public const STATUS_READY = 'ready';
|
||||
final public const STATUS_PENDING = 'pending';
|
||||
final public const STATUS_FAILURE = 'failure';
|
||||
final public const string STATUS_EMPTY = 'empty';
|
||||
final public const string STATUS_READY = 'ready';
|
||||
final public const string STATUS_PENDING = 'pending';
|
||||
final public const string STATUS_FAILURE = 'failure';
|
||||
|
||||
#[Serializer\Groups(['write'])]
|
||||
#[ORM\Column(type: \Doctrine\DBAL\Types\Types::JSON, name: 'datas')]
|
||||
@@ -116,10 +116,8 @@ class StoredObject implements Document, TrackCreationInterface
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* @deprecated
|
||||
*/
|
||||
#[Serializer\Groups(['write'])]
|
||||
#[\Deprecated]
|
||||
public function getCreationDate(): \DateTime
|
||||
{
|
||||
if (null === $this->createdAt) {
|
||||
@@ -183,9 +181,7 @@ class StoredObject implements Document, TrackCreationInterface
|
||||
return $this->getCurrentVersion()?->getKeyInfos() ?? [];
|
||||
}
|
||||
|
||||
/**
|
||||
* @deprecated use method "getFilename()"
|
||||
*/
|
||||
#[\Deprecated(message: 'use method "getFilename()"')]
|
||||
public function getObjectName(): string
|
||||
{
|
||||
return $this->getFilename();
|
||||
@@ -219,10 +215,8 @@ class StoredObject implements Document, TrackCreationInterface
|
||||
return (string) $this->uuid;
|
||||
}
|
||||
|
||||
/**
|
||||
* @deprecated
|
||||
*/
|
||||
#[Serializer\Groups(['write'])]
|
||||
#[\Deprecated]
|
||||
public function setCreationDate(\DateTime $creationDate): self
|
||||
{
|
||||
$this->createdAt = \DateTimeImmutable::createFromMutable($creationDate);
|
||||
@@ -419,9 +413,7 @@ class StoredObject implements Document, TrackCreationInterface
|
||||
$this->versions->removeElement($storedObjectVersion);
|
||||
}
|
||||
|
||||
/**
|
||||
* @deprecated
|
||||
*/
|
||||
#[\Deprecated]
|
||||
public function saveHistory(): void {}
|
||||
|
||||
public static function generatePrefix(): string
|
||||
|
||||
@@ -30,6 +30,7 @@ class CollectionStoredObjectType extends AbstractType
|
||||
->setDefault('js_caller', 'data-collection-stored-object');
|
||||
}
|
||||
|
||||
#[\Override]
|
||||
public function getParent(): ?string
|
||||
{
|
||||
return ChillCollectionType::class;
|
||||
|
||||
@@ -70,6 +70,7 @@ class AsyncUploaderType extends AbstractType
|
||||
$view->vars['attr']['data-max-post-size'] = $options['max_post_size'];
|
||||
}
|
||||
|
||||
#[\Override]
|
||||
public function getParent(): ?string
|
||||
{
|
||||
return HiddenType::class;
|
||||
|
||||
@@ -15,7 +15,7 @@ use Doctrine\DBAL\Types\Types;
|
||||
|
||||
final readonly class FetchQueryToSqlBuilder
|
||||
{
|
||||
private const SQL = <<<'SQL'
|
||||
private const string SQL = <<<'SQL'
|
||||
SELECT
|
||||
'{{ key }}' AS key,
|
||||
{{ identifiers }} AS identifiers,
|
||||
|
||||
@@ -29,7 +29,7 @@ use Symfony\Bundle\SecurityBundle\Security;
|
||||
|
||||
final readonly class AccompanyingCourseDocumentGenericDocProvider implements GenericDocForAccompanyingPeriodProviderInterface, GenericDocForPersonProviderInterface
|
||||
{
|
||||
public const KEY = 'accompanying_course_document';
|
||||
public const string KEY = 'accompanying_course_document';
|
||||
|
||||
public function __construct(
|
||||
private Security $security,
|
||||
|
||||
@@ -25,7 +25,7 @@ use Symfony\Bundle\SecurityBundle\Security;
|
||||
|
||||
final readonly class PersonDocumentGenericDocProvider implements GenericDocForPersonProviderInterface, GenericDocForAccompanyingPeriodProviderInterface
|
||||
{
|
||||
public const KEY = 'person_document';
|
||||
public const string KEY = 'person_document';
|
||||
|
||||
public function __construct(
|
||||
private Security $security,
|
||||
|
||||
@@ -16,6 +16,7 @@ use Twig\TwigFilter;
|
||||
|
||||
final class GenericDocExtension extends AbstractExtension
|
||||
{
|
||||
#[\Override]
|
||||
public function getFilters()
|
||||
{
|
||||
return [
|
||||
|
||||
@@ -17,14 +17,10 @@ use Chill\PersonBundle\Entity\Person;
|
||||
|
||||
interface PersonDocumentACLAwareRepositoryInterface
|
||||
{
|
||||
/**
|
||||
* @deprecated use fetch query for listing and counting person documents
|
||||
*/
|
||||
#[\Deprecated(message: 'use fetch query for listing and counting person documents')]
|
||||
public function countByPerson(Person $person): int;
|
||||
|
||||
/**
|
||||
* @deprecated use fetch query for listing and counting person documents
|
||||
*/
|
||||
#[\Deprecated(message: 'use fetch query for listing and counting person documents')]
|
||||
public function findByPerson(Person $person, array $orderBy = [], int $limit = 20, int $offset = 0): array;
|
||||
|
||||
public function buildFetchQueryForPerson(
|
||||
|
||||
@@ -75,7 +75,7 @@ class StoredObjectVersionRepository implements ObjectRepository
|
||||
}
|
||||
}
|
||||
|
||||
private const QUERY_FIND_IDS_BY_VERSIONS_OLDER_THAN_DATE_AND_NOT_LAST_VERSION = <<<'SQL'
|
||||
private const string QUERY_FIND_IDS_BY_VERSIONS_OLDER_THAN_DATE_AND_NOT_LAST_VERSION = <<<'SQL'
|
||||
SELECT
|
||||
sov.id AS sov_id
|
||||
FROM chill_doc.stored_object_version sov
|
||||
|
||||
@@ -25,15 +25,15 @@ use Symfony\Bundle\SecurityBundle\Security;
|
||||
|
||||
class AccompanyingCourseDocumentVoter extends AbstractChillVoter implements ProvideRoleHierarchyInterface
|
||||
{
|
||||
final public const CREATE = 'CHILL_ACCOMPANYING_COURSE_DOCUMENT_CREATE';
|
||||
final public const string CREATE = 'CHILL_ACCOMPANYING_COURSE_DOCUMENT_CREATE';
|
||||
|
||||
final public const DELETE = 'CHILL_ACCOMPANYING_COURSE_DOCUMENT_DELETE';
|
||||
final public const string DELETE = 'CHILL_ACCOMPANYING_COURSE_DOCUMENT_DELETE';
|
||||
|
||||
final public const SEE = 'CHILL_ACCOMPANYING_COURSE_DOCUMENT_SEE';
|
||||
final public const string SEE = 'CHILL_ACCOMPANYING_COURSE_DOCUMENT_SEE';
|
||||
|
||||
final public const SEE_DETAILS = 'CHILL_ACCOMPANYING_COURSE_DOCUMENT_SEE_DETAILS';
|
||||
final public const string SEE_DETAILS = 'CHILL_ACCOMPANYING_COURSE_DOCUMENT_SEE_DETAILS';
|
||||
|
||||
final public const UPDATE = 'CHILL_ACCOMPANYING_COURSE_DOCUMENT_UPDATE';
|
||||
final public const string UPDATE = 'CHILL_ACCOMPANYING_COURSE_DOCUMENT_UPDATE';
|
||||
|
||||
protected VoterHelperInterface $voterHelper;
|
||||
|
||||
|
||||
@@ -19,7 +19,7 @@ use Symfony\Bundle\SecurityBundle\Security;
|
||||
|
||||
final class AsyncUploadVoter extends Voter
|
||||
{
|
||||
public const GENERATE_SIGNATURE = 'CHILL_DOC_GENERATE_ASYNC_SIGNATURE';
|
||||
public const string GENERATE_SIGNATURE = 'CHILL_DOC_GENERATE_ASYNC_SIGNATURE';
|
||||
|
||||
public function __construct(
|
||||
private readonly Security $security,
|
||||
|
||||
@@ -25,15 +25,15 @@ use Symfony\Bundle\SecurityBundle\Security;
|
||||
|
||||
class PersonDocumentVoter extends AbstractChillVoter implements ProvideRoleHierarchyInterface
|
||||
{
|
||||
final public const CREATE = 'CHILL_PERSON_DOCUMENT_CREATE';
|
||||
final public const string CREATE = 'CHILL_PERSON_DOCUMENT_CREATE';
|
||||
|
||||
final public const DELETE = 'CHILL_PERSON_DOCUMENT_DELETE';
|
||||
final public const string DELETE = 'CHILL_PERSON_DOCUMENT_DELETE';
|
||||
|
||||
final public const SEE = 'CHILL_PERSON_DOCUMENT_SEE';
|
||||
final public const string SEE = 'CHILL_PERSON_DOCUMENT_SEE';
|
||||
|
||||
final public const SEE_DETAILS = 'CHILL_PERSON_DOCUMENT_SEE_DETAILS';
|
||||
final public const string SEE_DETAILS = 'CHILL_PERSON_DOCUMENT_SEE_DETAILS';
|
||||
|
||||
final public const UPDATE = 'CHILL_PERSON_DOCUMENT_UPDATE';
|
||||
final public const string UPDATE = 'CHILL_PERSON_DOCUMENT_UPDATE';
|
||||
|
||||
protected VoterHelperInterface $voterHelper;
|
||||
|
||||
|
||||
@@ -21,8 +21,8 @@ use Symfony\Component\EventDispatcher\EventSubscriberInterface;
|
||||
*/
|
||||
class DavTokenAuthenticationEventSubscriber implements EventSubscriberInterface
|
||||
{
|
||||
final public const STORED_OBJECT = 'stored_object';
|
||||
final public const ACTIONS = 'stored_objects_actions';
|
||||
final public const string STORED_OBJECT = 'stored_object';
|
||||
final public const string ACTIONS = 'stored_objects_actions';
|
||||
|
||||
public static function getSubscribedEvents(): array
|
||||
{
|
||||
|
||||
@@ -34,6 +34,7 @@ class JWTOnDavUrlAuthenticator extends JWTAuthenticator
|
||||
parent::__construct($jwtManager, $dispatcher, $tokenExtractor, $userProvider, $translator);
|
||||
}
|
||||
|
||||
#[\Override]
|
||||
protected function getTokenExtractor(): TokenExtractorInterface
|
||||
{
|
||||
return $this->davOnUrlTokenExtractor;
|
||||
|
||||
@@ -35,7 +35,7 @@ final class StoredObjectNormalizer implements NormalizerInterface, NormalizerAwa
|
||||
* when added to the groups, a download link is included in the normalization,
|
||||
* and no webdav links are generated.
|
||||
*/
|
||||
public const DOWNLOAD_LINK_ONLY = 'read:download-link-only';
|
||||
public const string DOWNLOAD_LINK_ONLY = 'read:download-link-only';
|
||||
|
||||
public function __construct(
|
||||
private readonly JWTDavTokenProviderInterface $JWTDavTokenProvider,
|
||||
|
||||
@@ -22,9 +22,9 @@ class StoredObjectVersionNormalizer implements NormalizerInterface, NormalizerAw
|
||||
{
|
||||
use NormalizerAwareTrait;
|
||||
|
||||
final public const WITH_POINT_IN_TIMES_CONTEXT = 'with-point-in-times';
|
||||
final public const string WITH_POINT_IN_TIMES_CONTEXT = 'with-point-in-times';
|
||||
|
||||
final public const WITH_RESTORED_CONTEXT = 'with-restored';
|
||||
final public const string WITH_RESTORED_CONTEXT = 'with-restored';
|
||||
|
||||
public function normalize($object, ?string $format = null, array $context = []): string|int|float|bool|\ArrayObject|array|null
|
||||
{
|
||||
|
||||
@@ -24,7 +24,7 @@ final readonly class PdfSignedMessageHandler
|
||||
/**
|
||||
* log prefix.
|
||||
*/
|
||||
private const P = '[pdf signed message] ';
|
||||
private const string P = '[pdf signed message] ';
|
||||
|
||||
public function __construct(
|
||||
private LoggerInterface $logger,
|
||||
|
||||
@@ -25,9 +25,9 @@ use Symfony\Component\Messenger\MessageBusInterface;
|
||||
*/
|
||||
final readonly class RemoveExpiredStoredObjectCronJob implements CronJobInterface
|
||||
{
|
||||
public const KEY = 'remove-expired-stored-object';
|
||||
public const string KEY = 'remove-expired-stored-object';
|
||||
|
||||
private const LAST_DELETED_KEY = 'last-deleted-stored-object-id';
|
||||
private const string LAST_DELETED_KEY = 'last-deleted-stored-object-id';
|
||||
|
||||
public function __construct(
|
||||
private ClockInterface $clock,
|
||||
|
||||
@@ -19,11 +19,11 @@ use Symfony\Component\Messenger\MessageBusInterface;
|
||||
|
||||
final readonly class RemoveOldVersionCronJob implements CronJobInterface
|
||||
{
|
||||
public const KEY = 'remove-old-stored-object-version';
|
||||
public const string KEY = 'remove-old-stored-object-version';
|
||||
|
||||
private const LAST_DELETED_KEY = 'last-deleted-stored-object-version-id';
|
||||
private const string LAST_DELETED_KEY = 'last-deleted-stored-object-version-id';
|
||||
|
||||
public const KEEP_INTERVAL = 'P90D';
|
||||
public const string KEEP_INTERVAL = 'P90D';
|
||||
|
||||
public function __construct(
|
||||
private ClockInterface $clock,
|
||||
|
||||
@@ -33,7 +33,7 @@ use Symfony\Component\Messenger\Handler\MessageHandlerInterface;
|
||||
#[\Symfony\Component\Messenger\Attribute\AsMessageHandler]
|
||||
final readonly class RemoveOldVersionMessageHandler
|
||||
{
|
||||
private const LOG_PREFIX = '[RemoveOldVersionMessageHandler] ';
|
||||
private const string LOG_PREFIX = '[RemoveOldVersionMessageHandler] ';
|
||||
|
||||
public function __construct(
|
||||
private StoredObjectVersionRepository $storedObjectVersionRepository,
|
||||
|
||||
@@ -17,6 +17,7 @@ use Twig\TwigFunction;
|
||||
|
||||
class WopiEditTwigExtension extends AbstractExtension
|
||||
{
|
||||
#[\Override]
|
||||
public function getFilters(): array
|
||||
{
|
||||
return [
|
||||
@@ -35,6 +36,7 @@ class WopiEditTwigExtension extends AbstractExtension
|
||||
];
|
||||
}
|
||||
|
||||
#[\Override]
|
||||
public function getFunctions(): array
|
||||
{
|
||||
return [
|
||||
|
||||
@@ -25,7 +25,7 @@ use Twig\Extension\RuntimeExtensionInterface;
|
||||
|
||||
final readonly class WopiEditTwigExtensionRuntime implements RuntimeExtensionInterface
|
||||
{
|
||||
public const SUPPORTED_MIMES = [
|
||||
public const array SUPPORTED_MIMES = [
|
||||
'image/svg+xml',
|
||||
'application/vnd.ms-powerpoint',
|
||||
'application/vnd.ms-excel',
|
||||
@@ -117,13 +117,13 @@ final readonly class WopiEditTwigExtensionRuntime implements RuntimeExtensionInt
|
||||
'application/pdf',
|
||||
];
|
||||
|
||||
private const DEFAULT_OPTIONS_TEMPLATE_BUTTON_GROUP = [
|
||||
private const array DEFAULT_OPTIONS_TEMPLATE_BUTTON_GROUP = [
|
||||
'small' => false,
|
||||
];
|
||||
|
||||
private const TEMPLATE = '@ChillDocStore/Button/wopi_edit_document.html.twig';
|
||||
private const string TEMPLATE = '@ChillDocStore/Button/wopi_edit_document.html.twig';
|
||||
|
||||
private const TEMPLATE_BUTTON_GROUP = '@ChillDocStore/Button/button_group.html.twig';
|
||||
private const string TEMPLATE_BUTTON_GROUP = '@ChillDocStore/Button/button_group.html.twig';
|
||||
|
||||
public function __construct(
|
||||
private DiscoveryInterface $discovery,
|
||||
|
||||
@@ -25,7 +25,7 @@ use Symfony\Component\DependencyInjection\ParameterBag\ParameterBag;
|
||||
*/
|
||||
class StoredObjectManagerTest extends TestCase
|
||||
{
|
||||
private const CONTENT = 'abcde';
|
||||
private const string CONTENT = 'abcde';
|
||||
|
||||
public function testWrite(): StoredObjectVersion
|
||||
{
|
||||
@@ -108,7 +108,7 @@ class StoredObjectManagerTest extends TestCase
|
||||
$actual = $manager->getLastModified($version);
|
||||
|
||||
self::assertInstanceOf(\DateTimeImmutable::class, $actual);
|
||||
self::assertGreaterThan((new \DateTimeImmutable('now'))->getTimestamp() - 10, $actual->getTimestamp());
|
||||
self::assertGreaterThan(new \DateTimeImmutable('now')->getTimestamp() - 10, $actual->getTimestamp());
|
||||
|
||||
return $version;
|
||||
}
|
||||
|
||||
@@ -27,7 +27,7 @@ class TempUrlLocalStorageGeneratorTest extends TestCase
|
||||
{
|
||||
use ProphecyTrait;
|
||||
|
||||
private const SECRET = 'abc';
|
||||
private const string SECRET = 'abc';
|
||||
|
||||
public function testGenerate(): void
|
||||
{
|
||||
|
||||
@@ -51,7 +51,7 @@ final class StoredObjectManagerTest extends TestCase
|
||||
|
||||
// Encrypted object
|
||||
yield [
|
||||
(new StoredObject())
|
||||
new StoredObject()
|
||||
->registerVersion(
|
||||
unpack('C*', 'abcdefghijklmnop'),
|
||||
['k' => base64_encode('S9NIHMaFHOWzLPez3jZOIHBaNfBrMQUR5zvqBz6kme8')],
|
||||
@@ -63,7 +63,7 @@ final class StoredObjectManagerTest extends TestCase
|
||||
|
||||
// Non-encrypted object
|
||||
yield [
|
||||
(new StoredObject())->registerVersion(filename: 'non-encrypted.txt')->getStoredObject(), // The StoredObject
|
||||
new StoredObject()->registerVersion(filename: 'non-encrypted.txt')->getStoredObject(), // The StoredObject
|
||||
'The quick brown fox jumps over the lazy dog', // Encrypted
|
||||
'The quick brown fox jumps over the lazy dog', // Clear
|
||||
];
|
||||
@@ -72,7 +72,7 @@ final class StoredObjectManagerTest extends TestCase
|
||||
|
||||
// Encrypted object with issue during HTTP communication
|
||||
yield [
|
||||
(new StoredObject())
|
||||
new StoredObject()
|
||||
->registerVersion(
|
||||
unpack('C*', 'abcdefghijklmnop'),
|
||||
['k' => base64_encode('S9NIHMaFHOWzLPez3jZOIHBaNfBrMQUR5zvqBz6kme8')],
|
||||
@@ -85,7 +85,7 @@ final class StoredObjectManagerTest extends TestCase
|
||||
|
||||
// Encrypted object with issue during HTTP communication: Invalid status code
|
||||
yield [
|
||||
(new StoredObject())
|
||||
new StoredObject()
|
||||
->registerVersion(
|
||||
unpack('C*', 'abcdefghijklmnop'),
|
||||
['k' => base64_encode('S9NIHMaFHOWzLPez3jZOIHBaNfBrMQUR5zvqBz6kme8')],
|
||||
@@ -98,7 +98,7 @@ final class StoredObjectManagerTest extends TestCase
|
||||
|
||||
// Erroneous encrypted: Unable to decrypt exception.
|
||||
yield [
|
||||
(new StoredObject())
|
||||
new StoredObject()
|
||||
->registerVersion(
|
||||
unpack('C*', 'abcdefghijklmnop'),
|
||||
['k' => base64_encode('WRONG_PASS_PHRASE')],
|
||||
@@ -150,7 +150,7 @@ final class StoredObjectManagerTest extends TestCase
|
||||
|
||||
// Encrypted object
|
||||
yield [
|
||||
(new StoredObject())
|
||||
new StoredObject()
|
||||
->registerVersion(
|
||||
unpack('C*', 'abcdefghijklmnop'),
|
||||
['k' => base64_encode('S9NIHMaFHOWzLPez3jZOIHBaNfBrMQUR5zvqBz6kme8')],
|
||||
@@ -162,7 +162,7 @@ final class StoredObjectManagerTest extends TestCase
|
||||
|
||||
// Non-encrypted object
|
||||
yield [
|
||||
(new StoredObject())->registerVersion(filename: 'non-encrypted.txt')->getStoredObject(), // The StoredObject
|
||||
new StoredObject()->registerVersion(filename: 'non-encrypted.txt')->getStoredObject(), // The StoredObject
|
||||
'The quick brown fox jumps over the lazy dog', // Encrypted
|
||||
'The quick brown fox jumps over the lazy dog', // Clear
|
||||
];
|
||||
@@ -171,7 +171,7 @@ final class StoredObjectManagerTest extends TestCase
|
||||
|
||||
// Encrypted object with issue during HTTP communication
|
||||
yield [
|
||||
(new StoredObject())
|
||||
new StoredObject()
|
||||
->registerVersion(
|
||||
unpack('C*', 'abcdefghijklmnop'),
|
||||
['k' => base64_encode('S9NIHMaFHOWzLPez3jZOIHBaNfBrMQUR5zvqBz6kme8')],
|
||||
@@ -185,7 +185,7 @@ final class StoredObjectManagerTest extends TestCase
|
||||
|
||||
// Encrypted object with issue during HTTP communication: Invalid status code
|
||||
yield [
|
||||
(new StoredObject())
|
||||
new StoredObject()
|
||||
->registerVersion(
|
||||
unpack('C*', 'abcdefghijklmnop'),
|
||||
['k' => base64_encode('S9NIHMaFHOWzLPez3jZOIHBaNfBrMQUR5zvqBz6kme8')],
|
||||
@@ -291,7 +291,7 @@ final class StoredObjectManagerTest extends TestCase
|
||||
|
||||
public function testGetLastModifiedWithDateTimeFromResponse(): void
|
||||
{
|
||||
$storedObject = (new StoredObject())->registerVersion()->getStoredObject();
|
||||
$storedObject = new StoredObject()->registerVersion()->getStoredObject();
|
||||
|
||||
$client = new MockHttpClient(
|
||||
new MockResponse('', ['http_code' => 200, 'response_headers' => [
|
||||
|
||||
@@ -35,8 +35,8 @@ class TempUrlOpenstackGeneratorTest extends KernelTestCase
|
||||
private ParameterBagInterface $parameterBag;
|
||||
private HttpClientInterface $client;
|
||||
|
||||
private const TESTING_OBJECT_NAME_PREFIX = 'test-prefix-o0o008wk404gcos40k8s4s4c44cgwwos4k4o8k/';
|
||||
private const TESTING_OBJECT_NAME = 'object-name-4fI0iAtq';
|
||||
private const string TESTING_OBJECT_NAME_PREFIX = 'test-prefix-o0o008wk404gcos40k8s4s4c44cgwwos4k4o8k/';
|
||||
private const string TESTING_OBJECT_NAME = 'object-name-4fI0iAtq';
|
||||
|
||||
private function setUpIntegration(): void
|
||||
{
|
||||
|
||||
@@ -70,7 +70,7 @@ class AsyncUploadExtensionTest extends KernelTestCase
|
||||
|
||||
public static function dataProviderStoredObject(): iterable
|
||||
{
|
||||
yield [(new StoredObject())->registerVersion(filename: 'blabla')->getStoredObject()];
|
||||
yield [new StoredObject()->registerVersion(filename: 'blabla')->getStoredObject()];
|
||||
|
||||
yield ['blabla'];
|
||||
}
|
||||
|
||||
@@ -82,7 +82,7 @@ class StoredObjectContentToLocalStorageControllerTest extends TestCase
|
||||
];
|
||||
|
||||
yield [
|
||||
new Request(['object_name' => 'testABC', 'sig' => '', 'exp' => (new \DateTimeImmutable())->getTimestamp()]),
|
||||
new Request(['object_name' => 'testABC', 'sig' => '', 'exp' => new \DateTimeImmutable()->getTimestamp()]),
|
||||
BadRequestHttpException::class,
|
||||
'Signature is not set or is a blank string',
|
||||
false,
|
||||
@@ -91,7 +91,7 @@ class StoredObjectContentToLocalStorageControllerTest extends TestCase
|
||||
];
|
||||
|
||||
yield [
|
||||
new Request(['object_name' => 'testABC', 'sig' => '1234', 'exp' => (new \DateTimeImmutable())->getTimestamp()]),
|
||||
new Request(['object_name' => 'testABC', 'sig' => '1234', 'exp' => new \DateTimeImmutable()->getTimestamp()]),
|
||||
AccessDeniedHttpException::class,
|
||||
'Invalid signature',
|
||||
false,
|
||||
@@ -101,7 +101,7 @@ class StoredObjectContentToLocalStorageControllerTest extends TestCase
|
||||
|
||||
|
||||
yield [
|
||||
new Request(['object_name' => 'testABC', 'sig' => '1234', 'exp' => (new \DateTimeImmutable())->getTimestamp()]),
|
||||
new Request(['object_name' => 'testABC', 'sig' => '1234', 'exp' => new \DateTimeImmutable()->getTimestamp()]),
|
||||
NotFoundHttpException::class,
|
||||
'Object does not exists on disk',
|
||||
false,
|
||||
|
||||
@@ -60,7 +60,7 @@ class WebdavControllerTest extends KernelTestCase
|
||||
|
||||
private function buildDocument(): StoredObject
|
||||
{
|
||||
$object = (new StoredObject())
|
||||
$object = new StoredObject()
|
||||
->registerVersion(type: 'application/vnd.oasis.opendocument.text')
|
||||
->getStoredObject();
|
||||
|
||||
@@ -132,7 +132,7 @@ class WebdavControllerTest extends KernelTestCase
|
||||
self::assertEquals($expectedStatusCode, $response->getStatusCode());
|
||||
self::assertContains('content-type', $response->headers->keys());
|
||||
self::assertStringContainsString('text/xml', $response->headers->get('content-type'));
|
||||
self::assertTrue((new \DOMDocument())->loadXML($response->getContent()), $message.' test that the xml response is a valid xml');
|
||||
self::assertTrue(new \DOMDocument()->loadXML($response->getContent()), $message.' test that the xml response is a valid xml');
|
||||
self::assertXmlStringEqualsXmlString($expectedXmlResponse, $response->getContent(), $message);
|
||||
}
|
||||
|
||||
@@ -305,7 +305,7 @@ class WebdavControllerTest extends KernelTestCase
|
||||
self::assertEquals($expectedStatusCode, $response->getStatusCode());
|
||||
self::assertContains('content-type', $response->headers->keys());
|
||||
self::assertStringContainsString('text/xml', $response->headers->get('content-type'));
|
||||
self::assertTrue((new \DOMDocument())->loadXML($response->getContent()), $message.' test that the xml response is a valid xml');
|
||||
self::assertTrue(new \DOMDocument()->loadXML($response->getContent()), $message.' test that the xml response is a valid xml');
|
||||
self::assertXmlStringEqualsXmlString($expectedXmlResponse, $response->getContent(), $message);
|
||||
}
|
||||
|
||||
|
||||
@@ -45,6 +45,7 @@ class StoredObjectTypeTest extends TypeTestCase
|
||||
|
||||
private StoredObject $model;
|
||||
|
||||
#[\Override]
|
||||
protected function setUp(): void
|
||||
{
|
||||
$this->model = new StoredObject();
|
||||
@@ -109,6 +110,7 @@ class StoredObjectTypeTest extends TypeTestCase
|
||||
$this->assertEquals($originalKeyInfos, $model->getCurrentVersion()->getKeyInfos());
|
||||
}
|
||||
|
||||
#[\Override]
|
||||
protected function getExtensions()
|
||||
{
|
||||
$jwtTokenProvider = $this->prophesize(JWTDavTokenProviderInterface::class);
|
||||
|
||||
@@ -39,7 +39,7 @@ class FetchQueryToSqlBuilderTest extends KernelTestCase
|
||||
$index = $query->addWhereClause('b.cancel', ['foz'], [Types::STRING]);
|
||||
$query->removeWhereClause($index);
|
||||
|
||||
['sql' => $sql, 'params' => $params, 'types' => $types] = (new FetchQueryToSqlBuilder())->toSql($query);
|
||||
['sql' => $sql, 'params' => $params, 'types' => $types] = new FetchQueryToSqlBuilder()->toSql($query);
|
||||
|
||||
$filteredSql =
|
||||
implode(' ', array_filter(
|
||||
@@ -66,7 +66,7 @@ class FetchQueryToSqlBuilderTest extends KernelTestCase
|
||||
'my_table a'
|
||||
);
|
||||
|
||||
['sql' => $sql, 'params' => $params, 'types' => $types] = (new FetchQueryToSqlBuilder())->toSql($query);
|
||||
['sql' => $sql, 'params' => $params, 'types' => $types] = new FetchQueryToSqlBuilder()->toSql($query);
|
||||
|
||||
$filteredSql =
|
||||
implode(' ', array_filter(
|
||||
|
||||
@@ -212,8 +212,8 @@ class ManagerTest extends KernelTestCase
|
||||
|
||||
public function buildNormalizer(bool $supports): GenericDocNormalizerInterface
|
||||
{
|
||||
return new class ($supports) implements GenericDocNormalizerInterface {
|
||||
public function __construct(private readonly bool $supports) {}
|
||||
return new readonly class ($supports) implements GenericDocNormalizerInterface {
|
||||
public function __construct(private bool $supports) {}
|
||||
|
||||
public function supportsNormalization(GenericDocDTO $genericDocDTO, string $format, array $context = []): bool
|
||||
{
|
||||
|
||||
@@ -63,7 +63,7 @@ class AccompanyingCourseDocumentGenericDocProviderTest extends KernelTestCase
|
||||
|
||||
$query = $provider->buildFetchQueryForAccompanyingPeriod($period, $startDate, $endDate, $content);
|
||||
|
||||
['sql' => $sql, 'params' => $params, 'types' => $types] = (new FetchQueryToSqlBuilder())->toSql($query);
|
||||
['sql' => $sql, 'params' => $params, 'types' => $types] = new FetchQueryToSqlBuilder()->toSql($query);
|
||||
|
||||
$nb = $this->entityManager->getConnection()->executeQuery('SELECT COUNT(*) FROM ('.$sql.') AS sq', $params, $types)
|
||||
->fetchOne();
|
||||
|
||||
@@ -70,7 +70,7 @@ class PersonDocumentGenericDocProviderTest extends KernelTestCase
|
||||
|
||||
$query = $provider->buildFetchQueryForPerson($person, $startDate, $endDate, $content);
|
||||
|
||||
['sql' => $sql, 'params' => $params, 'types' => $types] = (new FetchQueryToSqlBuilder())->toSql($query);
|
||||
['sql' => $sql, 'params' => $params, 'types' => $types] = new FetchQueryToSqlBuilder()->toSql($query);
|
||||
|
||||
$nb = $this->entityManager->getConnection()
|
||||
->fetchOne("SELECT COUNT(*) AS nb FROM ({$sql}) AS sq", $params, $types);
|
||||
|
||||
@@ -79,7 +79,7 @@ class PersonDocumentACLAwareRepositoryTest extends KernelTestCase
|
||||
}
|
||||
|
||||
$query = $repository->buildFetchQueryForPerson($person, $startDate, $endDate, $content);
|
||||
['sql' => $sql, 'params' => $params, 'types' => $types] = (new FetchQueryToSqlBuilder())->toSql($query);
|
||||
['sql' => $sql, 'params' => $params, 'types' => $types] = new FetchQueryToSqlBuilder()->toSql($query);
|
||||
|
||||
$nb = $this->entityManager->getConnection()
|
||||
->fetchOne("SELECT COUNT(*) FROM ({$sql}) AS sq", $params, $types);
|
||||
@@ -125,7 +125,7 @@ class PersonDocumentACLAwareRepositoryTest extends KernelTestCase
|
||||
);
|
||||
|
||||
$query = $repository->buildFetchQueryForAccompanyingPeriod($period, $startDate, $endDate, $content);
|
||||
['sql' => $sql, 'params' => $params, 'types' => $types] = (new FetchQueryToSqlBuilder())->toSql($query);
|
||||
['sql' => $sql, 'params' => $params, 'types' => $types] = new FetchQueryToSqlBuilder()->toSql($query);
|
||||
|
||||
$nb = $this->entityManager->getConnection()
|
||||
->fetchOne("SELECT COUNT(*) FROM ({$sql}) AS sq", $params, $types);
|
||||
|
||||
@@ -44,17 +44,17 @@ class RemoveExpiredStoredObjectCronJobTest extends TestCase
|
||||
public static function buildTestCanRunData(): iterable
|
||||
{
|
||||
yield [
|
||||
(new CronJobExecution('remove-expired-stored-object'))->setLastEnd(new \DateTimeImmutable('2023-12-25 00:00:00', new \DateTimeZone('+00:00'))),
|
||||
new CronJobExecution('remove-expired-stored-object')->setLastEnd(new \DateTimeImmutable('2023-12-25 00:00:00', new \DateTimeZone('+00:00'))),
|
||||
true,
|
||||
];
|
||||
|
||||
yield [
|
||||
(new CronJobExecution('remove-expired-stored-object'))->setLastEnd(new \DateTimeImmutable('2023-12-24 23:59:59', new \DateTimeZone('+00:00'))),
|
||||
new CronJobExecution('remove-expired-stored-object')->setLastEnd(new \DateTimeImmutable('2023-12-24 23:59:59', new \DateTimeZone('+00:00'))),
|
||||
true,
|
||||
];
|
||||
|
||||
yield [
|
||||
(new CronJobExecution('remove-expired-stored-object'))->setLastEnd(new \DateTimeImmutable('2023-12-25 00:00:01', new \DateTimeZone('+00:00'))),
|
||||
new CronJobExecution('remove-expired-stored-object')->setLastEnd(new \DateTimeImmutable('2023-12-25 00:00:01', new \DateTimeZone('+00:00'))),
|
||||
false,
|
||||
];
|
||||
|
||||
|
||||
@@ -43,17 +43,17 @@ class RemoveOldVersionCronJobTest extends KernelTestCase
|
||||
public static function buildTestCanRunData(): iterable
|
||||
{
|
||||
yield [
|
||||
(new CronJobExecution('last-deleted-stored-object-version-id'))->setLastEnd(new \DateTimeImmutable('2023-12-31 00:00:00', new \DateTimeZone('+00:00'))),
|
||||
new CronJobExecution('last-deleted-stored-object-version-id')->setLastEnd(new \DateTimeImmutable('2023-12-31 00:00:00', new \DateTimeZone('+00:00'))),
|
||||
true,
|
||||
];
|
||||
|
||||
yield [
|
||||
(new CronJobExecution('last-deleted-stored-object-version-id'))->setLastEnd(new \DateTimeImmutable('2023-12-30 23:59:59', new \DateTimeZone('+00:00'))),
|
||||
new CronJobExecution('last-deleted-stored-object-version-id')->setLastEnd(new \DateTimeImmutable('2023-12-30 23:59:59', new \DateTimeZone('+00:00'))),
|
||||
true,
|
||||
];
|
||||
|
||||
yield [
|
||||
(new CronJobExecution('last-deleted-stored-object-version-id'))->setLastEnd(new \DateTimeImmutable('2023-12-31 00:00:01', new \DateTimeZone('+00:00'))),
|
||||
new CronJobExecution('last-deleted-stored-object-version-id')->setLastEnd(new \DateTimeImmutable('2023-12-31 00:00:01', new \DateTimeZone('+00:00'))),
|
||||
false,
|
||||
];
|
||||
|
||||
|
||||
@@ -27,11 +27,13 @@ final class AsyncFileExists extends Constraint
|
||||
}
|
||||
}
|
||||
|
||||
#[\Override]
|
||||
public function validatedBy(): string
|
||||
{
|
||||
return AsyncFileExistsValidator::class;
|
||||
}
|
||||
|
||||
#[\Override]
|
||||
public function getTargets(): string|array
|
||||
{
|
||||
return [Constraint::CLASS_CONSTRAINT, Constraint::PROPERTY_CONSTRAINT];
|
||||
|
||||
@@ -19,6 +19,7 @@ use Doctrine\Migrations\AbstractMigration;
|
||||
*/
|
||||
final class Version20180605102533 extends AbstractMigration
|
||||
{
|
||||
#[\Override]
|
||||
public function down(Schema $schema): void
|
||||
{
|
||||
$this->abortIf('postgresql' !== $this->connection->getDatabasePlatform()->getName(), 'Migration can only be executed safely on \'postgresql\'.');
|
||||
|
||||
@@ -19,6 +19,7 @@ use Doctrine\Migrations\AbstractMigration;
|
||||
*/
|
||||
final class Version20180606133338 extends AbstractMigration
|
||||
{
|
||||
#[\Override]
|
||||
public function down(Schema $schema): void
|
||||
{
|
||||
$this->abortIf('postgresql' !== $this->connection->getDatabasePlatform()->getName(), 'Migration can only be executed safely on \'postgresql\'.');
|
||||
|
||||
@@ -19,12 +19,14 @@ use Doctrine\Migrations\AbstractMigration;
|
||||
*/
|
||||
final class Version20210903091534 extends AbstractMigration
|
||||
{
|
||||
#[\Override]
|
||||
public function down(Schema $schema): void
|
||||
{
|
||||
$this->addSql('DROP SEQUENCE chill_doc.accompanyingcourse_document_id_seq CASCADE');
|
||||
$this->addSql('DROP TABLE chill_doc.accompanyingcourse_document');
|
||||
}
|
||||
|
||||
#[\Override]
|
||||
public function getDescription(): string
|
||||
{
|
||||
return '';
|
||||
|
||||
@@ -19,6 +19,7 @@ use Doctrine\Migrations\AbstractMigration;
|
||||
*/
|
||||
final class Version20210903123835 extends AbstractMigration
|
||||
{
|
||||
#[\Override]
|
||||
public function down(Schema $schema): void
|
||||
{
|
||||
$this->addSql('ALTER TABLE chill_doc.accompanyingcourse_document DROP CONSTRAINT FK_A45098F6369A0BE36EF62EFC');
|
||||
@@ -39,6 +40,7 @@ final class Version20210903123835 extends AbstractMigration
|
||||
$this->addSql('ALTER TABLE chill_doc.accompanyingcourse_document DROP date');
|
||||
}
|
||||
|
||||
#[\Override]
|
||||
public function getDescription(): string
|
||||
{
|
||||
return '';
|
||||
|
||||
@@ -16,11 +16,13 @@ use Doctrine\Migrations\AbstractMigration;
|
||||
|
||||
final class Version20210928182542 extends AbstractMigration
|
||||
{
|
||||
#[\Override]
|
||||
public function down(Schema $schema): void
|
||||
{
|
||||
$this->addSql('ALTER TABLE chill_doc.stored_object DROP uuid');
|
||||
}
|
||||
|
||||
#[\Override]
|
||||
public function getDescription(): string
|
||||
{
|
||||
return 'Create UUID column on StoredObject table.';
|
||||
|
||||
@@ -16,11 +16,13 @@ use Doctrine\Migrations\AbstractMigration;
|
||||
|
||||
final class Version20211119173558 extends AbstractMigration
|
||||
{
|
||||
#[\Override]
|
||||
public function down(Schema $schema): void
|
||||
{
|
||||
$this->throwIrreversibleMigrationException();
|
||||
}
|
||||
|
||||
#[\Override]
|
||||
public function getDescription(): string
|
||||
{
|
||||
return 'remove comment on deprecated json_array type';
|
||||
|
||||
@@ -19,6 +19,7 @@ use Doctrine\Migrations\AbstractMigration;
|
||||
*/
|
||||
final class Version20220131093117 extends AbstractMigration
|
||||
{
|
||||
#[\Override]
|
||||
public function down(Schema $schema): void
|
||||
{
|
||||
$this->addSql('ALTER TABLE chill_doc.person_document DROP CONSTRAINT FK_41DA53C5DA0FB8');
|
||||
@@ -39,6 +40,7 @@ final class Version20220131093117 extends AbstractMigration
|
||||
$this->addSql('ALTER TABLE chill_doc.accompanyingcourse_document DROP updatedBy_id');
|
||||
}
|
||||
|
||||
#[\Override]
|
||||
public function getDescription(): string
|
||||
{
|
||||
return 'Implementations of create and update traits for Document entity + template property added';
|
||||
|
||||
@@ -19,11 +19,13 @@ use Doctrine\Migrations\AbstractMigration;
|
||||
*/
|
||||
final class Version20220525141646 extends AbstractMigration
|
||||
{
|
||||
#[\Override]
|
||||
public function down(Schema $schema): void
|
||||
{
|
||||
$this->addSql('ALTER TABLE chill_doc.stored_object DROP title');
|
||||
}
|
||||
|
||||
#[\Override]
|
||||
public function getDescription(): string
|
||||
{
|
||||
return 'Add title on storedObject';
|
||||
|
||||
@@ -16,6 +16,7 @@ use Doctrine\Migrations\AbstractMigration;
|
||||
|
||||
final class Version20230227161327 extends AbstractMigration
|
||||
{
|
||||
#[\Override]
|
||||
public function getDescription(): string
|
||||
{
|
||||
return 'Add a generation counter on doc store';
|
||||
@@ -26,6 +27,7 @@ final class Version20230227161327 extends AbstractMigration
|
||||
$this->addSql('ALTER TABLE chill_doc.stored_object ADD generationTrialsCounter INT DEFAULT 0 NOT NULL;');
|
||||
}
|
||||
|
||||
#[\Override]
|
||||
public function down(Schema $schema): void
|
||||
{
|
||||
$this->addSql('ALTER TABLE chill_doc.stored_object DROP generationTrialsCounter');
|
||||
|
||||
@@ -16,6 +16,7 @@ use Doctrine\Migrations\AbstractMigration;
|
||||
|
||||
final class Version20240322100107 extends AbstractMigration
|
||||
{
|
||||
#[\Override]
|
||||
public function getDescription(): string
|
||||
{
|
||||
return 'StoredObject: add deleteAt and generationErrors columns';
|
||||
@@ -28,6 +29,7 @@ final class Version20240322100107 extends AbstractMigration
|
||||
$this->addSql('COMMENT ON COLUMN chill_doc.stored_object.deleteAt IS \'(DC2Type:datetime_immutable)\'');
|
||||
}
|
||||
|
||||
#[\Override]
|
||||
public function down(Schema $schema): void
|
||||
{
|
||||
$this->addSql('ALTER TABLE chill_doc.stored_object DROP deleteAt');
|
||||
|
||||
@@ -16,6 +16,7 @@ use Doctrine\Migrations\AbstractMigration;
|
||||
|
||||
final class Version20240709102730 extends AbstractMigration
|
||||
{
|
||||
#[\Override]
|
||||
public function getDescription(): string
|
||||
{
|
||||
return 'Add versioning to stored objects';
|
||||
@@ -58,6 +59,7 @@ final class Version20240709102730 extends AbstractMigration
|
||||
$this->addSql('ALTER TABLE chill_doc.stored_object ALTER title SET DEFAULT \'\'');
|
||||
}
|
||||
|
||||
#[\Override]
|
||||
public function down(Schema $schema): void
|
||||
{
|
||||
$this->addSql('DROP SEQUENCE chill_doc.stored_object_version_id_seq CASCADE');
|
||||
|
||||
@@ -16,6 +16,7 @@ use Doctrine\Migrations\AbstractMigration;
|
||||
|
||||
final class Version20240910093735 extends AbstractMigration
|
||||
{
|
||||
#[\Override]
|
||||
public function getDescription(): string
|
||||
{
|
||||
return 'Add point in time for stored object version';
|
||||
@@ -36,6 +37,7 @@ final class Version20240910093735 extends AbstractMigration
|
||||
$this->addSql('ALTER TABLE chill_doc.stored_object_version ALTER filename SET DEFAULT \'\'');
|
||||
}
|
||||
|
||||
#[\Override]
|
||||
public function down(Schema $schema): void
|
||||
{
|
||||
$this->addSql('DROP SEQUENCE chill_doc.stored_object_point_in_time_id_seq CASCADE');
|
||||
|
||||
@@ -16,6 +16,7 @@ use Doctrine\Migrations\AbstractMigration;
|
||||
|
||||
final class Version20240918073234 extends AbstractMigration
|
||||
{
|
||||
#[\Override]
|
||||
public function getDescription(): string
|
||||
{
|
||||
return 'Add a relation between stored object version when a version is restored';
|
||||
@@ -29,6 +30,7 @@ final class Version20240918073234 extends AbstractMigration
|
||||
$this->addSql('ALTER INDEX chill_doc.idx_c1d55302232d562b RENAME TO IDX_C1D553024B136083');
|
||||
}
|
||||
|
||||
#[\Override]
|
||||
public function down(Schema $schema): void
|
||||
{
|
||||
$this->addSql('ALTER TABLE chill_doc.stored_object_version DROP createdFrom_id');
|
||||
|
||||
@@ -16,6 +16,7 @@ use Doctrine\Migrations\AbstractMigration;
|
||||
|
||||
final class Version20241118151618 extends AbstractMigration
|
||||
{
|
||||
#[\Override]
|
||||
public function getDescription(): string
|
||||
{
|
||||
return 'Force no duplicated object_id within person_document and accompanyingcourse_document';
|
||||
@@ -33,6 +34,7 @@ final class Version20241118151618 extends AbstractMigration
|
||||
$this->addSql('CREATE UNIQUE INDEX person_document_unique_stored_object ON chill_doc.person_document (object_id)');
|
||||
}
|
||||
|
||||
#[\Override]
|
||||
public function down(Schema $schema): void
|
||||
{
|
||||
$this->addSql('DROP INDEX acc_course_document_unique_stored_object');
|
||||
|
||||
@@ -16,6 +16,7 @@ use Doctrine\Migrations\AbstractMigration;
|
||||
|
||||
final class Version20241212112733 extends AbstractMigration
|
||||
{
|
||||
#[\Override]
|
||||
public function getDescription(): string
|
||||
{
|
||||
return 'Move the title of PersonDocument and AccompanyingCourseDocument to stored object';
|
||||
@@ -30,6 +31,7 @@ final class Version20241212112733 extends AbstractMigration
|
||||
$this->addSql('ALTER TABLE chill_doc.person_document DROP title');
|
||||
}
|
||||
|
||||
#[\Override]
|
||||
public function down(Schema $schema): void
|
||||
{
|
||||
$this->addSql('ALTER TABLE chill_doc.accompanyingcourse_document ADD scope_id INT DEFAULT NULL');
|
||||
|
||||
Reference in New Issue
Block a user