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
148 changes: 34 additions & 114 deletions .github/workflows/continuous-integration.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,159 +16,79 @@ jobs:
strategy:
matrix:
php-version:
- "7.3"
- "7.4"
- "8.0"
- "8.1"
deps:
- "normal"
symfony-require:
- ""
symfony-deprecations-helper:
- ""
include:
# Test against latest Symfony 4.4 stable on 7.3
- symfony-require: "4.4.*"
php-version: "7.3"
deps: "dev"

# Test against latest Symfony 4.4 stable on 7.3 deps low
- symfony-require: "4.4.*"
php-version: "7.3"
deps: "low"

# Test against latest Symfony 4.4 stable on 7.3 deps normal
- symfony-require: "4.4.*"
php-version: "7.3"
deps: "normal"

# Test against latest Symfony 4.4 stable on 7.4
- symfony-require: "4.4.*"
# Test against latest Symfony 5.4 stable on 7.4
- symfony-require: "5.4.*"
php-version: "7.4"
deps: "dev"

# Test against latest Symfony 4.4 stable on 7.4 deps low
- symfony-require: "4.4.*"
php-version: "7.4"
deps: "low"

# Test against latest Symfony 4.4 stable on 7.4 deps normal
- symfony-require: "4.4.*"
# Test against latest Symfony 5.4 stable on 7.4 deps normal
- symfony-require: "5.4.*"
php-version: "7.4"
deps: "normal"

# Test against latest Symfony 4.4 stable on 8.0
- symfony-require: "4.4.*"
# Test against latest Symfony 5.4 stable on 8.0
- symfony-require: "5.4.*"
php-version: "8.0"
deps: "dev"

# Test against latest Symfony 4.4 stable on 7.4 deps normal
- symfony-require: "4.4.*"
# Test against latest Symfony 5.4 stable on 8.0 deps normal
- symfony-require: "5.4.*"
php-version: "8.0"
deps: "normal"

# Test against latest Symfony 5.1 stable on 7.3
- symfony-require: "5.1.*"
php-version: "7.3"
deps: "dev"

# Test against latest Symfony 5.1 stable on 7.3 deps low
- symfony-require: "5.1.*"
php-version: "7.3"
deps: "low"

# Test against latest Symfony 5.1 stable on 7.3 deps normal
- symfony-require: "5.1.*"
php-version: "7.3"
deps: "normal"

# Test against latest Symfony 5.1 stable on 7.4
- symfony-require: "5.1.*"
php-version: "7.4"
# Test against latest Symfony 5.4 stable on 8.1
- symfony-require: "5.4.*"
php-version: "8.1"
deps: "dev"

# Test against latest Symfony 5.1 stable on 7.4 deps low
- symfony-require: "5.1.*"
php-version: "7.4"
deps: "low"

# Test against latest Symfony 5.1 stable on 7.4 deps normal
- symfony-require: "5.1.*"
php-version: "7.4"
# Test against latest Symfony 5.4 stable on 8.1 deps normal
- symfony-require: "5.4.*"
php-version: "8.1"
deps: "normal"

# Test against latest Symfony 5.1 stable on 8.0
- symfony-require: "5.1.*"
# Test against latest Symfony 6.0 stable on 8.0
- symfony-require: "6.0.*"
php-version: "8.0"
deps: "dev"

# Test against latest Symfony 5.1 stable on 7.4 deps normal
- symfony-require: "5.1.*"
# Test against latest Symfony 6.0 stable on 8.0 deps normal
- symfony-require: "6.0.*"
php-version: "8.0"
deps: "normal"

# Test against latest Symfony 5.2 stable on 7.3
- symfony-require: "5.2.*"
php-version: "7.3"
deps: "dev"

# Test against latest Symfony 5.2 stable on 7.3 deps low
- symfony-require: "5.2.*"
php-version: "7.3"
deps: "low"

# Test against latest Symfony 5.2 stable on 7.3 deps normal
- symfony-require: "5.2.*"
php-version: "7.3"
deps: "normal"

