Skip to content

Commit af04e98

Browse files
authored
Merge pull request #93: AttributeReader by default
2 parents 9198a4d + 9a39d04 commit af04e98

4 files changed

Lines changed: 7 additions & 13 deletions

File tree

.github/workflows/main.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ jobs:
99
strategy:
1010
fail-fast: false
1111
matrix:
12-
php-version: ['8.1','8.2']
12+
php-version: ['8.1', '8.2', '8.3']
1313
steps:
1414
- name: Checkout
1515
uses: actions/checkout@v2
@@ -36,11 +36,11 @@ jobs:
3636
restore-keys: ${{ runner.os }}-composer-
3737

3838
- name: Install dependencies with composer
39-
if: matrix.php-version != '8.3'
39+
if: matrix.php-version != '8.4'
4040
run: composer update --prefer-dist --no-interaction --no-progress --optimize-autoloader --ansi
4141

42-
- name: Install dependencies with composer php 8.1
43-
if: matrix.php-version == '8.3'
42+
- name: Install dependencies with composer php 8.4
43+
if: matrix.php-version == '8.4'
4444
run: composer update --ignore-platform-reqs --prefer-dist --no-interaction --no-progress --optimize-autoloader --ansi
4545

4646
- name: Execute Tests

.github/workflows/psalm.yml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,5 +12,3 @@ jobs:
1212
with:
1313
os: >-
1414
['ubuntu-latest']
15-
php: >-
16-
['8.2']

src/ReaderFactory.php

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@
77
use Doctrine\Common\Annotations\Reader as DoctrineReader;
88
use Spiral\Attributes\AnnotationReader;
99
use Spiral\Attributes\AttributeReader;
10-
use Spiral\Attributes\Composite\SelectiveReader;
1110
use Spiral\Attributes\ReaderInterface;
1211

1312
final class ReaderFactory
@@ -17,10 +16,7 @@ public static function create(DoctrineReader|ReaderInterface $reader = null): Re
1716
return match (true) {
1817
$reader instanceof ReaderInterface => $reader,
1918
$reader instanceof DoctrineReader => new AnnotationReader($reader),
20-
$reader === null => new SelectiveReader([
21-
new AttributeReader(),
22-
new AnnotationReader(),
23-
]),
19+
$reader === null => new AttributeReader(),
2420
};
2521
}
2622
}

tests/Annotated/Unit/ReaderFactoryTest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,16 +8,16 @@
88
use Doctrine\Common\Annotations\AnnotationReader as DoctrineAnnotationReader;
99
use PHPUnit\Framework\TestCase;
1010
use Spiral\Attributes\AnnotationReader;
11+
use Spiral\Attributes\AttributeReader;
1112
use Spiral\Attributes\Composite\MergeReader;
12-
use Spiral\Attributes\Composite\SelectiveReader;
1313

1414
class ReaderFactoryTest extends TestCase
1515
{
1616
public function testCreateFromNull(): void
1717
{
1818
$reader = ReaderFactory::create(null);
1919

20-
$this->assertInstanceOf(SelectiveReader::class, $reader);
20+
$this->assertInstanceOf(AttributeReader::class, $reader);
2121
}
2222

2323
public function testCreateFromDoctrineReader(): void

0 commit comments

Comments
 (0)