Skip to content

Commit

Permalink
Merge pull request #9 from bearsunday/fix-php8
Browse files Browse the repository at this point in the history
Fix Stream attribute
  • Loading branch information
koriym authored Mar 7, 2021
2 parents d4ce9d1 + 311d80f commit 76978ee
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 4 deletions.
5 changes: 3 additions & 2 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,10 @@
},
"require": {
"php": "^7.3 || ^8.0",
"bear/resource": "^1.15",
"bear/resource": "^1.15.1",
"bear/sunday": "^1.5",
"ray/di": "^2.11"
"ray/di": "^2.11",
"ray/aop": "^2.10.4"
},
"require-dev": {
"phpunit/phpunit": "^9.5",
Expand Down
4 changes: 2 additions & 2 deletions phpunit.xml.dist
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
<?xml version="1.0" encoding="UTF-8"?>
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/9.3/phpunit.xsd" bootstrap="vendor/autoload.php">
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/9.5/phpunit.xsd" bootstrap="tests/bootstrap.php">
<coverage processUncoveredFiles="true">
<include>
<directory suffix=".php">src</directory>
</include>
</coverage>
<testsuites>
<testsuite name="all">
<testsuite name="BEAR.Streamer test suite">
<directory>tests</directory>
</testsuite>
</testsuites>
Expand Down
1 change: 1 addition & 0 deletions src/Streamer.php
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ final class Streamer implements StreamerInterface
*
* @Stream
*/
#[Stream]
public function __construct($stream)
{
$this->stream = $stream;
Expand Down
13 changes: 13 additions & 0 deletions tests/bootstrap.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<?php

declare(strict_types=1);

use Koriym\Attributes\AttributeReader;
use Ray\ServiceLocator\ServiceLocator;

require dirname(__DIR__) . '/vendor/autoload.php';

// no annotation in PHP 8
if (PHP_MAJOR_VERSION >= 8) {
ServiceLocator::setReader(new AttributeReader());
}

0 comments on commit 76978ee

Please sign in to comment.