-
Notifications
You must be signed in to change notification settings - Fork 3
Replace PHP-CS-Fixer for Pint #20
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
stefanius
wants to merge
5
commits into
main
Choose a base branch
from
replac-php-cs-fixer
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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 was deleted.
Oops, something went wrong.
This file contains hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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,89 +1,18 @@ | ||
| <?xml version="1.0"?> | ||
| <ruleset name="PHP_CodeSniffer"> | ||
| <description>The coding standard for PHP_CodeSniffer itself.</description> | ||
|
|
||
| <!--<file>app</file>--> | ||
|
|
||
| <exclude-pattern>*/Standards/*/Tests/*.(inc|css|js)</exclude-pattern> | ||
| <ruleset name="eloquent-revisable"> | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. PHPCS is not in the title? |
||
| <file>src/</file> | ||
|
|
||
| <arg name="basepath" value="."/> | ||
| <arg name="colors" /> | ||
| <arg name="parallel" value="75" /> | ||
| <arg value="np"/> | ||
|
|
||
| <!-- Don't hide tokenizer exceptions --> | ||
| <rule ref="Internal.Tokenizer.Exception"> | ||
| <type>error</type> | ||
| <arg name="colors"/> | ||
| <arg name="parallel" value="75"/> | ||
|
|
||
| <rule ref="PSR12"> | ||
| <!-- Allow new ClassName without parentheses --> | ||
| <exclude name="PSR12.Classes.ClassInstantiation.MissingParentheses"/> | ||
| <!-- Allow empty constructor body on one line: public function __construct(...) {} --> | ||
| <exclude name="Squiz.Functions.MultiLineFunctionDeclaration.BraceOnSameLine"/> | ||
| <exclude name="Squiz.WhiteSpace.ScopeClosingBrace.ContentBefore"/> | ||
| <!-- Allow multiple arguments per line in a multi-line function call --> | ||
| <exclude name="PSR2.Methods.FunctionCallSignature.MultipleArguments"/> | ||
| </rule> | ||
|
|
||
| <!-- Include the whole PSR1 standard --> | ||
| <rule ref="PSR1"/> | ||
|
|
||
| <!-- Include the whole PSR2 standard --> | ||
| <rule ref="PSR2"/> | ||
|
|
||
| <!-- Include the PEAR standard, with a few exceptions --> | ||
| <rule ref="PEAR"> | ||
| <exclude name="PEAR.Commenting.ClassComment" /> | ||
| <exclude name="PEAR.Commenting.FileComment" /> | ||
| <exclude name="PEAR.Commenting.FunctionComment.MissingReturn" /> | ||
| <exclude name="PEAR.Commenting.FunctionComment.MissingParamTag" /> | ||
| <exclude name="PEAR.Commenting.FunctionComment.MissingParamComment" /> | ||
| <exclude name="PEAR.Commenting.FunctionComment.SpacingAfterParamType" /> | ||
| <exclude name="PEAR.Commenting.FunctionComment.SpacingAfterParamName" /> | ||
| <exclude name="PEAR.Files.IncludingFile" /> | ||
| <exclude name="PEAR.Functions.FunctionCallSignature" /> | ||
| <exclude name="PEAR.NamingConventions.ValidFunctionName" /> | ||
| <exclude name="PEAR.NamingConventions.ValidVariableName" /> | ||
| <exclude name="PEAR.WhiteSpace.ObjectOperatorIndent" /> | ||
| </rule> | ||
|
|
||
| <!-- Include some sniffs from other standards that don't conflict with PEAR --> | ||
| <rule ref="Squiz.Commenting.DocCommentAlignment" /> | ||
| <rule ref="Squiz.Commenting.EmptyCatchComment" /> | ||
| <rule ref="Squiz.Commenting.PostStatementComment" /> | ||
| <rule ref="Squiz.Commenting.VariableComment" /> | ||
| <rule ref="Squiz.Functions.FunctionDeclarationArgumentSpacing" /> | ||
|
|
||
| <rule ref="Generic.Arrays.DisallowLongArraySyntax"/> | ||
| <rule ref="Generic.Commenting.Todo"/> | ||
| <rule ref="Generic.ControlStructures.InlineControlStructure"/> | ||
| <rule ref="Generic.Formatting.DisallowMultipleStatements"/> | ||
| <rule ref="Generic.Formatting.SpaceAfterCast"/> | ||
| <rule ref="Generic.NamingConventions.ConstructorName"/> | ||
| <rule ref="Generic.PHP.DeprecatedFunctions"/> | ||
| <rule ref="Generic.PHP.LowerCaseKeyword"/> | ||
| <rule ref="Generic.Strings.UnnecessaryStringConcat"/> | ||
|
|
||
| <rule ref="Zend.Files.ClosingTag"/> | ||
|
|
||
| <!-- Check var names, but we don't want leading underscores for private vars --> | ||
| <rule ref="Squiz.Commenting.BlockComment"> | ||
| <exclude name="Squiz.Commenting.BlockComment.LineIndent" /> | ||
| <exclude name="Squiz.Commenting.BlockComment.FirstLineIndent" /> | ||
| </rule> | ||
|
|
||
| <rule ref="Squiz.Formatting.OperatorBracket"> | ||
| <exclude name="Squiz.Formatting.OperatorBracket.MissingBrackets" /> | ||
| </rule> | ||
|
|
||
| <!-- Check var names, but we don't want leading underscores for private vars --> | ||
| <rule ref="Squiz.NamingConventions.ValidVariableName"> | ||
| <exclude name="Squiz.NamingConventions.ValidVariableName.NotCamelCaps"/> | ||
| </rule> | ||
|
|
||
| <!-- Only one argument per line in multi-line function calls --> | ||
| <rule ref="PEAR.Functions.FunctionCallSignature"> | ||
| <properties> | ||
| <property name="allowMultipleArguments" value="false"/> | ||
| </properties> | ||
| </rule> | ||
|
|
||
| <!-- Only one argument per line in multi-line function calls --> | ||
| <rule ref="Generic.Commenting.DocComment"> | ||
| <exclude name="Generic.Commenting.DocComment.TagValueIndent" /> | ||
| <exclude name="Generic.Commenting.DocComment.MissingShort"/> | ||
| <exclude name="Generic.Commenting.DocComment.NonParamGroup" /> | ||
| </rule> | ||
|
|
||
| </ruleset> | ||
| </ruleset> | ||
This file contains hidden or 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,11 @@ | ||
| { | ||
| "preset": "laravel", | ||
| "rules": { | ||
| "concat_space": { | ||
| "spacing": "one" | ||
| }, | ||
| "phpdoc_align": { | ||
| "align": "left" | ||
| } | ||
| } | ||
| } |
This file contains hidden or 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 |
|---|---|---|
|
|
@@ -2,34 +2,23 @@ | |
|
|
||
| namespace TestMonitor\Searchable\Aspects; | ||
|
|
||
| use TestMonitor\Searchable\Weights; | ||
| use Illuminate\Database\Eloquent\Builder; | ||
| use TestMonitor\Searchable\Contracts\Search; | ||
| use TestMonitor\Searchable\Weights; | ||
|
|
||
| class SearchAspect | ||
| { | ||
| /** | ||
| * @param string $name | ||
| * @param \TestMonitor\Searchable\Contracts\Search $searchClass | ||
| * @param int $weight | ||
| */ | ||
| public function __construct(protected string $name, protected Search $searchClass, protected int $weight = 1) | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We usually add a newline for each argument? |
||
| { | ||
| // | ||
| } | ||
|
|
||
| /** | ||
| * @param \Illuminate\Database\Eloquent\Builder $query | ||
| * @param \TestMonitor\Searchable\Weights $weights | ||
| * @param string $term | ||
| */ | ||
| public function search(Builder $query, Weights $weights, string $term): void | ||
| { | ||
| ($this->searchClass)($query, $weights, $this->name, $term, $this->weight); | ||
| } | ||
|
|
||
| /** | ||
| * @param string $name | ||
| * @param int $weight | ||
| * @return \App\Models\Search\SearchAspect | ||
| */ | ||
|
Comment on lines
21
to
23
|
||
| public static function exact(string $name, int $weight = 1): self | ||
|
|
@@ -38,8 +27,6 @@ public static function exact(string $name, int $weight = 1): self | |
| } | ||
|
|
||
| /** | ||
| * @param string $name | ||
| * @param int $weight | ||
| * @return \App\Models\Search\SearchAspect | ||
| */ | ||
| public static function partial(string $name, int $weight = 1): self | ||
|
|
@@ -48,10 +35,6 @@ public static function partial(string $name, int $weight = 1): self | |
| } | ||
|
|
||
| /** | ||
| * @param string $name | ||
| * @param string $prefix | ||
| * @param bool $exact | ||
| * @param int $weight | ||
| * @return \App\Models\Search\SearchAspect | ||
| */ | ||
| public static function prefix(string $name, string $prefix, bool $exact = false, int $weight = 1): self | ||
|
|
@@ -60,8 +43,6 @@ public static function prefix(string $name, string $prefix, bool $exact = false, | |
| } | ||
|
|
||
| /** | ||
| * @param string $name | ||
| * @param int $weight | ||
| * @return \App\Models\Search\SearchAspect | ||
| */ | ||
| public static function json(string $name, int $weight = 1): self | ||
|
|
@@ -70,26 +51,18 @@ public static function json(string $name, int $weight = 1): self | |
| } | ||
|
|
||
| /** | ||
| * @param string $name | ||
| * @param \TestMonitor\Searchable\Contracts\Search $searchClass | ||
| * @return \App\Models\Search\SearchAspect | ||
| */ | ||
| public static function custom(string $name, Search $searchClass): self | ||
| { | ||
| return new self($name, $searchClass); | ||
| } | ||
|
|
||
| /** | ||
| * @return string | ||
| */ | ||
| public function getName(): string | ||
| { | ||
| return $this->name; | ||
| } | ||
|
|
||
| /** | ||
| * @return int | ||
| */ | ||
| public function getWeight(): int | ||
| { | ||
| return $this->weight; | ||
|
|
||
This file contains hidden or 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
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@stefanius ⬆️ ?