-
Notifications
You must be signed in to change notification settings - Fork 18
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #63 from thibaudgirard/feat/make-amqp-v2-compatible
feat(amqp): make amqp v2 compatible
- Loading branch information
Showing
44 changed files
with
729 additions
and
530 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,4 @@ | ||
/vendor/ | ||
/composer.lock | ||
bin/ | ||
var |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
<?php | ||
|
||
$finder = PhpCsFixer\Finder::create() | ||
->in([ | ||
__DIR__.'/src', | ||
]); | ||
|
||
$config = new class() extends PhpCsFixer\Config { | ||
public function __construct() | ||
{ | ||
parent::__construct('Bedrock Streaming'); | ||
|
||
$this->setRiskyAllowed(true); | ||
} | ||
|
||
public function getRules(): array | ||
{ | ||
return array_merge((new M6Web\CS\Config\BedrockStreaming())->getRules(), [ | ||
'no_unreachable_default_argument_value' => true, | ||
'trailing_comma_in_multiline' => [ | ||
'after_heredoc' => true, | ||
'elements' => ['arrays', 'arguments', 'parameters'], | ||
], | ||
'native_function_invocation' => [ | ||
'include' => ['@compiler_optimized'] | ||
], | ||
'simplified_null_return' => false, | ||
'void_return' => true, | ||
'phpdoc_order' => true, | ||
'phpdoc_types_order' => false, | ||
'no_superfluous_phpdoc_tags' => true, | ||
'php_unit_test_case_static_method_calls' => [ | ||
'call_type' => 'static', | ||
], | ||
'yoda_style' => [ | ||
'equal' => false, | ||
'identical' => false, | ||
'less_and_greater' => false | ||
], | ||
]); | ||
} | ||
}; | ||
|
||
$config | ||
->setFinder($finder) | ||
->setCacheFile('var/cache/tools/.php-cs-fixer.cache'); | ||
|
||
return $config; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
SOURCE_DIR = $(shell pwd) | ||
BIN_DIR ?= ${SOURCE_DIR}/bin | ||
|
||
define printSection | ||
@printf "\033[36m\n==================================================\033[0m\n" | ||
@printf "\033[36m $1 \033[0m" | ||
@printf "\033[36m\n==================================================\033[0m\n" | ||
endef | ||
|
||
.PHONY: all | ||
all: install ci | ||
|
||
.PHONY: ci | ||
ci: quality test | ||
|
||
.PHONY: install | ||
install: clean-vendor composer-install | ||
|
||
.PHONY: quality | ||
quality: cs-ci phpstan | ||
|
||
.PHONY: test | ||
test: atoum | ||
|
||
.PHONY: clean-vendor | ||
clean-vendor: | ||
$(call printSection,CLEAN VENDOR) | ||
rm -rf ${SOURCE_DIR}/vendor | ||
|
||
.PHONY: phpstan | ||
phpstan: phpstan-cache-clear | ||
$(call printSection,PHPSTAN) | ||
${BIN_DIR}/phpstan.phar analyse --memory-limit=1G | ||
|
||
.PHONY: phpstan-cache-clear | ||
phpstan-cache-clear: | ||
${BIN_DIR}/phpstan.phar clear-result-cache | ||
|
||
composer-install: | ||
$(call printSection,COMPOSER INSTALL) | ||
composer --no-interaction install --ansi --no-progress --prefer-dist | ||
|
||
atoum: | ||
$(call printSection,TESTING) | ||
${BIN_DIR}/atoum --no-code-coverage --verbose | ||
|
||
.PHONY: cs | ||
cs: composer-install | ||
${BIN_DIR}/php-cs-fixer fix --dry-run --stop-on-violation --diff | ||
|
||
.PHONY: cs-fix | ||
cs-fix: composer-install | ||
${BIN_DIR}/php-cs-fixer fix | ||
|
||
.PHONY: cs-ci | ||
cs-ci: composer-install | ||
$(call printSection,PHPCS) | ||
${BIN_DIR}/php-cs-fixer fix --dry-run --using-cache=no --verbose |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,119 @@ | ||
#!/usr/bin/env php | ||
<?php | ||
|
||
/** | ||
* Proxy PHP file generated by Composer | ||
* | ||
* This file includes the referenced bin path (../vendor/atoum/atoum/bin/atoum) | ||
* using a stream wrapper to prevent the shebang from being output on PHP<8 | ||
* | ||
* @generated | ||
*/ | ||
|
||
namespace Composer; | ||
|
||
$GLOBALS['_composer_bin_dir'] = __DIR__; | ||
$GLOBALS['_composer_autoload_path'] = __DIR__ . '/..'.'/vendor/autoload.php'; | ||
|
||
if (PHP_VERSION_ID < 80000) { | ||
if (!class_exists('Composer\BinProxyWrapper')) { | ||
/** | ||
* @internal | ||
*/ | ||
final class BinProxyWrapper | ||
{ | ||
private $handle; | ||
private $position; | ||
private $realpath; | ||
|
||
public function stream_open($path, $mode, $options, &$opened_path) | ||
{ | ||
// get rid of phpvfscomposer:// prefix for __FILE__ & __DIR__ resolution | ||
$opened_path = substr($path, 17); | ||
$this->realpath = realpath($opened_path) ?: $opened_path; | ||
$opened_path = $this->realpath; | ||
$this->handle = fopen($this->realpath, $mode); | ||
$this->position = 0; | ||
|
||
return (bool) $this->handle; | ||
} | ||
|
||
public function stream_read($count) | ||
{ | ||
$data = fread($this->handle, $count); | ||
|
||
if ($this->position === 0) { | ||
$data = preg_replace('{^#!.*\r?\n}', '', $data); | ||
} | ||
|
||
$this->position += strlen($data); | ||
|
||
return $data; | ||
} | ||
|
||
public function stream_cast($castAs) | ||
{ | ||
return $this->handle; | ||
} | ||
|
||
public function stream_close() | ||
{ | ||
fclose($this->handle); | ||
} | ||
|
||
public function stream_lock($operation) | ||
{ | ||
return $operation ? flock($this->handle, $operation) : true; | ||
} | ||
|
||
public function stream_seek($offset, $whence) | ||
{ | ||
if (0 === fseek($this->handle, $offset, $whence)) { | ||
$this->position = ftell($this->handle); | ||
return true; | ||
} | ||
|
||
return false; | ||
} | ||
|
||
public function stream_tell() | ||
{ | ||
return $this->position; | ||
} | ||
|
||
public function stream_eof() | ||
{ | ||
return feof($this->handle); | ||
} | ||
|
||
public function stream_stat() | ||
{ | ||
return array(); | ||
} | ||
|
||
public function stream_set_option($option, $arg1, $arg2) | ||
{ | ||
return true; | ||
} | ||
|
||
public function url_stat($path, $flags) | ||
{ | ||
$path = substr($path, 17); | ||
if (file_exists($path)) { | ||
return stat($path); | ||
} | ||
|
||
return false; | ||
} | ||
} | ||
} | ||
|
||
if ( | ||
(function_exists('stream_get_wrappers') && in_array('phpvfscomposer', stream_get_wrappers(), true)) | ||
|| (function_exists('stream_wrapper_register') && stream_wrapper_register('phpvfscomposer', 'Composer\BinProxyWrapper')) | ||
) { | ||
return include("phpvfscomposer://" . __DIR__ . '/..'.'/vendor/atoum/atoum/bin/atoum'); | ||
} | ||
} | ||
|
||
return include __DIR__ . '/..'.'/vendor/atoum/atoum/bin/atoum'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
parameters: | ||
paths: | ||
- 'src' | ||
excludePaths: | ||
- 'src/AmqpBundle/Tests' | ||
- 'src/AmqpBundle/Sandbox' | ||
- 'src/AmqpBundle/DependencyInjection' | ||
|
||
level: 8 | ||
checkMissingIterableValueType: false | ||
checkGenericClassInNonGenericObjectType: false | ||
treatPhpDocTypesAsCertain: false | ||
|
||
ignoreErrors: | ||
- '#Unable to resolve the template type T in call to method Symfony\\Contracts\\EventDispatcher\\EventDispatcherInterface::dispatch\(\)#' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
use Rector\Config\RectorConfig; | ||
use Rector\TypeDeclaration\Rector\ClassMethod\AddVoidReturnTypeWhereNoReturnRector; | ||
|
||
return RectorConfig::configure() | ||
->withPaths([ | ||
__DIR__ . '/src', | ||
]) | ||
// uncomment to reach your current PHP version | ||
// ->withPhpSets() | ||
->withRules([ | ||
AddVoidReturnTypeWhereNoReturnRector::class, | ||
]); |
Oops, something went wrong.