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

Maintenance #255

Merged
merged 3 commits into from
May 28, 2024
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
18 changes: 18 additions & 0 deletions .github/workflows/composer-lint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
name: "Composer Lint"

on:
pull_request:
branches:
- "*.x"
paths:
- "composer.json"
push:
branches:
- "*.x"
paths:
- "composer.json"

jobs:
composer-lint:
name: "Composer Lint"
uses: "doctrine/.github/.github/workflows/[email protected]"
45 changes: 36 additions & 9 deletions composer.json
Original file line number Diff line number Diff line change
@@ -1,17 +1,43 @@
{
"name": "doctrine/inflector",
"type": "library",
"description": "PHP Doctrine Inflector is a small library that can perform string manipulations with regard to upper/lowercase and singular/plural forms of words.",
"keywords": ["php", "strings", "words", "manipulation", "inflector", "inflection", "uppercase", "lowercase", "singular", "plural"],
"homepage": "https://www.doctrine-project.org/projects/inflector.html",
"license": "MIT",
"type": "library",
"keywords": [
"php",
"strings",
"words",
"manipulation",
"inflector",
"inflection",
"uppercase",
"lowercase",
"singular",
"plural"
],
"authors": [
{"name": "Guilherme Blanco", "email": "[email protected]"},
{"name": "Roman Borschel", "email": "[email protected]"},
{"name": "Benjamin Eberlei", "email": "[email protected]"},
{"name": "Jonathan Wage", "email": "[email protected]"},
{"name": "Johannes Schmitt", "email": "[email protected]"}
{
"name": "Guilherme Blanco",
"email": "[email protected]"
},
{
"name": "Roman Borschel",
"email": "[email protected]"
},
{
"name": "Benjamin Eberlei",
"email": "[email protected]"
},
{
"name": "Jonathan Wage",
"email": "[email protected]"
},
{
"name": "Johannes Schmitt",
"email": "[email protected]"
}
],
"homepage": "https://www.doctrine-project.org/projects/inflector.html",
"require": {
"php": "^7.2 || ^8.0"
},
Expand All @@ -36,6 +62,7 @@
"config": {
"allow-plugins": {
"dealerdirect/phpcodesniffer-composer-installer": true
}
},
"sort-packages": true
}
}
2 changes: 2 additions & 0 deletions psalm.xml
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
<?xml version="1.0"?>
<psalm
errorLevel="7"
findUnusedBaselineEntry="true"
findUnusedCode="false"
resolveFromConfigFile="true"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns="https://getpsalm.org/schema/config"
Expand Down
7 changes: 1 addition & 6 deletions src/Rules/Patterns.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,19 +10,14 @@

class Patterns
{
/** @var Pattern[] */
private $patterns;

/** @var string */
private $regex;

public function __construct(Pattern ...$patterns)
{
$this->patterns = $patterns;

$patterns = array_map(static function (Pattern $pattern): string {
return $pattern->getPattern();
}, $this->patterns);
}, $patterns);

$this->regex = '/^(?:' . implode('|', $patterns) . ')$/i';
}
Expand Down