Skip to content

Commit 93682ec

Browse files
authored
Add conventions around PHP code in the project (#68)
* Add convention tests over packages definitions * Add conventions around classes docblocks * Add conventions around public method docblocks
1 parent 1ee99e0 commit 93682ec

File tree

6 files changed

+22
-0
lines changed

6 files changed

+22
-0
lines changed

composer.json

+3
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,9 @@
1313
"require": {
1414
"php": "^8.0",
1515
"composer-runtime-api": "^2.0",
16+
"symfony/config": "^5.0|^6.0",
17+
"symfony/dependency-injection": "^5.0|^6.0",
18+
"symfony/http-kernel": "^5.0|^6.0",
1619
"symfony/framework-bundle": "^5.0|^6.0",
1720
"yokai/batch": "^0.4.0"
1821
},

src/DependencyInjection/CompilerPass/RegisterJobsCompilerPass.php

+5
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,12 @@
1010
use Symfony\Component\DependencyInjection\Definition;
1111
use Symfony\Component\DependencyInjection\Reference;
1212
use Yokai\Batch\Bridge\Symfony\Framework\JobWithStaticNameInterface;
13+
use Yokai\Batch\Job\JobInterface;
14+
use Yokai\Batch\Registry\JobRegistry;
1315

16+
/**
17+
* Find tagged {@see JobInterface} and register these in {@see JobRegistry}.
18+
*/
1419
final class RegisterJobsCompilerPass implements CompilerPassInterface
1520
{
1621
/**

src/DependencyInjection/Configuration.php

+3
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,9 @@
88
use Symfony\Component\Config\Definition\Builder\TreeBuilder;
99
use Symfony\Component\Config\Definition\ConfigurationInterface;
1010

11+
/**
12+
* Configuration for yokai/batch Symfony Bundle.
13+
*/
1114
final class Configuration implements ConfigurationInterface
1215
{
1316
/**

src/DependencyInjection/YokaiBatchExtension.php

+3
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,9 @@
2020
use Yokai\Batch\Storage\ListableJobExecutionStorageInterface;
2121
use Yokai\Batch\Storage\QueryableJobExecutionStorageInterface;
2222

23+
/**
24+
* Dependency injection extension for yokai/batch Symfony Bundle.
25+
*/
2326
final class YokaiBatchExtension extends Extension
2427
{
2528
/**

src/JobWithStaticNameInterface.php

+5
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@
44

55
namespace Yokai\Batch\Bridge\Symfony\Framework;
66

7+
use Yokai\Batch\Registry\JobRegistry;
8+
79
/**
810
* A job that implement this interface can define the associated job name via a static method.
911
* This is very useful if you are registering jobs using PSR services registering.
@@ -12,5 +14,8 @@
1214
*/
1315
interface JobWithStaticNameInterface
1416
{
17+
/**
18+
* The job name as it will be registered in the {@see JobRegistry}.
19+
*/
1520
public static function getJobName(): string;
1621
}

src/YokaiBatchBundle.php

+3
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,9 @@
88
use Symfony\Component\HttpKernel\Bundle\Bundle;
99
use Yokai\Batch\Bridge\Symfony\Framework\DependencyInjection\CompilerPass\RegisterJobsCompilerPass;
1010

11+
/**
12+
* yokai/batch Symfony Bundle.
13+
*/
1114
final class YokaiBatchBundle extends Bundle
1215
{
1316
public function build(ContainerBuilder $container): void

0 commit comments

Comments
 (0)