Skip to content

Commit

Permalink
Initial commit 🎉
Browse files Browse the repository at this point in the history
  • Loading branch information
SanderMuller committed Jun 20, 2024
0 parents commit d3209c9
Show file tree
Hide file tree
Showing 12 changed files with 578 additions and 0 deletions.
19 changes: 19 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
root = true

[*]
charset = utf-8
end_of_line = lf

indent_style = space
indent_size = 4

trim_trailing_whitespace = true
insert_final_newline = true
max_line_length = 120
tab_width = 4

[*.{yml,yaml}]
indent_size = 2

[*.md]
trim_trailing_whitespace = false
8 changes: 8 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
* text=auto eol=lf

*.css diff=css
*.html diff=html
*.md diff=markdown
*.php diff=php

/.github export-ignore
13 changes: 13 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# To get started with Dependabot version updates, you'll need to specify which
# package ecosystems to update and where the package manifests are located.
# Please see the documentation for all configuration options:
# https://help.github.com/github/administering-a-repository/configuration-options-for-dependency-updates

version: 2
updates:

# Maintain dependencies for Composer
- package-ecosystem: "composer"
directory: "/"
schedule:
interval: "weekly"
30 changes: 30 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
vendor
auth.json
composer.lock

# IDE
.phpstorm.meta.php
_ide_helper_models.php
_ide_helper.php
_ide_macros.php
nbproject/
nbproject/private/
.idea/*
!/.idea/codeStyles

# JS
node_modules
npm-debug.log
yarn-error.log

# MacOS
.DS_STORE

# Environment
.env
.env.*
!.env.example
!.env.ci
.cache
logs
.phpactor.json
53 changes: 53 additions & 0 deletions composer.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
{
"name": "sandermuller/stopwatch",
"description": "Stopwatch to measure execution times for Laravel and PHP projects",
"keywords": ["PHP", "Laravel", "Stopwatch"],
"homepage": "https://github.com/SanderMuller/Stopwatch",
"license": "MIT",
"type": "library",
"authors": [
{
"name": "Sander Muller",
"email": "info@scode.com",
"role": "Developer"
}
],
"prefer-stable": true,
"minimum-stability": "stable",
"require": {
"php": "^8.3",
"illuminate/collections": "^10.0|^11.0",
"illuminate/support": "^10.0|^11.0",
"nesbot/carbon": "^3.5"
},
"require-dev": {
"laravel/pint": "^1.15",
"nunomaduro/collision": "^8.1",
"phpstan/extension-installer": "^1.4",
"phpstan/phpstan": "^1.10",
"phpstan/phpstan-deprecation-rules": "^1.2",
"phpstan/phpstan-strict-rules": "^1.6",
"rector/rector": "^1.0",
"roave/security-advisories": "dev-latest",
"tomasvotruba/type-coverage": "^0.3.1"
},
"autoload": {
"psr-4": {
"SanderMuller\\Stopwatch\\": "src"
}
},
"scripts": {
"phpstan": "vendor/bin/phpstan analyse",
"format": "vendor/bin/pint",
"rector": "vendor/bin/rector process"
},
"config": {
"platform": {
"php": "8.3.8"
},
"sort-packages": true,
"allow-plugins": {
"phpstan/extension-installer": true
}
}
}
Empty file added phpstan-baseline.neon
Empty file.
28 changes: 28 additions & 0 deletions phpstan.neon
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
includes:
- phpstan-baseline.neon
- phar://phpstan.phar/conf/bleedingEdge.neon

parameters:
tmpDir: .cache/phpstan

paths:
- src

type_coverage:
return: 100
param: 100
property: 100
# also, how many files has declare strict types
declare: 100

# The level ranges from 0 to 9 and the latter is the highest level
# more info at https://phpstan.org/user-guide/rule-levels
level: 9

strictRules:
allRules: true

# Optional for having a clickable link to PHPStorm
editorUrl: 'phpstorm://open?file=%%file%%&line=%%line%%'

treatPhpDocTypesAsCertain: false
46 changes: 46 additions & 0 deletions pint.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
{
"preset": "laravel",
"rules": {
"declare_strict_types": true,
"blank_line_after_opening_tag": false,
"linebreak_after_opening_tag": false,
"type_declaration_spaces": false,
"nullable_type_declaration": false,
"nullable_type_declaration_for_default_null_value": false,
"concat_space": {
"spacing": "one"
},
"single_class_element_per_statement": {
"elements": {}
},
"class_attributes_separation": {
"elements": {
"const": "one",
"method": "one"
}
},
"curly_braces_position": {
"control_structures_opening_brace": "same_line",
"functions_opening_brace": "next_line_unless_newline_at_signature_end",
"anonymous_functions_opening_brace": "same_line",
"classes_opening_brace": "next_line_unless_newline_at_signature_end",
"anonymous_classes_opening_brace": "same_line",
"allow_single_line_empty_anonymous_classes": false,
"allow_single_line_anonymous_functions": false
},
"function_typehint_space": false,
"unary_operator_spaces": false,
"constant_case": false,
"single_space_around_construct": false,
"statement_indentation": false,
"line_ending": false,
"braces": false,
"whitespace_after_comma_in_array": false,
"phpdoc_separation": false,
"phpdoc_align": false,
"backtick_to_shell_exec": true
},
"exclude": [

]
}
44 changes: 44 additions & 0 deletions rector.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
<?php declare(strict_types=1);

use Rector\Caching\ValueObject\Storage\FileCacheStorage;
use Rector\CodeQuality\Rector\If_\ExplicitBoolCompareRector;
use Rector\CodingStyle\Rector\Encapsed\EncapsedStringsToSprintfRector;
use Rector\CodingStyle\Rector\If_\NullableCompareToNullRector;
use Rector\Config\RectorConfig;
use Rector\DeadCode\Rector\PropertyProperty\RemoveNullPropertyInitializationRector;
use Rector\Naming\Rector\ClassMethod\RenameParamToMatchTypeRector;
use Rector\Naming\Rector\ClassMethod\RenameVariableToMatchNewTypeRector;
use Rector\Php74\Rector\Closure\ClosureToArrowFunctionRector;
use Rector\Php74\Rector\Ternary\ParenthesizeNestedTernaryRector;

/**
* @see https://github.com/rectorphp/rector/blob/main/docs/rector_rules_overview.md
*/
return RectorConfig::configure()
->withCache('./.cache/rector', FileCacheStorage::class)
->withRules([
ParenthesizeNestedTernaryRector::class,
])
->withSkip([
ClosureToArrowFunctionRector::class,
EncapsedStringsToSprintfRector::class,
ExplicitBoolCompareRector::class,
NullableCompareToNullRector::class,
RemoveNullPropertyInitializationRector::class,
RenameParamToMatchTypeRector::class,
RenameVariableToMatchNewTypeRector::class,
])
->withPaths([
__DIR__ . '/src',
])
->withParallel(300, 14, 14)
// here we can define, what prepared sets of rules will be applied
->withPreparedSets(
codingStyle: true,
privatization: true,
earlyReturn: true,
)
->withDeadCodeLevel(40) // max 40
->withMemoryLimit('3G')
->withPhpSets(php83: true)
->withTypeCoverageLevel(37); // max 37
Loading

0 comments on commit d3209c9

Please sign in to comment.