Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

Maintenance #110

Merged
merged 4 commits into from
Dec 11, 2024
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
13 changes: 6 additions & 7 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
/.github export-ignore
/tests export-ignore
.editorconfig export-ignore
.gitattributes export-ignore
.gitignore export-ignore
.travis.yml export-ignore
phpunit.xml export-ignore
/.* export-ignore
/tests export-ignore
/*.xml export-ignore
/*.yml export-ignore
/*.lock export-ignore
/*.dist export-ignore
10 changes: 0 additions & 10 deletions .github/PULL_REQUEST_TEMPLATE.md

This file was deleted.

16 changes: 16 additions & 0 deletions .github/workflows/cs-fix.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
---

on: # yamllint disable-line rule:truthy
push:
branches:
- '*'

name: Fix Code Style

jobs:
cs-fix:
permissions:
contents: write
uses: spiral/gh-actions/.github/workflows/cs-fix.yml@master

...
12 changes: 5 additions & 7 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
*.iml

# Composer
vendor/
/vendor
composer.lock
composer.phar

Expand All @@ -12,11 +12,9 @@ composer.phar
Thumbs.db

# Other
.phpunit.cache
build
.php_cs.cache
clover.xml
.env
builds
/runtime

.phpunit.result.cache

# Binaries
protoc*
13 changes: 13 additions & 0 deletions .php-cs-fixer.dist.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<?php

declare(strict_types=1);

require_once 'vendor/autoload.php';

return \Spiral\CodeStyle\Builder::create()
->include(__DIR__ . '/src')
->include(__DIR__ . '/tests/src')
->include(__FILE__)
->cache('./runtime/php-cs-fixer.cache')
->allowRisky()
->build();
77 changes: 0 additions & 77 deletions .styleci.yml

This file was deleted.

4 changes: 3 additions & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
"issues": "https://github.com/spiral/roadrunner-bridge/issues",
"source": "https://github.com/spiral/roadrunner-bridge",
"docs": "https://spiral.dev/docs",
"forum": "https://forum.spiral.dev",
"chat": "https://discord.gg/V6EK4he"
},
"authors": [
Expand Down Expand Up @@ -58,6 +57,7 @@
"buggregator/trap": "^1.10",
"internal/dload": "^1.0.0",
"phpunit/phpunit": "^10.5",
"spiral/code-style": "^2.2",
"spiral/framework": "^3.14",
"spiral/nyholm-bridge": "^1.3",
"spiral/roadrunner-cli": "^2.6",
Expand All @@ -84,6 +84,8 @@
"post-update-cmd": [
"dload get --no-interaction"
],
"cs:diff": "php-cs-fixer fix --dry-run -v --diff",
"cs:fix": "php-cs-fixer fix -v",
"test": "phpunit",
"psalm": "psalm",
"psalm:baseline": "psalm --set-baseline=psalm-baseline.xml"
Expand Down
12 changes: 6 additions & 6 deletions phpunit.xml
Original file line number Diff line number Diff line change
@@ -1,25 +1,25 @@
<?xml version="1.0" encoding="UTF-8"?>
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="vendor/phpunit/phpunit/phpunit.xsd"
bootstrap="vendor/autoload.php"
cacheResultFile="runtime/phpunit/result.cache"
backupGlobals="false"
colors="true"
processIsolation="false"
stopOnFailure="false"
stopOnError="false"
stderr="false"
xsi:noNamespaceSchemaLocation="vendor/phpunit/phpunit/phpunit.xsd"
cacheDirectory=".phpunit.cache"
backupStaticProperties="false"
>
<coverage>
<report>
<html outputDirectory="build/coverage"/>
<text outputFile="build/coverage.txt"/>
<clover outputFile="build/logs/clover.xml"/>
<html outputDirectory="runtime/coverage"/>
<text outputFile="runtime/coverage.txt"/>
<clover outputFile="runtime/logs/clover.xml"/>
</report>
</coverage>
<logging>
<junit outputFile="build/report.junit.xml"/>
<junit outputFile="runtime/report.junit.xml"/>
</logging>
<testsuites>
<testsuite name="Test Suite">
Expand Down
131 changes: 131 additions & 0 deletions psalm-baseline.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,131 @@
<?xml version="1.0" encoding="UTF-8"?>
<files psalm-version="5.26.1@d747f6500b38ac4f7dfc5edbcae6e4b637d7add0">
<file src="src/Bootloader/GRPCBootloader.php">
<ArgumentTypeCoercion>
<code><![CDATA[$list]]></code>
</ArgumentTypeCoercion>
<DeprecatedClass>
<code><![CDATA[CompatiblePipelineBuilder::class]]></code>
</DeprecatedClass>
<DeprecatedInterface>
<code><![CDATA[Autowire|class-string<CoreInterceptorInterface>|CoreInterceptorInterface]]></code>
</DeprecatedInterface>
<DocblockTypeContradiction>
<code><![CDATA[$container->get(CompatiblePipelineBuilder::class)]]></code>
</DocblockTypeContradiction>
<InvalidArgument>
<code><![CDATA[$listener]]></code>
</InvalidArgument>
<RedundantConditionGivenDocblockType>
<code><![CDATA[$pipelineBuilder]]></code>
</RedundantConditionGivenDocblockType>
<TooManyArguments>
<code><![CDATA[new AutowireHandler($container, false)]]></code>
</TooManyArguments>
</file>
<file src="src/Centrifugo/Dispatcher.php">
<DeprecatedClass>
<code><![CDATA[CompatiblePipelineBuilder::class]]></code>
</DeprecatedClass>
<UndefinedThisPropertyAssignment>
<code><![CDATA[$this->pipelineBuilder]]></code>
</UndefinedThisPropertyAssignment>
</file>
<file src="src/Centrifugo/Interceptor/InterceptorRegistry.php">
<DeprecatedInterface>
<code><![CDATA[$object]]></code>
<code><![CDATA[array]]></code>
</DeprecatedInterface>
<LessSpecificReturnStatement>
<code><![CDATA[\array_merge(
$this->interceptors[self::INTERCEPTORS_FOR_ALL_SERVICES] ?? [],
$this->interceptors[$type] ?? [],
)]]></code>
</LessSpecificReturnStatement>
<MoreSpecificReturnType>
<code><![CDATA[array]]></code>
</MoreSpecificReturnType>
</file>
<file src="src/Centrifugo/Interceptor/RegistryInterface.php">
<DeprecatedInterface>
<code><![CDATA[TInterceptor|TLegacyInterceptor]]></code>
<code><![CDATA[list<TInterceptor|TLegacyInterceptor>]]></code>
</DeprecatedInterface>
</file>
<file src="src/Centrifugo/RequestHandler.php">
<DeprecatedInterface>
<code><![CDATA[RequestHandler]]></code>
</DeprecatedInterface>
</file>
<file src="src/Centrifugo/Server.php">
<DeprecatedClass>
<code><![CDATA[CompatiblePipelineBuilder::class]]></code>
</DeprecatedClass>
<PossiblyNullArgument>
<code><![CDATA[$services->getService($type)]]></code>
</PossiblyNullArgument>
</file>
<file src="src/Config/GRPCConfig.php">
<DeprecatedInterface>
<code><![CDATA[array<Autowire|class-string<InterceptorInterface>|class-string<CoreInterceptorInterface>>]]></code>
</DeprecatedInterface>
</file>
<file src="src/Config/TcpConfig.php">
<DeprecatedInterface>
<code><![CDATA[array<non-empty-string, list<TInterceptor|TLegacyInterceptor>>]]></code>
</DeprecatedInterface>
</file>
<file src="src/Console/Command/GRPC/GenerateCommand.php">
<PossiblyNullArgument>
<code><![CDATA[$binaryPath]]></code>
</PossiblyNullArgument>
<RedundantCondition>
<code><![CDATA[$binaryPath !== null]]></code>
<code><![CDATA[\assert($binaryPath !== null)]]></code>
</RedundantCondition>
<RiskyTruthyFalsyComparison>
<code><![CDATA[\realpath($protoFile)]]></code>
</RiskyTruthyFalsyComparison>
</file>
<file src="src/GRPC/ProtoCompiler.php">
<RiskyTruthyFalsyComparison>
<code><![CDATA[\realpath($protoFile)]]></code>
<code><![CDATA[\realpath($this->tmpDir())]]></code>
</RiskyTruthyFalsyComparison>
</file>
<file src="src/GRPC/ProtocCommandBuilder.php">
<RiskyTruthyFalsyComparison>
<code><![CDATA[\realpath($dir)]]></code>
<code><![CDATA[\realpath($path)]]></code>
</RiskyTruthyFalsyComparison>
</file>
<file src="src/GRPC/ServiceLocator.php">
<MoreSpecificImplementedParamType>
<code><![CDATA[$class]]></code>
</MoreSpecificImplementedParamType>
<RedundantCondition>
<code><![CDATA[$interface->isSubclassOf($className)]]></code>
</RedundantCondition>
</file>
<file src="src/Queue/Dispatcher.php">
<DeprecatedMethod>
<code><![CDATA[complete]]></code>
<code><![CDATA[fail]]></code>
<code><![CDATA[fail]]></code>
</DeprecatedMethod>
</file>
<file src="src/Tcp/Interceptor/RegistryInterface.php">
<DeprecatedInterface>
<code><![CDATA[TInterceptor|TLegacyInterceptor]]></code>
<code><![CDATA[array<CoreInterceptorInterface|InterceptorInterface>]]></code>
</DeprecatedInterface>
</file>
<file src="src/Tcp/Server.php">
<DeprecatedClass>
<code><![CDATA[CompatiblePipelineBuilder::class]]></code>
</DeprecatedClass>
<PossiblyInvalidArgument>
<code><![CDATA[$this->interceptors->getInterceptors($server)]]></code>
</PossiblyInvalidArgument>
</file>
</files>
6 changes: 3 additions & 3 deletions psalm.xml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
resolveFromConfigFile="true"
findUnusedBaselineEntry="false"
findUnusedCode="false"
errorBaseline="psalm-baseline.xml"
>
<projectFiles>
<directory name="src"/>
Expand All @@ -15,9 +16,8 @@
</ignoreFiles>
</projectFiles>
<issueHandlers>
<DeprecatedInterface>
<errorLevel type="suppress"/>
</DeprecatedInterface>
<DeprecatedInterface errorLevel="suppress"/>
<MissingClassConstType errorLevel="suppress"/>
<PropertyNotSetInConstructor>
<errorLevel type="suppress">
<directory name="src/Console/Command"/>
Expand Down
4 changes: 2 additions & 2 deletions src/Bootloader/CacheBootloader.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ public function defineDependencies(): array
public function defineSingletons(): array
{
return [
FactoryInterface::class => static fn (
FactoryInterface::class => static fn(
RPCInterface $rpc,
SerializerInterface $serializer,
): FactoryInterface => new Factory($rpc, $serializer),
Expand All @@ -39,7 +39,7 @@ public function defineBindings(): array
return [
StorageInterface::class =>
/** @param non-empty-string $driver */
static fn (
static fn(
FactoryInterface $factory,
string $driver,
): StorageInterface => $factory->select($driver),
Expand Down
Loading
Loading