-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: Risky test case passing null value to DateTime (#1)
fix: PHP-CS settings feat: Helper for camel cases feat: DataObject make function feat: DataObject __call to set property values using a camelCase or snake_case method chore: update readme feat: add phpcs.xml for phpcs vs code extension
- Loading branch information
1 parent
6a67108
commit 778df23
Showing
8 changed files
with
219 additions
and
75 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
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,83 @@ | ||
<?xml version="1.0"?> | ||
<ruleset name="Standard"> | ||
<description>PHPCS Standards</description> | ||
|
||
<rule ref="PSR1" /> | ||
|
||
<rule ref="PSR2" /> | ||
|
||
<rule ref="PSR2.Namespaces.NamespaceDeclaration" /> | ||
|
||
<rule ref="Generic.Files.LineEndings"> | ||
<properties> | ||
<property name="eolChar" value="\n" /> | ||
</properties> | ||
</rule> | ||
|
||
<rule ref="Zend.Files.ClosingTag" /> | ||
|
||
<rule ref="Generic.Files.LineLength"> | ||
<properties> | ||
<property name="lineLimit" value="120" /> | ||
<property name="absoluteLineLimit" value="0" /> | ||
</properties> | ||
</rule> | ||
|
||
<rule ref="Squiz.WhiteSpace.SuperfluousWhitespace"> | ||
<properties> | ||
<property name="ignoreBlankLines" value="true" /> | ||
</properties> | ||
</rule> | ||
<rule ref="Squiz.WhiteSpace.SuperfluousWhitespace.StartFile"> | ||
<serverity>0</serverity> | ||
</rule> | ||
<rule ref="Squiz.WhiteSpace.SuperfluousWhitespace.EndFile"> | ||
<serverity>0</serverity> | ||
</rule> | ||
<rule ref="Squiz.WhiteSpace.SuperfluousWhitespace.EmptyLines"> | ||
<serverity>0</serverity> | ||
</rule> | ||
|
||
<rule ref="Generic.Formatting.DisallowMultipleStatements" /> | ||
|
||
<rule ref="Generic.WhiteSpace.ScopeIndent"> | ||
<properties> | ||
<property name="tabIndent" value="false" /> | ||
</properties> | ||
</rule> | ||
|
||
<rule ref="Generic.PHP.LowerCaseKeyword" /> | ||
<rule ref="Generic.PHP.LowerCaseConstant" /> | ||
|
||
<rule ref="Squiz.Scope.MethodScope" /> | ||
<rule ref="Squiz.WhiteSpace.ScopeKeywordSpacing" /> | ||
<rule ref="Squiz.Functions.LowercaseFunctionKeywords" /> | ||
|
||
<rule ref="Squiz.Functions.FunctionDeclarationArgumentSpacing"> | ||
<properties> | ||
<property name="equalSpacing" value="1" /> | ||
</properties> | ||
</rule> | ||
<rule ref="Squiz.Functions.FunctionDeclarationArgumentSpacing.SpacingAfterHint"> | ||
<serverity>0</serverity> | ||
</rule> | ||
|
||
<rule ref="PEAR.Functions.ValidDefaultValue" /> | ||
|
||
<rule ref="Squiz.Functions.MultiLineFunctionDeclaration" /> | ||
|
||
<rule ref="Generic.Functions.FunctionCallArgumentSpacing" /> | ||
<rule ref="PSR2.Methods.FunctionCallSignature.SpaceAfterCloseBracket"> | ||
<serverity>0</serverity> | ||
</rule> | ||
|
||
<rule ref="Squiz.WhiteSpace.ScopeClosingBrace" /> | ||
<rule ref="Squiz.ControlStructures.ForEachLoopDeclaration" /> | ||
<rule ref="Squiz.ControlStructures.ForLoopDeclaration" /> | ||
<rule ref="Squiz.ControlStructures.LowercaseDeclaration" /> | ||
|
||
<rule ref="Generic.ControlStructures.InlineControlStructure" /> | ||
|
||
<exclude-pattern>./vendor/*</exclude-pattern> | ||
|
||
</ruleset> |
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,15 @@ | ||
<?php | ||
|
||
namespace AntoninMasek\SimpleHydrator; | ||
|
||
final class Helper | ||
{ | ||
public static function camel($value): ?string | ||
{ | ||
$words = explode(' ', str_replace(['-', '_'], ' ', $value)); | ||
|
||
$words = implode(array_map(fn ($word) => ucfirst($word), $words)); | ||
|
||
return lcfirst($words); | ||
} | ||
} |
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
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