Skip to content

Commit 8482026

Browse files
committed
Code Quality
1 parent 2cb75fa commit 8482026

File tree

7 files changed

+32
-31
lines changed

7 files changed

+32
-31
lines changed

.github/FUNDING.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
github: terminal42
2+
ko_fi: terminal42

.github/workflows/ci.yml

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
name: CI
2+
3+
on:
4+
push: ~
5+
pull_request: ~
6+
7+
permissions: read-all
8+
9+
jobs:
10+
ci:
11+
uses: 'terminal42/contao-build-tools/.github/workflows/build-tools.yml@main'

LICENSE

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
Copyright (c) 2020 terminal42 gmbh
1+
Copyright (c) 2024 terminal42 gmbh
22

33
Permission is hereby granted, free of charge, to any person obtaining
44
a copy of this software and associated documentation files (the

src/Annotation/ServiceTag.php

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,6 @@
22

33
declare(strict_types=1);
44

5-
/*
6-
* @copyright Copyright (c) 2020, terminal42 gmbh
7-
* @author terminal42 gmbh <https://terminal42.ch>
8-
* @license MIT
9-
* @link http://github.com/terminal42/service-annotation-bundle
10-
*/
11-
125
namespace Terminal42\ServiceAnnotationBundle\Annotation;
136

147
use Doctrine\Common\Annotations\Annotation\Attribute;
@@ -32,10 +25,13 @@ class ServiceTag implements ServiceTagInterface
3225
protected $name;
3326

3427
/**
35-
* @var array
28+
* @var array<string, string|int|float|bool>
3629
*/
3730
protected $attributes = [];
3831

32+
/**
33+
* @param array<string, string|int|float|bool> $data
34+
*/
3935
public function __construct(array $data)
4036
{
4137
$this->name = $data['value'];
@@ -50,6 +46,9 @@ public function getName(): string
5046
return $this->name;
5147
}
5248

49+
/**
50+
* @return array<string, string|int|float|bool>
51+
*/
5352
public function getAttributes(): array
5453
{
5554
return $this->attributes;

src/Annotation/ServiceTagInterface.php

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,18 +2,14 @@
22

33
declare(strict_types=1);
44

5-
/*
6-
* @copyright Copyright (c) 2020, terminal42 gmbh
7-
* @author terminal42 gmbh <https://terminal42.ch>
8-
* @license MIT
9-
* @link http://github.com/terminal42/service-annotation-bundle
10-
*/
11-
125
namespace Terminal42\ServiceAnnotationBundle\Annotation;
136

147
interface ServiceTagInterface
158
{
169
public function getName(): string;
1710

11+
/**
12+
* @return array<string, string|int|float|bool>
13+
*/
1814
public function getAttributes(): array;
1915
}

src/DependencyInjection/Compiler/ServiceAnnotationPass.php

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2,20 +2,14 @@
22

33
declare(strict_types=1);
44

5-
/*
6-
* @copyright Copyright (c) 2020, terminal42 gmbh
7-
* @author terminal42 gmbh <https://terminal42.ch>
8-
* @license MIT
9-
* @link http://github.com/terminal42/service-annotation-bundle
10-
*/
11-
125
namespace Terminal42\ServiceAnnotationBundle\DependencyInjection\Compiler;
136

147
use Doctrine\Common\Annotations\AnnotationException;
158
use Doctrine\Common\Annotations\AnnotationReader;
169
use Doctrine\Common\Annotations\Reader;
1710
use Symfony\Component\DependencyInjection\Compiler\CompilerPassInterface;
1811
use Symfony\Component\DependencyInjection\ContainerBuilder;
12+
use Symfony\Component\DependencyInjection\ContainerInterface;
1913
use Symfony\Component\DependencyInjection\Definition;
2014
use Terminal42\ServiceAnnotationBundle\Annotation\ServiceTagInterface;
2115

@@ -28,7 +22,7 @@ class ServiceAnnotationPass implements CompilerPassInterface
2822

2923
public function process(ContainerBuilder $container): void
3024
{
31-
$this->annotationReader = $container->get('annotation_reader', ContainerBuilder::NULL_ON_INVALID_REFERENCE) ?? new AnnotationReader();
25+
$this->annotationReader = $container->get('annotation_reader', ContainerInterface::NULL_ON_INVALID_REFERENCE) ?? new AnnotationReader();
3226

3327
foreach ($container->getDefinitions() as $id => $definition) {
3428
if ($definition->isAbstract() || $definition->isSynthetic()) {
@@ -58,6 +52,9 @@ public function process(ContainerBuilder $container): void
5852
}
5953
}
6054

55+
/**
56+
* @param \ReflectionClass<\stdClass> $reflection
57+
*/
6158
private function parseClassAnnotations(\ReflectionClass $reflection, Definition $definition): void
6259
{
6360
try {
@@ -76,6 +73,9 @@ private function parseClassAnnotations(\ReflectionClass $reflection, Definition
7673
}
7774
}
7875

76+
/**
77+
* @param \ReflectionClass<\stdClass> $reflection
78+
*/
7979
private function parseMethodAnnotations(\ReflectionClass $reflection, Definition $definition): void
8080
{
8181
foreach ($reflection->getMethods() as $method) {

src/Terminal42ServiceAnnotationBundle.php

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,6 @@
22

33
declare(strict_types=1);
44

5-
/*
6-
* @copyright Copyright (c) 2020, terminal42 gmbh
7-
* @author terminal42 gmbh <https://terminal42.ch>
8-
* @license MIT
9-
* @link http://github.com/terminal42/service-annotation-bundle
10-
*/
11-
125
namespace Terminal42\ServiceAnnotationBundle;
136

147
use Symfony\Component\DependencyInjection\Compiler\PassConfig;

0 commit comments

Comments
 (0)