Skip to content

Commit

Permalink
Update .editorconfig
Browse files Browse the repository at this point in the history
  • Loading branch information
AntonyThorpe committed May 29, 2024
1 parent 9871ba7 commit fc50a8b
Show file tree
Hide file tree
Showing 4 changed files with 32 additions and 31 deletions.
21 changes: 15 additions & 6 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# For more information about the properties used in this file,
# please see the EditorConfig documentation:
# http://editorconfig.org
# For more information about the properties used in
# this file, please see the EditorConfig documentation:
# http://editorconfig.org/

[*]
charset = utf-8
Expand All @@ -10,8 +10,17 @@ indent_style = space
insert_final_newline = true
trim_trailing_whitespace = true

[{*.yml,package.json}]
[*.md]
trim_trailing_whitespace = false

[*.{yml,js,json,css,scss,feature}]
indent_size = 2
indent_style = space

[composer.json]
indent_size = 4

# The indent size used in the package.json file cannot be changed:
# https://github.com/npm/npm/pull/3180#issuecomment-16336516
# Don't perform any clean-up on thirdparty files
[thirdparty/**]
trim_trailing_whitespace = false
insert_final_newline = false
39 changes: 16 additions & 23 deletions phpcs.xml.dist
Original file line number Diff line number Diff line change
@@ -1,27 +1,20 @@
<?xml version="1.0"?>
<ruleset name="SS3">
<description>Coding standard for SilverStripe 4.x</description>
<?xml version="1.0" encoding="UTF-8"?>
<ruleset name="SilverStripe">
<description>CodeSniffer ruleset for SilverStripe coding conventions.</description>

<file>src</file>
<file>tests</file>
<file>src</file>
<file>tests</file>

<!-- Don't sniff third party libraries -->
<exclude-pattern>*/vendor/*</exclude-pattern>
<exclude-pattern>*/thirdparty/*</exclude-pattern>
<!-- base rules are PSR-2 -->
<rule ref="PSR2" >
<!-- Current exclusions -->
<exclude name="PSR1.Methods.CamelCapsMethodName" />
<exclude name="PSR2.Classes.PropertyDeclaration.Underscore" />
<exclude name="Squiz.Classes.ValidClassName.NotCamelCaps" />
<exclude name="Generic.Files.LineLength.TooLong" />
<exclude name="PSR1.Files.SideEffects.FoundWithSymbols" />
</rule>

<!-- Show progress and output sniff names on violation, and add colours -->
<arg value="sp"/>
<arg name="colors"/>

<!-- Use PSR-2 as a base standard -->
<rule ref="PSR2">
<!-- Allow classes to not declare a namespace -->
<exclude name="PSR1.Classes.ClassDeclaration.MissingNamespace"/>

<!-- Allow underscores in class names -->
<exclude name="Squiz.Classes.ValidClassName.NotCamelCaps"/>

<!-- Allow non camel cased method names -->
<exclude name="PSR1.Methods.CamelCapsMethodName.NotCamelCaps"/>
</rule>
<!-- use short array syntax -->
<rule ref="Generic.Arrays.DisallowLongArraySyntax" />
</ruleset>
2 changes: 1 addition & 1 deletion src/Order.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ public function onPlaceOrder(): void
$gateway = Checkout::get($this->getOwner())->getSelectedPaymentMethod();
if (OrderProcessor::config()->bank_deposit_send_confirmation &&
GatewayInfo::isManual($gateway) &&
$this->owner->Status == "Unpaid"
$this->getOwner()->Status == "Unpaid"
) {
OrderProcessor::config()->send_confirmation = true;
} else {
Expand Down
1 change: 0 additions & 1 deletion src/ShopConfigExtension.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ class ShopConfigExtension extends DataExtension
{
/**
* @config
* @var array
*/
private static array $db = [
'BankAccountPaymentMethodMessage' => 'Text',
Expand Down

0 comments on commit fc50a8b

Please sign in to comment.