-
Notifications
You must be signed in to change notification settings - Fork 14
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
23 changed files
with
521 additions
and
267 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
/.gitattributes export-ignore | ||
/.github export-ignore | ||
/.gitignore export-ignore | ||
/phpunit.xml.dist export-ignore | ||
/spec export-ignore |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
version: 2 | ||
updates: | ||
- package-ecosystem: composer | ||
directory: "/" | ||
schedule: | ||
interval: daily | ||
time: "04:00" | ||
open-pull-requests-limit: 10 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
name: Static analysis | ||
|
||
on: | ||
pull_request: | ||
push: | ||
|
||
defaults: | ||
run: | ||
shell: bash | ||
|
||
jobs: | ||
static_analysis: | ||
name: Static analysis | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v2 | ||
with: | ||
fetch-depth: 2 | ||
|
||
- name: Setup PHP | ||
uses: shivammathur/setup-php@v2 | ||
with: | ||
coverage: none | ||
ini-values: "memory_limit=-1" | ||
php-version: "8.0" | ||
|
||
- name: Install dependencies | ||
run: | | ||
composer update --prefer-dist --no-progress | ||
- name: Run php-cs-fixer | ||
run: | | ||
php vendor/bin/php-cs-fixer fix --diff --dry-run -v | ||
- name: Run phpstan | ||
run: | | ||
php vendor/bin/phpstan | ||
- name: Run phpmd | ||
run: | | ||
php vendor/bin/phpmd src xml pmd-ruleset.xml |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
name: Unit tests | ||
|
||
on: | ||
pull_request: | ||
push: | ||
|
||
defaults: | ||
run: | ||
shell: bash | ||
|
||
jobs: | ||
tests: | ||
name: Unit tests | ||
runs-on: ubuntu-latest | ||
|
||
strategy: | ||
matrix: | ||
include: | ||
- php: '7.4' | ||
mode: low-deps | ||
- php: '7.4' | ||
- php: '8.0' | ||
mode: low-deps | ||
- php: '8.0' | ||
fail-fast: false | ||
|
||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v2 | ||
with: | ||
fetch-depth: 2 | ||
|
||
- name: Setup PHP | ||
uses: shivammathur/setup-php@v2 | ||
with: | ||
coverage: none | ||
extensions: "intl, bcmath" | ||
php-version: "${{ matrix.php }}" | ||
|
||
- name: Validate composer.json and composer.lock | ||
run: composer validate --strict --no-check-lock | ||
|
||
- name: Install dependencies | ||
run: | | ||
composer update --prefer-dist --no-progress $([ '${{ matrix.mode }}' = low-deps ] && echo '--prefer-lowest') | ||
- name: Run phpspec | ||
run: | | ||
php vendor/bin/phpspec run |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
/composer.lock | ||
/vendor/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,78 @@ | ||
<?php | ||
|
||
$finder = PhpCsFixer\Finder::create() | ||
->files() | ||
->name('*.php') | ||
->in(__DIR__ . '/') | ||
->exclude('Resources/config') | ||
->exclude('src/DependencyInjection') | ||
->exclude('test_e2e') | ||
; | ||
|
||
$config = new PhpCsFixer\Config(); | ||
$config->setRiskyAllowed(true) | ||
->setRules( | ||
[ | ||
'@DoctrineAnnotation' => true, | ||
'@Symfony' => true, | ||
'@Symfony:risky' => true, | ||
|
||
// @Symfony code styles rules blacklisting: | ||
'method_chaining_indentation' => true, | ||
'no_singleline_whitespace_before_semicolons' => true, | ||
'no_trailing_comma_in_list_call' => false, | ||
'php_unit_fqcn_annotation' => false, | ||
'phpdoc_align' => false, | ||
'phpdoc_annotation_without_dot' => false, | ||
'phpdoc_indent' => false, | ||
'phpdoc_inline_tag_normalizer' => false, | ||
'phpdoc_no_access' => false, | ||
'phpdoc_no_alias_tag' => false, | ||
'phpdoc_no_empty_return' => false, | ||
'phpdoc_no_package' => false, | ||
'phpdoc_no_useless_inheritdoc' => false, | ||
'phpdoc_return_self_reference' => false, | ||
'phpdoc_scalar' => false, | ||
'phpdoc_separation' => false, | ||
'phpdoc_single_line_var_spacing' => false, | ||
'phpdoc_summary' => false, | ||
'phpdoc_to_comment' => false, | ||
'phpdoc_trim' => false, | ||
'phpdoc_types' => false, | ||
'phpdoc_var_without_name' => false, | ||
'error_suppression' => false, | ||
'standardize_not_equals' => false, | ||
|
||
// @Symfony customised rules | ||
'concat_space' => ['spacing' => 'one'], | ||
'native_function_invocation' => false, | ||
'single_quote' => ['strings_containing_single_quote_chars' => true], | ||
'visibility_required' => ['elements' => ['property', 'method', 'const']], | ||
'yoda_style' => ['equal' => false, 'identical' => false, 'less_and_greater' => false], | ||
|
||
// Additional code style rules whitelisting: | ||
'align_multiline_comment' => true, | ||
'array_indentation' => true, | ||
'array_syntax' => ['syntax' => 'short'], | ||
'combine_consecutive_issets' => true, | ||
'declare_strict_types' => true, | ||
'explicit_indirect_variable' => true, | ||
'explicit_string_variable' => true, | ||
'fully_qualified_strict_types' => true, | ||
'linebreak_after_opening_tag' => true, | ||
'list_syntax' => ['syntax' => 'short'], | ||
'mb_str_functions' => true, | ||
'multiline_comment_opening_closing' => true, | ||
'multiline_whitespace_before_semicolons' => ['strategy' => 'new_line_for_chained_calls'], | ||
'no_alternative_syntax' => true, | ||
'no_superfluous_elseif' => true, | ||
'ordered_imports' => true, | ||
'ordered_interfaces' => true, | ||
] | ||
) | ||
->setRiskyAllowed(true) | ||
->setFinder($finder) | ||
->setUsingCache(false) | ||
; | ||
|
||
return $config; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
# CHANGELOG for 3.0.x | ||
|
||
This changelog references the relevant changes (bug and security fixes) done in 3.0 version. | ||
|
||
### 3.0.0 (2021-03-26) | ||
|
||
* This new version is only for PHP >=7.4. | ||
* Bump all dependencies | ||
* Tag @ParamConverter not used anymore. | ||
* Fix #8 problem with `{id/hashid}` in `@Route` and with multiple arguments in | ||
method used for the `Route`. | ||
* Feature #16 Add `LogicException` when hash value could not be decoded. | ||
* No more extra feature for `Hashids` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
namespace Symfony\Component\DependencyInjection\Loader\Configurator; | ||
|
||
use Hashids\Hashids; | ||
use Hashids\HashidsInterface; | ||
use Roukmoute\HashidsBundle\ParamConverter\HashidsParamConverter; | ||
use Roukmoute\HashidsBundle\Twig\HashidsExtension; | ||
|
||
return static function (ContainerConfigurator $container) { | ||
$container->services() | ||
->set(HashidsInterface::class, Hashids::class) | ||
->args([param('hashids.salt'), param('hashids.min_hash_length'), param('hashids.alphabet')]) | ||
|
||
->set('hashids.converter', HashidsParamConverter::class) | ||
->args([service(HashidsInterface::class), param('hashids.passthrough'), param('hashids.auto_convert'), param('hashids.alphabet')]) | ||
->tag('request.param_converter', ['priority' => 1, 'converter' => 'hashids.converter']) | ||
|
||
->set('hashids.twig.extension', HashidsExtension::class) | ||
->args([service(HashidsInterface::class)]) | ||
->tag('twig.extension') | ||
; | ||
}; |
Oops, something went wrong.