Skip to content

Commit

Permalink
adapt production code
Browse files Browse the repository at this point in the history
  • Loading branch information
tfrommen committed Jan 9, 2025
1 parent daeaee5 commit a2c3d3d
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 14 deletions.
8 changes: 4 additions & 4 deletions src/Container/ServiceExtensions.php
Original file line number Diff line number Diff line change
Expand Up @@ -86,17 +86,17 @@ protected function resolveById(string $id, $service, Container $container)
* @param array $extendedClasses
* @return mixed
*
* phpcs:disable Generic.Metrics.CyclomaticComplexity
* phpcs:disable Inpsyde.CodeQuality.ReturnTypeDeclaration
* phpcs:disable SlevomatCodingStandard.Complexity.Cognitive.ComplexityTooHigh
* phpcs:disable Syde.Functions.ReturnTypeDeclaration.NoReturnType
*/
protected function resolveByType(
string $className,
object $service,
Container $container,
array $extendedClasses = []
) {
// phpcs:enable Generic.Metrics.CyclomaticComplexity
// phpcs:enable Inpsyde.CodeQuality.ReturnTypeDeclaration
// phpcs:enable SlevomatCodingStandard.Complexity.Cognitive.ComplexityTooHigh
// phpcs:enable Syde.Functions.ReturnTypeDeclaration.NoReturnType

$extendedClasses[] = $className;

Expand Down
6 changes: 2 additions & 4 deletions src/Package.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@

use Inpsyde\Modularity\Container\ContainerConfigurator;
use Inpsyde\Modularity\Container\PackageProxyContainer;
use Inpsyde\Modularity\Module\ExtendingModule;
use Inpsyde\Modularity\Module\ExecutableModule;
use Inpsyde\Modularity\Module\ExtendingModule;
use Inpsyde\Modularity\Module\FactoryModule;
use Inpsyde\Modularity\Module\Module;
use Inpsyde\Modularity\Module\ServiceModule;
Expand Down Expand Up @@ -270,12 +270,9 @@ public function addModule(Module $module): Package
/**
* @param Package $package
* @return bool
*
* phpcs:disable Inpsyde.CodeQuality.FunctionLength
*/
public function connect(Package $package): bool
{
// phpcs:enable Inpsyde.CodeQuality.FunctionLength
try {
if ($package === $this) {
return false;
Expand Down Expand Up @@ -813,6 +810,7 @@ private function deprecatedArgument(string $message, string $function, string $v

if (apply_filters('deprecated_argument_trigger_error', true)) {
do_action('wp_trigger_error_run', $function, $message, \E_USER_DEPRECATED);
// phpcs:ignore WordPress.PHP.DevelopmentFunctions.error_log_trigger_error
trigger_error(esc_html($message), \E_USER_DEPRECATED);
}
}
Expand Down
2 changes: 1 addition & 1 deletion src/Properties/BaseProperties.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ class BaseProperties implements Properties
protected function __construct(
string $baseName,
string $basePath,
string $baseUrl = null,
?string $baseUrl = null,
array $properties = []
) {

Expand Down
7 changes: 2 additions & 5 deletions src/Properties/LibraryProperties.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,11 @@ class LibraryProperties extends BaseProperties
* @param string|null $baseUrl
* @return LibraryProperties
*
* phpcs:disable Generic.Metrics.CyclomaticComplexity
* phpcs:disable SlevomatCodingStandard.Complexity
*/
public static function new(string $composerJsonFile, ?string $baseUrl = null): LibraryProperties
{
// phpcs:enable Generic.Metrics.CyclomaticComplexity
// phpcs:enable SlevomatCodingStandard.Complexity
if (!\is_file($composerJsonFile) || !\is_readable($composerJsonFile)) {
throw new \Exception(
esc_html("File {$composerJsonFile} does not exist or is not readable.")
Expand Down Expand Up @@ -131,12 +131,9 @@ private static function buildNames(array $composerJsonData): array
* @param array $composerData
* @param string $key
* @return string
*
* phpcs:disable Generic.Metrics.CyclomaticComplexity
*/
private static function extractPhpVersion(array $composerData, string $key = 'require'): string
{
// phpcs:enable Generic.Metrics.CyclomaticComplexity
$nextKey = ($key === 'require') ? 'require-dev' : null;
$base = $composerData[$key] ?? null;
$requirement = is_array($base) ? ($base['php'] ?? '') : '';
Expand Down

0 comments on commit a2c3d3d

Please sign in to comment.