Skip to content

Commit

Permalink
updated support versions
Browse files Browse the repository at this point in the history
  • Loading branch information
rcerljenko committed Jun 18, 2024
1 parent bd04003 commit f0725a8
Show file tree
Hide file tree
Showing 5 changed files with 82 additions and 37 deletions.
3 changes: 1 addition & 2 deletions .markdownlint.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
{
"default": true,
"line_length": false,
"MD041": false
"line_length": false
}
69 changes: 58 additions & 11 deletions .php-cs-fixer.dist.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,20 +24,18 @@
'array_syntax' => true,
'binary_operator_spaces' => true,
'blank_line_after_namespace' => true,
'braces' => ['allow_single_line_closure' => true, 'allow_single_line_anonymous_class_with_empty_body' => true],
'cast_spaces' => ['space' => 'single'],
'class_attributes_separation' => ['elements' => ['method' => 'one']],
'class_definition' => ['single_item_single_line' => true, 'single_line' => true, 'space_before_parenthesis' => false],
'concat_space' => ['spacing' => 'one'],
'combine_consecutive_issets' => true,
'combine_consecutive_unsets' => true,
'compact_nullable_typehint' => true,
'compact_nullable_type_declaration' => true,
'constant_case' => true,
'nullable_type_declaration_for_default_null_value' => true,
'encoding' => true,
'self_static_accessor' => true,
'function_declaration' => true,
'function_typehint_space' => true,
'explicit_indirect_variable' => true,
'fully_qualified_strict_types' => true,
'global_namespace_import' => ['import_classes' => true, 'import_constants' => true, 'import_functions' => true],
Expand All @@ -52,8 +50,7 @@
'magic_method_casing' => true,
'method_argument_space' => true,
'native_function_casing' => true,
'native_function_type_declaration_casing' => true,
'new_with_braces' => ['named_class' => false, 'anonymous_class' => false],
'new_with_parentheses' => ['named_class' => false, 'anonymous_class' => false],
'no_blank_lines_after_class_opening' => true,
'no_closing_tag' => true,
'no_empty_comment' => true,
Expand All @@ -67,23 +64,24 @@
'no_singleline_whitespace_before_semicolons' => true,
'no_spaces_after_function_name' => true,
'no_spaces_around_offset' => true,
'no_spaces_inside_parenthesis' => true,
'object_operator_without_whitespace' => true,
'control_structure_braces' => true,
'control_structure_continuation_position' => true,
'no_alternative_syntax' => true,
'no_trailing_comma_in_singleline' => true,
'no_trailing_whitespace' => true,
'no_trailing_whitespace_in_comment' => true,
'no_unneeded_control_parentheses' => true,
'no_unneeded_curly_braces' => true,
'no_unneeded_braces' => true,
'no_unused_imports' => true,
'no_whitespace_before_comma_in_array' => true,
'no_whitespace_in_blank_line' => true,
'normalize_index_brace' => true,
'return_type_declaration' => true,
'short_scalar_cast' => true,
'single_blank_line_at_eof' => true,
'single_blank_line_before_namespace' => true,
'single_class_element_per_statement' => true,
'single_import_per_statement' => true,
'single_trait_insert_per_statement' => false,
'single_line_after_imports' => true,
'single_line_comment_style' => true,
'single_quote' => true,
Expand All @@ -103,15 +101,14 @@
'no_unset_cast' => true,
'no_useless_else' => true,
'no_useless_return' => true,
'ordered_class_elements' => true,
'ordered_imports' => ['sort_algorithm' => 'length'],
'protected_to_private' => true,
'return_assignment' => true,
'simplified_null_return' => true,
'ternary_to_null_coalescing' => true,
'simplified_if_return' => true,
'operator_linebreak' => ['position' => 'beginning'],
'single_space_after_construct' => true,
'single_space_around_construct' => true,
'echo_tag_syntax' => ['format' => 'short'],
'lambda_not_used_import' => true,
'switch_continue_to_break' => true,
Expand All @@ -135,6 +132,21 @@
'statement_indentation' => true,
'no_useless_concat_operator' => true,
'ordered_interfaces' => true,
'nullable_type_declaration' => true,
'type_declaration_spaces' => true,
'spaces_inside_parentheses' => true,
'return_to_yield_from' => true,
'attribute_empty_parentheses' => true,
'braces_position' => true,
'native_type_declaration_casing' => true,
'heredoc_closing_marker' => true,
'numeric_literal_separator' => ['override_existing' => true, 'strategy' => 'no_separator'],
'ordered_attributes' => true,

