Skip to content
Closed
Show file tree
Hide file tree
Changes from 4 commits
Commits
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
2 changes: 1 addition & 1 deletion .github/workflows/php_ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ jobs:
strategy:
fail-fast: false
matrix:
php: ['8.2']
php: ['8.4']
dependencies: ['latest', 'lowest']
actions:
- {name: composer, run: make check-composer}
Expand Down
41 changes: 14 additions & 27 deletions .github/workflows/split_packages.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,35 +10,29 @@ jobs:
PHP_EXTENSIONS: 'pdo_sqlite, openswoole, pkcs11'
PHP_EXTENSIONS_CACHE_KEY: cache-extensions-pdo_sqlite-openswoole-pkcs11
steps:
-
name: Checkout
- name: Checkout
uses: actions/checkout@v4
-
name: 'Setup cache environment'
- name: 'Setup cache environment'
id: cache-extensions
uses: shivammathur/cache-extensions@v1
with:
php-version: '${{ matrix.php }}'
extensions: '${{ env.PHP_EXTENSIONS }}'
key: '${{ env.PHP_EXTENSIONS_CACHE_KEY }}'
-
name: 'Cache extensions'
- name: 'Cache extensions'
uses: actions/cache@v4
with:
path: '${{ steps.cache-extensions.outputs.dir }}'
key: '${{ steps.cache-extensions.outputs.key }}'
-
name: 'Setup PHP 8.2'
- name: 'Setup PHP 8.4'
uses: shivammathur/setup-php@297b3cde3c3c3202e03cd5e9b679a74c06f72214
with:
php-version: 8.2
php-version: 8.4
coverage: none
extensions: '${{ env.PHP_EXTENSIONS }}'
-
name: 'Install Composer dependencies'
- name: 'Install Composer dependencies'
uses: ramsey/composer-install@v3
-
id: output_data
- id: output_data
run: 'echo "matrix=$(bin/monorepo export-packages)" >> $GITHUB_OUTPUT'
outputs:
matrix: '${{ steps.output_data.outputs.matrix }}'
Expand All @@ -56,30 +50,23 @@ jobs:
DIR: 'packages/${{ matrix.mapping.dir }}'
TAG: '${{ matrix.tag }}'
steps:
-
uses: actions/checkout@v4
-
run: 'git fetch --prune --unshallow'
-
name: 'Remove Git Extra Header'
- uses: actions/checkout@v4
- run: 'git fetch --prune --unshallow'
- name: 'Remove Git Extra Header'
run: 'git config -l | grep ''http\..*\.extraheader'' | cut -d= -f1 | xargs -L1 git config --unset-all'
-
name: 'Resolve current branch'
- name: 'Resolve current branch'
id: branch_name
run: 'echo "branch=${GITHUB_HEAD_REF:-${GITHUB_REF#refs/heads/}}" >> $GITHUB_OUTPUT'
-
name: 'Add Repo Remote'
- name: 'Add Repo Remote'
run: 'git remote add split-remote https://natepage:${{ secrets.MONOREPO_GITHUB_TOKEN }}@github.com/eonx-com/${{ matrix.mapping.repo }}.git'
-
name: 'Split packages/${{ matrix.mapping.dir }}'
- name: 'Split packages/${{ matrix.mapping.dir }}'
env:
BRANCH: '${{ steps.branch_name.outputs.branch }}'
run: |
git checkout -b "local-$BRANCH-checkout" "$BRANCH"
git subtree split --prefix="packages/${{ matrix.mapping.dir }}" --branch="local-$BRANCH" "$BRANCH"
git push --force split-remote local-$BRANCH:$BRANCH
-
if: "contains(github.event.head_commit.message, '[Release]')"
- if: "contains(github.event.head_commit.message, '[Release]')"
name: 'Release eonx-com/${{ matrix.mapping.repo }}:${{ matrix.tag }}'
shell: bash
run: |
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/split_tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,10 +33,10 @@ jobs:
key: ${{ steps.cache-extensions.outputs.key }}

# TODO: Change the version of the action after 2.33 is released
- name: Setup PHP 8.2
- name: Setup PHP 8.4
uses: shivammathur/setup-php@297b3cde3c3c3202e03cd5e9b679a74c06f72214
with:
php-version: 8.2
php-version: 8.4
coverage: none
extensions:
${{ env.PHP_EXTENSIONS }}
Expand All @@ -57,7 +57,7 @@ jobs:
strategy:
fail-fast: false
matrix:
php: ['8.2']
php: ['8.4']
dependencies: ['latest', 'lowest']
package: ${{ fromJson(needs.provide_packages_json.outputs.matrix) }}

