-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add tools for and and apply coding standards (#121)
- Loading branch information
Showing
9 changed files
with
2,013 additions
and
308 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 |
---|---|---|
@@ -1,12 +1,27 @@ | ||
# EditorConfig helps developers define and maintain consistent | ||
# coding styles between different editors and IDEs | ||
# editorconfig.org | ||
root = true | ||
|
||
[*] | ||
charset = utf-8 | ||
indent_size = 2 | ||
# Change these settings to your own preference | ||
indent_style = space | ||
trim_trailing_whitespace = true | ||
indent_size = 2 | ||
max_line_length = 80 | ||
|
||
# We recommend you to keep these unchanged | ||
end_of_line = lf | ||
charset = utf-8 | ||
trim_trailing_whitespace = true | ||
insert_final_newline = true | ||
|
||
[*.{md,markdown}] | ||
trim_trailing_whitespace = false | ||
|
||
[*.php] | ||
indent_style = space | ||
indent_size = 4 | ||
|
||
[composer.json] | ||
indent_style = space | ||
indent_size = 4 |
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,12 @@ | ||
<?php | ||
|
||
$finder = (new PhpCsFixer\Finder()) | ||
->in(__DIR__) | ||
->exclude('var'); | ||
|
||
return (new PhpCsFixer\Config()) | ||
->setRules([ | ||
'@PhpCsFixer' => true, | ||
]) | ||
->setFinder($finder) | ||
->setCacheFile(__DIR__.'/.php-cs-fixer.cache'); |
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 |
---|---|---|
@@ -1,10 +1,11 @@ | ||
<?php | ||
|
||
// declare(strict_types=1); | ||
declare(strict_types=1); | ||
|
||
use Twig\Environment; | ||
use Twig\TwigFunction; | ||
|
||
function addCustomExtension(Environment &$twigEnvironment, $config): void { | ||
$twigEnvironment->addFunction(new TwigFunction('customTwigFunctionThatSaysWorld', static fn(): string => 'Custom World')); | ||
function addCustomExtension(Environment &$twigEnvironment, $config): void | ||
{ | ||
$twigEnvironment->addFunction(new TwigFunction('customTwigFunctionThatSaysWorld', static fn (): string => 'Custom World')); | ||
} |
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 |
---|---|---|
@@ -1,15 +1,25 @@ | ||
{ | ||
"name": "basaltinc/twig-renderer", | ||
"description": "Render templates using Twig PHP, via this Node JS renderer.", | ||
"license": "MIT", | ||
"autoload": { | ||
"psr-4": { | ||
"BasaltInc\\TwigRenderer\\": "dist/" | ||
} | ||
}, | ||
"require": { | ||
"ext-json": "*", | ||
"twig/twig": "^2.12", | ||
"react/http": "^0.8.3" | ||
} | ||
"name": "basaltinc/twig-renderer", | ||
"description": "Render templates using Twig PHP, via this Node JS renderer.", | ||
"license": "MIT", | ||
"autoload": { | ||
"psr-4": { | ||
"BasaltInc\\": "dist/" | ||
} | ||
}, | ||
"config": { | ||
"platfrom": { | ||
"php": "8.2" | ||
} | ||
}, | ||
"require": { | ||
"php": ">=8.1", | ||
"ext-json": "*", | ||
"react/http": "^0.8.3", | ||
"twig/twig": "^2.12" | ||
}, | ||
"require-dev": { | ||
"friendsofphp/php-cs-fixer": "^3.38.0" | ||
}, | ||
"sort-packages": true | ||
} |
Oops, something went wrong.