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

Refactor and improvement code style #1545

Closed
wants to merge 5 commits into from
Closed
Changes from 1 commit
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
Prev Previous commit
refactor: using ternary operator (reason: more readability)
saMahmoudzadeh committed Feb 4, 2024
commit 19dab07c14bd4007622b4bc8a00cc789477e3aaa
6 changes: 1 addition & 5 deletions src/Loggers/DefaultLogger.php
Original file line number Diff line number Diff line change
@@ -22,11 +22,7 @@ public function log($level, $message, array $context = []): void
$message = $message->getMessage();
}

if (in_array($level, [LogLevel::NOTICE, LogLevel::INFO])) {
$error_level = E_USER_NOTICE;
} else {
$error_level = E_USER_WARNING;
}
$error_level = in_array($level, [LogLevel::NOTICE, LogLevel::INFO]) ? E_USER_NOTICE : E_USER_WARNING;

trigger_error($message, $error_level);
}

Unchanged files with check annotations Beta

} else if (is_string($schema->type) &&
$typeSchema = ($analysis->getSchemaForSource($schema->type) && Generator::isDefault($schema->format))) {
$schema->ref = OA\Components::ref($typeSchema);

Check failure on line 108 in src/Processors/AugmentSchemas.php

GitHub Actions / static-analysis

Parameter #1 $component of static method OpenApi\Annotations\Components::ref() expects OpenApi\Annotations\AbstractAnnotation|string, true given.
$schema->type = Generator::UNDEFINED;
}
}