Expand Down
4 changes: 2 additions & 2 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"description": "Reusable packages to make PHP projects easier to create/maintain",
"license": "MIT",
"require": {
"php": "^8.2",
"php": "^8.4",
"ext-bcmath": "*",
"ext-ctype": "*",
"ext-dom": "*",
Expand Down Expand Up @@ -104,7 +104,7 @@
"symfony/twig-bundle": "^7.4",
"symfony/validator": "^7.4",
"symfony/yaml": "^7.4",
"symplify/monorepo-builder": "^11.2.22"
"symplify/monorepo-builder": "^12.4.5"
},
"autoload": {
"files": [
Expand Down
2 changes: 1 addition & 1 deletion monorepo/Application/MonorepoApplication.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@

final class MonorepoApplication extends Application
{
public const TAG_COMMAND = 'console.command';
public const string TAG_COMMAND = 'console.command';

/**
* @param iterable<\Symfony\Component\Console\Command\Command> $commands
Expand Down
6 changes: 3 additions & 3 deletions monorepo/Command/CleanUpPackagesCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -30,23 +30,23 @@ protected function execute(InputInterface $input, OutputInterface $output): int

private function getComposerLockFiles(): Finder
{
return (new Finder())
return new Finder()
->in([__DIR__ . '/../../packages'])
->files()
->name('composer.lock');
}

private function getVarDirs(): Finder
{
return (new Finder())
return new Finder()
->in([__DIR__ . '/../../packages'])
->directories()
->name('var');
}

private function getVendorDirs(): Finder
{
return (new Finder())
return new Finder()
->in([__DIR__ . '/../../packages'])
->directories()
->name('vendor');
Expand Down
2 changes: 1 addition & 1 deletion monorepo/Command/ExportPackagesAsJsonCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ protected function execute(InputInterface $input, OutputInterface $output): int

private function getComposerJsonFiles(): Finder
{
return (new Finder())
return new Finder()
->in([__DIR__ . '/../../packages'])
->name('composer.json');
}
Expand Down
2 changes: 1 addition & 1 deletion monorepo/Command/GlobalizePackageRepositoriesCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ private function getComposerJsonFileContents(SplFileInfo $composerJsonFile): arr

private function getComposerJsonFiles(): Finder
{
return (new Finder())
return new Finder()
->in([__DIR__ . '/../../packages'])
->name('composer.json');
}
Expand Down
2 changes: 1 addition & 1 deletion monorepo/Command/LocalizePackageRepositoriesCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ private function getComposerJsonFileContents(SplFileInfo $composerJsonFile): arr

private function getComposerJsonFiles(): Finder
{
return (new Finder())
return new Finder()
->in([__DIR__ . '/../../packages'])
->name('composer.json');
}
Expand Down
2 changes: 1 addition & 1 deletion monorepo/Kernel/MonorepoKernel.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

final class MonorepoKernel extends Kernel
{
public const NAMESPACE = 'EonX\\EasyMonorepo\\';
public const string NAMESPACE = 'EonX\\EasyMonorepo\\';

/**
* @return \Symfony\Component\HttpKernel\Bundle\BundleInterface[]
Expand Down
4 changes: 2 additions & 2 deletions monorepo/ReleaseWorker/PackagesListInReadmeReleaseWorker.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@

final readonly class PackagesListInReadmeReleaseWorker implements ReleaseWorkerInterface
{
private const GITHUB_URL = 'https://github.com/';
private const string GITHUB_URL = 'https://github.com/';

private Filesystem $filesystem;

Expand Down Expand Up @@ -45,7 +45,7 @@ public function work(Version $version): void

private function getPackagesList(): iterable
{
$composerFiles = (new Finder())
$composerFiles = new Finder()
->in([__DIR__ . '/../../packages'])
->name('composer.json')
->sortByName();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@

final readonly class UpdateTagInGithubWorkflowReleaseWorker implements ReleaseWorkerInterface
{
private const WORKFLOW_FILENAME = __DIR__ . '/../../.github/workflows/split_packages.yml';
private const string WORKFLOW_FILENAME = __DIR__ . '/../../.github/workflows/split_packages.yml';

private Filesystem $filesystem;

Expand Down
9 changes: 5 additions & 4 deletions packages/EasyActivity/bundle/EasyActivityBundle.php
Original file line number Diff line number Diff line change
Expand Up @@ -59,10 +59,11 @@ public function prependExtension(ContainerConfigurator $container, ContainerBuil
/** @var array $resolvedConfigs */
$resolvedConfigs = $resolvingBag->resolveValue($configs);

$config = (new Processor())->processConfiguration(
new Configuration($this, $builder, $this->extensionAlias),
$resolvedConfigs
);
$config = new Processor()
->processConfiguration(
new Configuration($this, $builder, $this->extensionAlias),
$resolvedConfigs
);

$easyDoctrinePrependedConfig = [
'deferred_dispatcher_entities' => \array_diff(\array_keys($config['subjects']), $easyDoctrineEntities),
Expand Down
2 changes: 1 addition & 1 deletion packages/EasyActivity/composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"type": "library",
"license": "MIT",
"require": {
"php": "^8.2",
"php": "^8.4",
"doctrine/collections": "^1.7.2 || ^2.1",
"doctrine/dbal": "^3.8",
"doctrine/orm": "^2.20",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,9 @@

final readonly class DefaultActivitySubjectDataResolver implements ActivitySubjectDataResolverInterface
{
public const CONTEXT_KEY_SUBJECT_DATA_SERIALIZATION = 'easy_activity_subject_data_serialization';
public const string CONTEXT_KEY_SUBJECT_DATA_SERIALIZATION = 'easy_activity_subject_data_serialization';

public const CONTEXT_KEY_SUBJECT_OLD_DATA_SERIALIZATION = 'easy_activity_subject_old_data_serialization';
public const string CONTEXT_KEY_SUBJECT_OLD_DATA_SERIALIZATION = 'easy_activity_subject_old_data_serialization';

public function __construct(
private ActivitySubjectDataSerializerInterface $serializer,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

final readonly class DefaultActorResolver implements ActorResolverInterface
{
public const DEFAULT_ACTOR_TYPE = 'system';
public const string DEFAULT_ACTOR_TYPE = 'system';

public function resolve(object $object): ActorInterface
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@

final readonly class ActivityLogEntryMessage implements WithLockDataInterface
{
private const LOCK_RESOURCE = 'activity_log_%s_%s';
private const string LOCK_RESOURCE = 'activity_log_%s_%s';

private const LOCK_TTL_SEC = 3600.0;
private const float LOCK_TTL_SEC = 3600.0;

public function __construct(
private ActivityLogEntry $logEntry,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,8 @@ final class CircularReferenceHandlerTest extends AbstractUnitTestCase
{
public function testInvokeSucceedsWithId(): void
{
$article = (new Article())->setId((string)(new NilUuid()));
$article = new Article()
->setId((string)(new NilUuid()));
/** @var \EonX\EasyActivity\Common\CircularReferenceHandler\CircularReferenceHandlerInterface $sut */
$sut = self::getService(ConfigServiceId::CircularReferenceHandler->value);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,8 @@ public function testCreateSucceeds(): void

$result = $sut->create(
ActivityAction::Create,
(new Article())->setId((string)(new NilUuid())),
new Article()
->setId((string)(new NilUuid())),
['title' => [null, 'New Title']]
);

Expand Down Expand Up @@ -95,13 +96,13 @@ public function testCreateSucceedsWithCollections(): void
{
self::bootKernel(['environment' => 'default_subject_config']);
$sut = self::getService(ActivityLogEntryFactoryInterface::class);
$comment1 = (new Comment())
$comment1 = new Comment()
->setId((string)(new NilUuid()))
->setMessage('Test 1');
$comment2 = (new Comment())
$comment2 = new Comment()
->setId('00000000-0000-0000-0000-000000000001')
->setMessage('Test 2');
$article = (new Article())
$article = new Article()
->setId('00000000-0000-0000-0000-000000000002')
->setTitle('Related objects')
->setContent('Content')
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,7 @@ public static function provideDataForSerializeSucceeds(): iterable
'expectedResult' => '{"author":{"name":"John Doe"},"content":"text"}',
];

$comment = (new Comment())
$comment = new Comment()
->setId((string)(new NilUuid()))
->setMessage('some-message');
$article = new Article();
Expand Down Expand Up @@ -204,7 +204,7 @@ public static function provideDataForSerializeSucceeds(): iterable
),
];

$authorExtra = (new AuthorExtra())
$authorExtra = new AuthorExtra()
->setPhone('1234567890');

yield 'Default config with nested object' => [
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ public function testLoggerDoesNothingWhenSubjectIsNotDefinedInConfig(): void
self::bootKernel();
$this->initDatabase();
$entityManager = self::getEntityManager();
$article = (new Article())
$article = new Article()
->setTitle('Resolver')
->setContent('Test actor resolver');
$entityManager->persist($article);
Expand Down Expand Up @@ -268,10 +268,14 @@ public function testLoggerSucceedsWithCollections(): void
$article = new Article();
$article->setTitle('Test collections');
$article->setContent('Content');
$commentA = (new Comment())->setMessage('comment 1');
$commentB = (new Comment())->setMessage('comment 2');
$commentC = (new Comment())->setMessage('comment 3');
$commentD = (new Comment())->setMessage('comment 4');
$commentA = new Comment()
->setMessage('comment 1');
$commentB = new Comment()
->setMessage('comment 2');
$commentC = new Comment()
->setMessage('comment 3');
$commentD = new Comment()
->setMessage('comment 4');
$article->addComment($commentA);
$article->addComment($commentB);
$article->addComment($commentC);
Expand All @@ -287,7 +291,8 @@ public function testLoggerSucceedsWithCollections(): void
$entityManager->flush();
$commentA->setMessage('comment 1 updated');
$entityManager->flush();
$commentE = (new Comment())->setMessage('comment 5');
$commentE = new Comment()
->setMessage('comment 5');
$article->addComment($commentE);
$entityManager->flush();

Expand Down
Loading
Loading