'doctrine_annotation_braces' => true,
'doctrine_annotation_indentation' => true,
'doctrine_annotation_spaces' => true,
'doctrine_annotation_array_assignment' => true,

'no_blank_lines_after_phpdoc' => true,
'no_empty_phpdoc' => true,
Expand Down Expand Up @@ -163,6 +175,9 @@
'phpdoc_var_annotation_correct_order' => true,
'phpdoc_var_without_name' => true,

'php_unit_method_casing' => true,
'php_unit_attributes' => true,

'blank_line_before_statement' => [
'statements' => [
'break',
Expand Down Expand Up @@ -190,4 +205,36 @@
'yield_from',
],
],

'ordered_class_elements' => [
'order' => [
'use_trait',
'case',
'constant_public',
'constant_protected',
'constant_private',
'property_public_static',
'property_protected_static',
'property_private_static',
'property_public',
'property_protected',
'property_private',
'construct',
'destruct',
'magic',
'phpunit',
'method_public_abstract_static',
'method_protected_abstract_static',
'method_private_abstract_static',
'method_public_abstract',
'method_protected_abstract',
'method_private_abstract',
'method_public_static',
'method_protected_static',
'method_private_static',
'method_public',
'method_protected',
'method_private',
],
],
]);
3 changes: 1 addition & 2 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@
"html.validate.styles": true,
"php.suggest.basic": true,
"php.validate.enable": true,
"intelephense.format.enable": false,
"php-cs-fixer.executablePath": "${workspaceFolder}/vendor/bin/php-cs-fixer",
"php-cs-fixer.executablePathWindows": "${workspaceFolder}\\vendor\\bin\\php-cs-fixer.bat",
"php-cs-fixer.onsave": true,
Expand All @@ -24,4 +23,4 @@
"php-cs-fixer.autoFixBySemicolon": false,
"php-cs-fixer.formatHtml": false,
"php-cs-fixer.documentFormattingProvider": true
}
}
36 changes: 18 additions & 18 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,15 +24,15 @@ php artisan vendor:publish --provider="RCerljenko\LaravelPaseto\LaravelPasetoSer
// config/auth.php

'guards' => [
'web' => [
'driver' => 'session',
'provider' => 'users',
],

'api' => [
'driver' => 'paseto',
'provider' => 'users',
],
'web' => [
'driver' => 'session',
'provider' => 'users',
],

'api' => [
'driver' => 'paseto',
'provider' => 'users',
],
],
```

Expand All @@ -44,7 +44,7 @@ php artisan vendor:publish --provider="RCerljenko\LaravelPaseto\LaravelPasetoSer
use Illuminate\Support\Facades\Route;

Route::middleware('auth:api')->group(function () {
// PASETO protected routes
// PASETO protected routes
});
```

Expand All @@ -59,7 +59,7 @@ use Illuminate\Foundation\Auth\User as Authenticatable;

class User extends Authenticatable
{
use Notifiable, HasPaseto;
use Notifiable, HasPaseto;
}
```

Expand Down Expand Up @@ -93,13 +93,13 @@ You can also use configuration directly on the `token()` method which then overr

```php
$user->token([
'id' => $user->email,
'valid_from' => now()->addHour(),
'valid_until' => now()->addDay(),
'claims' => [
'extra1' => 'foo',
'extra2' => 'bar'
]
'id' => $user->email,
'valid_from' => now()->addHour(),
'valid_until' => now()->addDay(),
'claims' => [
'extra1' => 'foo',
'extra2' => 'bar'
]
]);
```

Expand Down
8 changes: 4 additions & 4 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,13 @@
},
"require": {
"php": "^8.1",
"illuminate/auth": "^9.0|^10.0",
"illuminate/contracts": "^9.0|^10.0",
"illuminate/support": "^9.0|^10.0",
"illuminate/auth": "^9.0|^10.0|^11.0",
"illuminate/contracts": "^9.0|^10.0|^11.0",
"illuminate/support": "^9.0|^10.0|^11.0",
"paragonie/paseto": "^3.0"
},
"require-dev": {
"friendsofphp/php-cs-fixer": "^3.6"
"friendsofphp/php-cs-fixer": "^3.57"
},
"autoload": {
"psr-4": {
Expand Down

0 comments on commit f0725a8

Please sign in to comment.