Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Prepare release v2.0 #7

Merged
merged 25 commits into from
Dec 17, 2024
Merged
Changes from 1 commit
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
e9574c3
#3 Update README. Add docs, CHANGELOG & CONTRIBUTING.
njoubert-cleverage Oct 23, 2024
405f0d9
#5 Replace "oneup/flysystem-bundle": ">1.0,<4.0" by "league/flysystem…
njoubert-cleverage Oct 23, 2024
5ffe199
#5 Update Tasks for "league/flysystem-bundle": "^3.0"
njoubert-cleverage Oct 23, 2024
cac3d6e
#3 Add Makefile & .docker for local standalone usage. Add rector, php…
njoubert-cleverage Oct 23, 2024
c0cf2d3
#3 Add notifications, quality & test github workflows
njoubert-cleverage Oct 23, 2024
8da051f
#3 Update directory structure with code on /src
njoubert-cleverage Oct 23, 2024
c9bc1c4
#3 Apply phpstan, php-cs-fixer & rector rules
njoubert-cleverage Oct 23, 2024
4c151fa
#4 Remove `sidus/base-bundle` dependency
njoubert-cleverage Oct 23, 2024
e5c3c94
#6 Update services and directories according to Symfony best practice…
njoubert-cleverage Oct 23, 2024
244ea49
Fix service definition
njoubert-cleverage Oct 24, 2024
63b24b5
Minor README fix
njoubert-cleverage Oct 24, 2024
8a85e46
#3 Apply <10.0 restriction on phpunit/phpunit since configuration fil…
njoubert-cleverage Oct 29, 2024
4033e4f
#9 Aliasing Transformers & Tasks with FQCN to maintain old release co…
njoubert-cleverage Nov 22, 2024
c9f90ae
Use service locator as registry instead of MountManager
clever-age-gtonon Dec 9, 2024
81a7ab5
Quality tools
clever-age-gtonon Dec 10, 2024
8889c3b
#10 Update documention
clever-age-gtonon Dec 10, 2024
43dce76
#10 Update documention
clever-age-gtonon Dec 10, 2024
088b36c
#10 Update documention
clever-age-gtonon Dec 11, 2024
c2a7f6f
#10 Update documention
clever-age-gtonon Dec 11, 2024
ce388b9
#10 Update documention
clever-age-gtonon Dec 11, 2024
5adb4df
Merge pull request #11 from cleverage/10_doc
njoubert-cleverage Dec 11, 2024
2341a97
#12 Remove all phpstan ignoreErrors. Fix code.
njoubert-cleverage Dec 13, 2024
6364060
#12 Apply phpstan level 10
njoubert-cleverage Dec 13, 2024
4eefaf3
Merge pull request #13 from cleverage/12_phpstan
njoubert-cleverage Dec 13, 2024
eeaf870
#8 Bump dependency "cleverage/process-bundle": "^4.0"
njoubert-cleverage Dec 17, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
#3 Apply phpstan, php-cs-fixer & rector rules
njoubert-cleverage committed Oct 23, 2024
commit c9bc1c4765d9e7ea2633f29d8cd9e65ba6dc502c
2 changes: 1 addition & 1 deletion .php-cs-fixer.dist.php
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?php

/*
* This file is part of the CleverAge/ProcessBundle package.
* This file is part of the CleverAge/FlysystemProcessBundle package.
*
* Copyright (c) Clever-Age
*
Original file line number Diff line number Diff line change
@@ -1,8 +1,11 @@
<?php declare(strict_types=1);
/**
<?php

declare(strict_types=1);

/*
* This file is part of the CleverAge/FlysystemProcessBundle package.
*
* Copyright (C) 2017-2019 Clever-Age
* Copyright (c) Clever-Age
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
17 changes: 9 additions & 8 deletions src/Task/FileFetchTask.php
Original file line number Diff line number Diff line change
@@ -1,8 +1,11 @@
<?php declare(strict_types=1);
/**
<?php

declare(strict_types=1);

/*
* This file is part of the CleverAge/FlysystemProcessBundle package.
*
* Copyright (C) 2017-2019 Clever-Age
* Copyright (c) Clever-Age
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
@@ -20,7 +23,7 @@

/**
* Copy (or move) file from one filesystem to another, using Flysystem
* Either get files using a file regexp, or take files from input
* Either get files using a file regexp, or take files from input.
*/
class FileFetchTask extends AbstractConfigurableTask implements IterableTaskInterface
{
@@ -75,8 +78,6 @@ public function next(ProcessState $state): bool
}

/**
* @param ProcessState $state
*
* @throws \UnexpectedValueException
* @throws \InvalidArgumentException
* @throws FilesystemException
@@ -87,7 +88,7 @@ protected function findMatchingFiles(ProcessState $state): void
if ($filePattern) {
foreach ($this->sourceFS->listContents('/') as $file) {
if ('file' === $file['type']
&& preg_match($filePattern, $file['path'])
&& preg_match($filePattern, (string) $file['path'])
&& !\in_array($file['path'], $this->matchingFiles, true)) {
$this->matchingFiles[] = $file['path'];
}
@@ -131,7 +132,7 @@ protected function doFileCopy(ProcessState $state, string $filename, bool $remov
}

if ($removeSource) {
$this->sourceFS->delete(sprintf('%s://%s', $prefixFrom, $filename));
$this->sourceFS->delete(\sprintf('%s://%s', $prefixFrom, $filename));
}

return $result ? $filename : null;
19 changes: 10 additions & 9 deletions src/Task/FilesystemOptionTrait.php
Original file line number Diff line number Diff line change
@@ -1,8 +1,11 @@
<?php declare(strict_types=1);
/**
<?php

declare(strict_types=1);

/*
* This file is part of the CleverAge/FlysystemProcessBundle package.
*
* Copyright (C) 2017-2019 Clever-Age
* Copyright (c) Clever-Age
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
@@ -17,20 +20,18 @@
use Symfony\Component\OptionsResolver\OptionsResolver;

/**
* Tools to use filesystem inside task configurations
* Tools to use filesystem inside task configurations.
*/
trait FilesystemOptionTrait
{
protected function configureFilesystemOption(OptionsResolver $resolver, $optionName): void
protected function configureFilesystemOption(OptionsResolver $resolver, string|array $optionName): void
{
$resolver->setRequired($optionName);
$resolver->setAllowedTypes($optionName, 'string');
$resolver->setNormalizer($optionName, function (Options $options, $value) {
return new Filesystem($value);
});
$resolver->setNormalizer($optionName, fn (Options $options, $value) => new Filesystem($value));
}

protected function getFilesystem(ProcessState $state, $optionName): FilesystemOperator
protected function getFilesystem(ProcessState $state, string $optionName): FilesystemOperator
{
return $this->getOption($state, $optionName);
}
23 changes: 13 additions & 10 deletions src/Task/ListContentTask.php
Original file line number Diff line number Diff line change
@@ -1,8 +1,11 @@
<?php declare(strict_types=1);
/**
<?php

declare(strict_types=1);

/*
* This file is part of the CleverAge/FlysystemProcessBundle package.
*
* Copyright (C) 2017-2019 Clever-Age
* Copyright (c) Clever-Age
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
@@ -18,7 +21,7 @@
use Symfony\Component\OptionsResolver\OptionsResolver;

/**
* Iterate over the content of a filesystem
* Iterate over the content of a filesystem.
*/
class ListContentTask extends AbstractConfigurableTask implements IterableTaskInterface
{
@@ -40,14 +43,14 @@ protected function configureOptions(OptionsResolver $resolver): void
*/
public function execute(ProcessState $state): void
{
if ($this->fsContent === null || key($this->fsContent) === null) {
if (null === $this->fsContent || null === key($this->fsContent)) {
$filesystem = $this->getFilesystem($state, 'filesystem');
$pattern = $this->getOption($state, 'file_pattern');

$this->fsContent = $this->getFilteredFilesystemContents($filesystem, $pattern);
}

if (key($this->fsContent) === null) {
if (null === key($this->fsContent)) {
$state->setSkipped(true);
$this->fsContent = null;
} else {
@@ -57,23 +60,23 @@ public function execute(ProcessState $state): void

public function next(ProcessState $state): bool
{
if (!is_array($this->fsContent)) {
if (!\is_array($this->fsContent)) {
return false;
}

next($this->fsContent);

return key($this->fsContent) !== null;
return null !== key($this->fsContent);
}

/**
* @throws FilesystemException
*/
protected function getFilteredFilesystemContents(FilesystemOperator $filesystem, string $pattern = null): array
protected function getFilteredFilesystemContents(FilesystemOperator $filesystem, ?string $pattern = null): array
{
$results = [];
foreach ($filesystem->listContents('') as $item) {
if ($pattern === null || \preg_match($pattern, $item['path'])) {
if (null === $pattern || preg_match($pattern, (string) $item['path'])) {
$results[] = $item;
}
}
11 changes: 7 additions & 4 deletions src/Task/RemoveFileTask.php
Original file line number Diff line number Diff line change
@@ -1,8 +1,11 @@
<?php declare(strict_types=1);
/**
<?php

declare(strict_types=1);

/*
* This file is part of the CleverAge/FlysystemProcessBundle package.
*
* Copyright (C) 2017-2019 Clever-Age
* Copyright (c) Clever-Age
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
@@ -17,7 +20,7 @@
use Symfony\Component\OptionsResolver\OptionsResolver;

/**
* Remove a file from a filesystem
* Remove a file from a filesystem.
*/
class RemoveFileTask extends AbstractConfigurableTask
{