Skip to content
Snippets Groups Projects
Commit 5d7e5a50 authored by David Prévot's avatar David Prévot
Browse files

New upstream version 3.0.0

parents 90bd09c5 376c5b3f
No related branches found
No related tags found
No related merge requests found
......@@ -6,6 +6,9 @@ on:
name: "CI"
env:
COMPOSER_ROOT_VERSION: "3.0-dev"
permissions:
contents: read
......@@ -17,12 +20,12 @@ jobs:
steps:
- name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@v4
- name: Install PHP
uses: shivammathur/setup-php@v2
with:
php-version: 8.2
php-version: 8.3
coverage: none
- name: Run PHP-CS-Fixer
......@@ -35,12 +38,12 @@ jobs:
steps:
- name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@v4
- name: Install PHP
uses: shivammathur/setup-php@v2
with:
php-version: 8.2
php-version: 8.3
coverage: none
- name: Install dependencies with Composer
......@@ -58,14 +61,13 @@ jobs:
fail-fast: false
matrix:
php-version:
- "8.1"
- "8.2"
- "8.3"
- "8.4"
steps:
- name: "Checkout"
uses: "actions/checkout@v3"
uses: "actions/checkout@v4"
- name: "Install PHP with extensions"
uses: "shivammathur/setup-php@v2"
......
......@@ -26,19 +26,15 @@ $config->setFinder($finder)
'backtick_to_shell_exec' => true,
'binary_operator_spaces' => [
'operators' => [
'=' => 'align_single_space_minimal',
'*=' => 'align_single_space_minimal',
'+=' => 'align_single_space_minimal',
'-=' => 'align_single_space_minimal',
'*=' => 'align_single_space_minimal',
'/=' => 'align_single_space_minimal',
'=' => 'align_single_space_minimal',
'=>' => 'align_single_space_minimal',
],
],
'blank_line_after_namespace' => true,
'blank_lines_before_namespace' => [
'max_line_breaks' => 1,
'min_line_breaks' => 0,
],
'blank_line_before_statement' => [
'statements' => [
'break',
......@@ -66,6 +62,14 @@ $config->setFinder($finder)
'yield_from',
],
],
'blank_lines_before_namespace' => [
'max_line_breaks' => 1,
'min_line_breaks' => 0,
],
'braces_position' => [
'anonymous_classes_opening_brace' => 'next_line_unless_newline_at_signature_end',
'anonymous_functions_opening_brace' => 'next_line_unless_newline_at_signature_end',
],
'cast_spaces' => true,
'class_attributes_separation' => [
'elements' => [
......@@ -79,15 +83,11 @@ $config->setFinder($finder)
'combine_consecutive_issets' => true,
'combine_consecutive_unsets' => true,
'combine_nested_dirname' => true,
'compact_nullable_typehint' => true,
'compact_nullable_type_declaration' => true,
'concat_space' => ['spacing' => 'one'],
'constant_case' => true,
'control_structure_braces' => true,
'control_structure_continuation_position' => true,
'curly_braces_position' => [
'anonymous_functions_opening_brace' => 'next_line_unless_newline_at_signature_end',
'anonymous_classes_opening_brace' => 'next_line_unless_newline_at_signature_end',
],
'declare_equal_normalize' => ['space' => 'none'],
'declare_parentheses' => true,
'declare_strict_types' => true,
......@@ -103,7 +103,6 @@ $config->setFinder($finder)
'fully_qualified_strict_types' => true,
'function_declaration' => true,
'function_to_constant' => true,
'function_typehint_space' => true,
'get_class_to_class_keyword' => true,
'global_namespace_import' => [
'import_classes' => true,
......@@ -144,10 +143,10 @@ $config->setFinder($finder)
'@internal',
],
],
'native_function_type_declaration_casing' => true,
'new_with_braces' => [
'named_class' => false,
'native_type_declaration_casing' => true,
'new_with_parentheses' => [
'anonymous_class' => false,
'named_class' => false,
],
'no_alias_functions' => true,
'no_alias_language_construct_call' => true,
......@@ -182,8 +181,8 @@ $config->setFinder($finder)
'no_trailing_whitespace' => true,
'no_trailing_whitespace_in_comment' => true,
'no_trailing_whitespace_in_string' => true,
'no_unneeded_braces' => true,
'no_unneeded_control_parentheses' => true,
'no_unneeded_curly_braces' => true,
'no_unneeded_final_method' => true,
'no_unneeded_import_alias' => true,
'no_unreachable_default_argument_value' => true,
......@@ -342,4 +341,6 @@ $config->setFinder($finder)
'whitespace_after_comma_in_array' => true,
]);
$config->setCacheFile(__DIR__ . '/.php-cs-fixer.cache/' . sha1(@trim((string) @shell_exec('git rev-parse --abbrev-ref HEAD'))));
return $config;
......@@ -2,6 +2,13 @@
All notable changes are documented in this file using the [Keep a CHANGELOG](https://keepachangelog.com/) principles.
## [3.0.0] - 2024-02-02
### Removed
* This component now requires PHP-Parser 5
* This component is no longer supported on PHP 8.1
## [2.0.2] - 2023-12-21
### Changed
......@@ -46,6 +53,7 @@ All notable changes are documented in this file using the [Keep a CHANGELOG](htt
* Initial release
[3.0.0]: https://github.com/sebastianbergmann/lines-of-code/compare/2.0...3.0.0
[2.0.2]: https://github.com/sebastianbergmann/lines-of-code/compare/2.0.1...2.0.2
[2.0.1]: https://github.com/sebastianbergmann/lines-of-code/compare/2.0.0...2.0.1
[2.0.0]: https://github.com/sebastianbergmann/lines-of-code/compare/1.0.3...2.0.0
......
BSD 3-Clause License
Copyright (c) 2020-2023, Sebastian Bergmann
Copyright (c) 2020-2024, Sebastian Bergmann
All rights reserved.
Redistribution and use in source and binary forms, with or without
......
......@@ -17,15 +17,15 @@
},
"prefer-stable": true,
"require": {
"php": ">=8.1",
"nikic/php-parser": "^4.18 || ^5.0"
"php": ">=8.2",
"nikic/php-parser": "^5.0"
},
"require-dev": {
"phpunit/phpunit": "^10.0"
"phpunit/phpunit": "^11.0"
},
"config": {
"platform": {
"php": "8.1"
"php": "8.2"
},
"optimize-autoloader": true,
"sort-packages": true
......@@ -37,7 +37,7 @@
},
"extra": {
"branch-alias": {
"dev-main": "2.0-dev"
"dev-main": "3.0-dev"
}
}
}
......@@ -12,27 +12,27 @@ namespace SebastianBergmann\LinesOfCode;
/**
* @psalm-immutable
*/
final class LinesOfCode
final readonly class LinesOfCode
{
/**
* @psalm-var non-negative-int
*/
private readonly int $linesOfCode;
private int $linesOfCode;
/**
* @psalm-var non-negative-int
*/
private readonly int $commentLinesOfCode;
private int $commentLinesOfCode;
/**
* @psalm-var non-negative-int
*/
private readonly int $nonCommentLinesOfCode;
private int $nonCommentLinesOfCode;
/**
* @psalm-var non-negative-int
*/
private readonly int $logicalLinesOfCode;
private int $logicalLinesOfCode;
/**
* @psalm-param non-negative-int $linesOfCode
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment