Skip to content
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
12 changes: 6 additions & 6 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,10 @@ jobs:
fail-fast: false
matrix:
php-version: [
'8.1'
'8.3'
]
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v7

- name: Setup PHP
uses: shivammathur/setup-php@v2
Expand All @@ -35,7 +35,7 @@ jobs:
run: echo "dir=$(composer config cache-files-dir)" >> $GITHUB_OUTPUT

- name: Composer cache
uses: actions/cache@v3
uses: actions/cache@v6
with:
path: ${{ steps.composer-cache.outputs.dir }}
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }}
Expand Down Expand Up @@ -78,10 +78,10 @@ jobs:
fail-fast: false
matrix:
php-version: [
'8.1'
'8.3'
]
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v7

- name: Setup PHP
uses: shivammathur/setup-php@v2
Expand All @@ -95,7 +95,7 @@ jobs:
run: echo "dir=$(composer config cache-files-dir)" >> $GITHUB_OUTPUT

- name: Composer cache
uses: actions/cache@v3
uses: actions/cache@v6
with:
path: ${{ steps.composer-cache.outputs.dir }}
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }}
Expand Down
22 changes: 10 additions & 12 deletions architector.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,18 +5,14 @@
* Use of this software requires acceptance of the Evaluation License Agreement. See LICENSE file.
*/

use Rector\CodeQuality\Rector\Return_\SimplifyUselessVariableRector;
use Rector\CodeQuality\Rector\FunctionLike\SimplifyUselessVariableRector;
use Rector\Config\RectorConfig;
use Rector\Core\Configuration\Option;
use Rector\DeadCode\Rector\ClassMethod\RemoveUnusedPromotedPropertyRector;
use Rector\DeadCode\Rector\ClassMethod\RemoveUselessParamTagRector;
use Rector\DeadCode\Rector\ClassMethod\RemoveUselessReturnTagRector;
use Rector\DeadCode\Rector\Property\RemoveDefaultValueFromAssignedPropertyRector;
use Rector\DeadCode\Rector\Property\RemoveUselessVarTagRector;
use Rector\EarlyReturn\Rector\If_\ChangeAndIfToEarlyReturnRector;
use Rector\EarlyReturn\Rector\If_\ChangeOrIfReturnToEarlyReturnRector;
use Rector\EarlyReturn\Rector\Return_\ReturnBinaryAndToEarlyReturnRector;
use Rector\Php74\Rector\Closure\ClosureToArrowFunctionRector;
use Rector\Php74\Rector\Property\TypedPropertyRector;
use Rector\Set\ValueObject\SetList;

defined('APPLICATION_ROOT_DIR') || define('APPLICATION_ROOT_DIR', __DIR__);
Expand All @@ -26,16 +22,18 @@
$rectorConfig->import(SetList::EARLY_RETURN);
$rectorConfig->import(SetList::PHP_74);

