Skip to content

Commit

Permalink
Merge pull request #77 from jawira/fix-psalm
Browse files Browse the repository at this point in the history
Fix psalm
  • Loading branch information
jawira authored Nov 16, 2021
2 parents 2ed1418 + fc03aed commit e983ef4
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 9 deletions.
6 changes: 5 additions & 1 deletion .github/workflows/qa.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
name: Quality assurance
on: pull_request
on:
pull_request:
push:
branches:
- master

jobs:

Expand Down
2 changes: 1 addition & 1 deletion psalm.xml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?xml version="1.0"?>
<psalm errorLevel="5"
<psalm errorLevel="1"
resolveFromConfigFile="true"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns="https://getpsalm.org/schema/config"
Expand Down
11 changes: 5 additions & 6 deletions src/Glue/Gluer.php
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ abstract class Gluer
* @param string[] $words
* @param bool $forceSimpleCaseMapping
*/
public function __construct(array $words, bool $forceSimpleCaseMapping)
final public function __construct(array $words, bool $forceSimpleCaseMapping)
{
$this->words = $words;
$this->lowerCase = MB_CASE_LOWER;
Expand Down Expand Up @@ -94,14 +94,13 @@ abstract public function glue(): string;
*/
protected function setSimpleCaseMappingConstants(): self
{
/** @var int $lowerCase */
$lowerCase = defined('\MB_CASE_LOWER_SIMPLE') ? constant('\MB_CASE_LOWER_SIMPLE') : MB_CASE_LOWER;
/** @var int $upperCase */
$upperCase = defined('\MB_CASE_UPPER_SIMPLE') ? constant('\MB_CASE_UPPER_SIMPLE') : MB_CASE_UPPER;
/** @var int $titleCase */
$titleCase = defined('\MB_CASE_TITLE_SIMPLE') ? constant('\MB_CASE_TITLE_SIMPLE') : MB_CASE_TITLE;

assert(is_int($lowerCase));
assert(is_int($upperCase));
assert(is_int($titleCase));

$this->lowerCase = $lowerCase;
$this->upperCase = $upperCase;
$this->titleCase = $titleCase;
Expand Down Expand Up @@ -146,7 +145,7 @@ protected function changeWordsCase(array $words, int $caseMode): array
return $words;
}

$closure = function (string $word) use ($caseMode) {
$closure = function (string $word) use ($caseMode): string {
return mb_convert_case($word, $caseMode, self::ENCODING);
};

Expand Down
2 changes: 1 addition & 1 deletion src/Split/Splitter.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ abstract class Splitter
*/
protected $inputString;

public function __construct(string $inputString)
final public function __construct(string $inputString)
{
$this->inputString = $inputString;
}
Expand Down

0 comments on commit e983ef4

Please sign in to comment.