# Test against latest Symfony 5.2 stable on 7.4
- symfony-require: "5.2.*"
php-version: "7.4"
# Test against latest Symfony 6.0 stable on 8.1
- symfony-require: "6.0.*"
php-version: "8.1"
deps: "dev"

# Test against latest Symfony 5.2 stable on 7.4 deps low
- symfony-require: "5.2.*"
php-version: "7.4"
deps: "low"

# Test against latest Symfony 5.2 stable on 7.4 deps normal
- symfony-require: "5.2.*"
php-version: "7.4"
# Test against latest Symfony 6.0 stable on 8.1 deps normal
- symfony-require: "6.0.*"
php-version: "8.1"
deps: "normal"

# Test against latest Symfony 5.2 stable on 8.0
- symfony-require: "5.2.*"
php-version: "8.0"
# Test against latest Symfony 6.1 stable on 8.1
- symfony-require: "6.1.*"
php-version: "8.1"
deps: "dev"

# Test against latest Symfony 5.2 stable on 7.4 deps normal
- symfony-require: "5.2.*"
php-version: "8.0"
# Test against latest Symfony 6.1 stable on 8.1 deps normal
- symfony-require: "6.1.*"
php-version: "8.1"
deps: "normal"

# Test against latest Symfony 5.3 dev on 7.3
- symfony-require: "5.3.*"
php-version: "7.3"
deps: "dev"

# Test against latest Symfony 5.3 dev on 7.4
- symfony-require: "5.3.*"
php-version: "7.4"
deps: "dev"

# Test against latest Symfony 5.3 dev on 8.0
- symfony-require: "5.3.*"
php-version: "8.0"
deps: "dev"

# Test bleeding edge
- php-version: "8.0"
deps: "dev"
symfony-deprecations-helper: "weak"

steps:
- name: "Checkout"
uses: "actions/checkout@v2"
uses: "actions/checkout@v3"
with:
fetch-depth: 2

Expand All @@ -179,7 +99,7 @@ jobs:
coverage: "pcov"

- name: "Cache dependencies installed with composer"
uses: "actions/cache@v2"
uses: "actions/cache@v3"
with:
path: "~/.composer/cache"
key: "php-${{ matrix.php-version }}-composer-locked-${{ hashFiles('composer.lock') }}"
Expand All @@ -205,7 +125,7 @@ jobs:
with:
name: "phpunit-${{ matrix.php-version }}-${{ matrix.deps }}-${{ hashFiles('composer.lock') }}.coverage"
path: "coverage.xml"