$rectorConfig->parameters()->set(Option::SKIP, [
ChangeAndIfToEarlyReturnRector::class,
ChangeOrIfReturnToEarlyReturnRector::class,
$rectorConfig->skip([
ClosureToArrowFunctionRector::class,
RemoveUselessParamTagRector::class,
RemoveUnusedPromotedPropertyRector::class,
RemoveUselessReturnTagRector::class,
ReturnBinaryAndToEarlyReturnRector::class,
SimplifyUselessVariableRector::class,
TypedPropertyRector::class,
RemoveUselessVarTagRector::class
RemoveUselessVarTagRector::class,
// $isWindows is a static property only ever assigned inside the instance
// constructor; removing its default breaks any static-only access path
// that happens before the class is first instantiated.
RemoveDefaultValueFromAssignedPropertyRector::class => [
__DIR__ . '/src/SprykerSdk/AsyncApi/Message/AbstractAsyncApiMessage.php',
],
]);
};
12 changes: 6 additions & 6 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,12 @@
"description": "SDK for AsyncAPI.",
"license": "proprietary",
"require": {
"php": ">=8.0",
"php": ">=8.3",
"doctrine/inflector": "~1.4.2 || ~2.0.0",
"symfony/console": "^4.0.0 || ^5.3 || ^6.0",
"symfony/finder": "^4.0.0 || ^5.3 || ^6.0",
"symfony/process": "^4.0.0 || ^5.4 || ^6.0",
"symfony/property-access": "^4.0.0 || ^5.4 || ^6.0"
"symfony/console": "^4.0.0 || ^5.3 || ^6.0 || ^7.0",
"symfony/finder": "^4.0.0 || ^5.3 || ^6.0 || ^7.0",
"symfony/process": "^4.0.0 || ^5.4 || ^6.0 || ^7.0",
"symfony/property-access": "^4.0.0 || ^5.4 || ^6.0 || ^7.0"
},
"require-dev": {
"codeception/codeception": "^5.0.0",
Expand All @@ -18,7 +18,7 @@
"sllh/composer-versions-check": "^2.0",
"spryker-sdk/architector": "0.1.x-dev",
"spryker/code-sniffer": "^0.17.20",
"symfony/var-dumper": "^6.0.0"
"symfony/var-dumper": "^6.0.0 || ^7.0.0"
},
"autoload": {
"psr-4": {
Expand Down
2 changes: 1 addition & 1 deletion phpstan.neon
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
parameters:
level: 8
checkMissingIterableValueType: false

bootstrapFiles:
- phpstan-bootstrap.php

ignoreErrors:
- '#Parameter .+ of method .+Transfer::.+\(\).+ given.#'
- '#Binary operation .+ results in an error.#'
- '#no value type specified in iterable type#'

reportUnmatchedIgnoredErrors: false
2 changes: 0 additions & 2 deletions src/SprykerSdk/AsyncApi/AsyncApi/AsyncApi.php
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,6 @@ public function getChannels(): iterable

/**
* @param string $channelName
*
* @return \SprykerSdk\AsyncApi\AsyncApi\Channel\AsyncApiChannelInterface|null
*/
public function getChannel(string $channelName): ?AsyncApiChannelInterface
{
Expand Down
2 changes: 0 additions & 2 deletions src/SprykerSdk/AsyncApi/AsyncApi/AsyncApiInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,6 @@ public function getChannels(): iterable;

/**
* @param string $channelName
*
* @return \SprykerSdk\AsyncApi\AsyncApi\Channel\AsyncApiChannelInterface|null
*/
public function getChannel(string $channelName): ?AsyncApiChannelInterface;
}
4 changes: 0 additions & 4 deletions src/SprykerSdk/AsyncApi/AsyncApi/Channel/AsyncApiChannel.php
Original file line number Diff line number Diff line change
Expand Up @@ -57,8 +57,6 @@ public function getPublishMessages(): iterable

/**
* @param string $messageName
*
* @return \SprykerSdk\AsyncApi\AsyncApi\Message\AsyncApiMessageInterface|null
*/
public function getPublishMessage(string $messageName): ?AsyncApiMessageInterface
{
Expand All @@ -75,8 +73,6 @@ public function getSubscribeMessages(): iterable

/**
* @param string $messageName
*
* @return \SprykerSdk\AsyncApi\AsyncApi\Message\AsyncApiMessageInterface|null
*/
public function getSubscribeMessage(string $messageName): ?AsyncApiMessageInterface
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,6 @@ public function getChannels(): iterable

/**
* @param string $channelName
*
* @return \SprykerSdk\AsyncApi\AsyncApi\Channel\AsyncApiChannelInterface|null
*/
public function getChannel(string $channelName): ?AsyncApiChannelInterface
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,6 @@ public function getChannels(): iterable;

/**
* @param string $channelName
*
* @return \SprykerSdk\AsyncApi\AsyncApi\Channel\AsyncApiChannelInterface|null
*/
public function getChannel(string $channelName): ?AsyncApiChannelInterface;
}
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,6 @@ public function getPublishMessages(): iterable;

/**
* @param string $messageName
*
* @return \SprykerSdk\AsyncApi\AsyncApi\Message\AsyncApiMessageInterface|null
*/
public function getPublishMessage(string $messageName): ?AsyncApiMessageInterface;

Expand All @@ -35,8 +33,6 @@ public function getSubscribeMessages(): iterable;

/**
* @param string $messageName
*
* @return \SprykerSdk\AsyncApi\AsyncApi\Message\AsyncApiMessageInterface|null
*/
public function getSubscribeMessage(string $messageName): ?AsyncApiMessageInterface;
}
4 changes: 3 additions & 1 deletion src/SprykerSdk/AsyncApi/AsyncApi/Loader/AsyncApiLoader.php
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,9 @@ protected function validateRemotePath(string $asyncApiPath): void
{
// phpcs:disable
if (@file_get_contents($asyncApiPath) === false) {
throw new InvalidFilePathException(sprintf('The remote file "%s" could not be loaded. Error: "%s"', $asyncApiPath, error_get_last() ? error_get_last()['message'] : 'Unknown error'));
$lastError = error_get_last();

throw new InvalidFilePathException(sprintf('The remote file "%s" could not be loaded. Error: "%s"', $asyncApiPath, $lastError ? $lastError['message'] : 'Unknown error'));
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,6 @@ public function getMessages(): iterable

/**
* @param string $messageName
*
* @return \SprykerSdk\AsyncApi\AsyncApi\Message\AsyncApiMessageInterface|null
*/
public function getMessage(string $messageName): ?AsyncApiMessageInterface
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,6 @@ public function getMessages(): iterable;

/**
* @param string $messageName
*
* @return \SprykerSdk\AsyncApi\AsyncApi\Message\AsyncApiMessageInterface|null
*/
public function getMessage(string $messageName): ?AsyncApiMessageInterface;
}
6 changes: 4 additions & 2 deletions src/SprykerSdk/AsyncApi/AsyncApiConfig.php
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,10 @@ public function getProjectRootPath(): string
*/
public function getSprykRunExecutablePath(): string
{
if (getenv('INSTALLED_ROOT_DIRECTORY')) {
return getenv('INSTALLED_ROOT_DIRECTORY');
$installedRootDirectory = getenv('INSTALLED_ROOT_DIRECTORY');

if ($installedRootDirectory) {
return $installedRootDirectory;
}

return (string)getcwd();
Expand Down
2 changes: 0 additions & 2 deletions src/SprykerSdk/AsyncApi/Code/Builder/AsyncApiCodeBuilder.php
Original file line number Diff line number Diff line change
Expand Up @@ -363,8 +363,6 @@ protected function normalizeTransferType(string $type): string

/**
* @param string $propertyName
*
* @return string|null
*/
protected function getSingularized(string $propertyName): ?string
{
Expand Down
2 changes: 1 addition & 1 deletion src/SprykerSdk/AsyncApi/Console/AbstractConsole.php
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ class AbstractConsole extends Command
/**
* @var \SprykerSdk\AsyncApi\AsyncApiConfig|null
*/
protected ?AsyncApiConfig $config = null;
protected ?AsyncApiConfig $config;

/**
* @var \SprykerSdk\AsyncApi\AsyncApiFacadeInterface|null
Expand Down
Loading