Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Deps updated #45

Merged
merged 3 commits into from
May 12, 2023
Merged
Show file tree
Hide file tree
Changes from all 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
4 changes: 2 additions & 2 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,8 @@
"phpstan/phpstan-deprecation-rules": "^1.0",
"phpstan/phpstan-phpunit": "^1.0",
"phpstan/phpstan-strict-rules": "^1.0",
"phpunit/phpunit": "^10.0",
"rector/rector": "^0.15",
"phpunit/phpunit": "^10.1",
"rector/rector": "^0.16",
"roave/security-advisories": "dev-latest",
"symfony/var-dumper": "^6.0",
"symplify/easy-coding-standard": "^11.1",
Expand Down
13 changes: 7 additions & 6 deletions phpunit.xml.dist
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,9 @@
<phpunit
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
bootstrap="vendor/autoload.php"
xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/10.0/phpunit.xsd"
xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/10.1/phpunit.xsd"
>
<coverage>
<include>
<directory suffix=".php">./src</directory>
</include>
</coverage>
<coverage/>
<testsuites>
<testsuite name="CBOR Test Suite">
<directory suffix="Test.php">./tests/</directory>
Expand All @@ -20,4 +16,9 @@
<ini name="intl.error_level" value="0"/>
<ini name="memory_limit" value="-1"/>
</php>
<source>
<include>
<directory suffix=".php">./src</directory>
</include>
</source>
</phpunit>
9 changes: 7 additions & 2 deletions src/IndefiniteLengthByteStringObject.php
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,14 @@ public function __toString(): string
return $result . "\xFF";
}

public static function create(): self
public static function create(string ...$chunks): self
{
return new self();
$object = new self();
foreach ($chunks as $chunk) {
$object->append($chunk);
}

return $object;
}

public function add(ByteStringObject $chunk): self
Expand Down
9 changes: 7 additions & 2 deletions src/IndefiniteLengthListObject.php
Original file line number Diff line number Diff line change
Expand Up @@ -42,9 +42,14 @@ public function __toString(): string
return $result . "\xFF";
}

public static function create(): self
public static function create(CBORObject ...$items): self
{
return new self();
$object = new self();
foreach ($items as $item) {
$object->add($item);
}

return $object;
}

/**
Expand Down
9 changes: 7 additions & 2 deletions src/IndefiniteLengthTextStringObject.php
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,14 @@ public function __toString(): string
return $result . "\xFF";
}

public static function create(): self
public static function create(string ...$chunks): self
{
return new self();
$object = new self();
foreach ($chunks as $chunk) {
$object->append($chunk);
}

return $object;
}

public function add(TextStringObject $chunk): self
Expand Down
2 changes: 1 addition & 1 deletion src/OtherObject/SimpleObject.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ final class SimpleObject extends Base implements Normalizable
{
public static function supportedAdditionalInformation(): array
{
return array_merge(range(0, 19), [24]);
return [...range(0, 19), 24];
}

public static function create(int $value): self|FalseObject|TrueObject|NullObject|UndefinedObject
Expand Down