- uses: codecov/codecov-action@v1
with:
verbose: true
10 changes: 2 additions & 8 deletions ClientConfiguration.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,14 +20,8 @@ class ClientConfiguration extends ParameterBag implements ConfigurationInterface
{
/**
* ClientConfiguration constructor.
* @param ApiToken $apiToken
* @param EventDispatcherInterface $eventDispatcher
* @param ClientInterface $client
* @param RequestFactoryInterface $requestFactory
* @param ResponseFactoryInterface $responseFactory
* @param StreamFactoryInterface $streamFactory
* @param UriFactoryInterface $uriFactory
* @param array $options
*
* @param array<string, mixed> $options
*/
public function __construct(
ApiToken $apiToken,
Expand Down
27 changes: 5 additions & 22 deletions DependencyInjection/CompilerPass/ConfigurationPass.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,17 +14,13 @@

class ConfigurationPass implements CompilerPassInterface
{
/**
* @param ContainerBuilder $container
*
* @return void
*/
public function process(ContainerBuilder $container)
public function process(ContainerBuilder $container): void
{
/** @var array<string, mixed> $parameters */
$parameters = $container->getParameter('tmdb.options');
$configDefinition = $container->getDefinition(ClientConfiguration::class);

// By default the first argument is always referenced to the ApiToken.
// By default, the first argument is always referenced to the ApiToken.
if (null !== $bearerToken = $parameters['options']['bearer_token']) {
$configDefinition->replaceArgument(0, new Reference(BearerToken::class));
}
Expand All @@ -34,11 +30,7 @@ public function process(ContainerBuilder $container)
}

/**
* @param ContainerBuilder $container
* @param Definition $configDefinition
* @param array $parameters
*
* @return void
* @param array<string, mixed> $parameters
*/
private function setupEventDispatcher(
ContainerBuilder $container,
Expand All @@ -58,11 +50,7 @@ private function setupEventDispatcher(
}

/**
* @param ContainerBuilder $container
* @param Definition $configDefinition
* @param array $parameters
*
* @return void
* @param array<string, mixed> $parameters
*/
private function setupHttpClient(
ContainerBuilder $container,
Expand Down Expand Up @@ -122,11 +110,6 @@ private function setupHttpClient(
}

/**
* @param ContainerBuilder $container
* @param string $alias
* @param string $tag
* @param string $configurationPath
* @return void
* @throws \RuntimeException
*/
protected function tryToAliasAutowiredInterfacesIfPossible(
Expand Down
43 changes: 8 additions & 35 deletions DependencyInjection/CompilerPass/EventDispatchingPass.php
Original file line number Diff line number Diff line change
Expand Up @@ -30,13 +30,9 @@
*/
class EventDispatchingPass implements CompilerPassInterface
{
/**
* @param ContainerBuilder $container
*
* @return void
*/
public function process(ContainerBuilder $container)
public function process(ContainerBuilder $container): void
{
/** @var array<string, mixed> $parameters */
$parameters = $container->getParameter('tmdb.options');
$clientOptions = $parameters['options'];

Expand All @@ -54,11 +50,7 @@ public function process(ContainerBuilder $container)
}

/**
* @param ContainerBuilder $container
* @param Definition $eventDispatcher
* @param array $parameters
*
* @return void
* @param array<string, mixed> $parameters
*/
private function handleSymfonyEventDispatcherRegistration(
ContainerBuilder $container,
Expand Down Expand Up @@ -123,9 +115,7 @@ private function handleSymfonyEventDispatcherRegistration(
}

/**
* @param ContainerBuilder $container
* @param array $parameters
* @return Definition
* @param array<string, mixed> $parameters
*/
private function getRequestListener(
ContainerBuilder $container,
Expand All @@ -139,9 +129,7 @@ private function getRequestListener(
}

/**
* @param ContainerBuilder $container
* @param array $parameters
* @return Definition
* @param array<string, mixed> $parameters
*/
private function getPsr6CacheRequestListener(
ContainerBuilder $container,
Expand All @@ -154,21 +142,15 @@ private function getPsr6CacheRequestListener(
}

/**
* @param string $event
* @param string $listener
* @param Definition $eventDispatcher
* @param ContainerBuilder $container
* @param array $parameters
*
* @return void
* @param array<string, mixed> $parameters
*/
private function handleLogging(
string $event,
string $listener,
Definition $eventDispatcher,
ContainerBuilder $container,
array $parameters
) {
): void {
$options = $parameters[$listener];
$configEntry = sprintf('tmdb_symfony.log.%s', $listener);

Expand Down Expand Up @@ -231,11 +213,7 @@ private function handleLogging(
/**
* Register listeners for logging.
*
* @param ContainerBuilder $container
* @param Definition $eventDispatcher
* @param array $parameters
*
* @return void
* @param array<string, mixed> $parameters
*/
private function handleLoggerListeners(ContainerBuilder $container, Definition $eventDispatcher, array $parameters): void
{
Expand All @@ -258,11 +236,6 @@ private function handleLoggerListeners(ContainerBuilder $container, Definition $
}
}

/**
* @param Definition $eventDispatcher
* @param string $event
* @param string $reference
*/
private function registerEventListener(
Definition $eventDispatcher,
string $event,
Expand Down
Loading