Skip to content

Commit

Permalink
Merge pull request #1110 from peter279k/ternary_to_null
Browse files Browse the repository at this point in the history
Apply ternary to null operator
  • Loading branch information
veewee authored Sep 21, 2023
2 parents 9970720 + 5a37cc4 commit cbfbb2c
Showing 1 changed file with 3 additions and 9 deletions.
12 changes: 3 additions & 9 deletions src/Task/Git/CommitMessage.php
Original file line number Diff line number Diff line change
Expand Up @@ -368,21 +368,15 @@ private function checkTypeScopeConventions(GitCommitMsgContext $context): void
$config = $this->getConfig()->getOptions();
$subjectLine = $this->getSubjectLine($context);

$types = isset($config['type_scope_conventions']['types'])
? $config['type_scope_conventions']['types']
: [];
$types = $config['type_scope_conventions']['types'] ?? [];

$scopes = isset($config['type_scope_conventions']['scopes'])
? $config['type_scope_conventions']['scopes']
: [];
$scopes = $config['type_scope_conventions']['scopes'] ?? [];

$specialPrefix = '(?:(?:fixup|squash)! )?';
$typesPattern = '([a-zA-Z0-9]+)';
$scopesPattern = '(:\s|(\(.+\)?:\s))';

$subjectPattern = isset($config['type_scope_conventions']['subject_pattern'])
? $config['type_scope_conventions']['subject_pattern']
: '([a-zA-Z0-9-_ #@\'\/\\"]+)';
$subjectPattern = $config['type_scope_conventions']['subject_pattern'] ?? '([a-zA-Z0-9-_ #@\'\/\\"]+)';

if (count($types) > 0) {
$types = implode('|', $types);
Expand Down

0 comments on commit cbfbb2c

Please sign in to comment.