Browse Source

Style fixes

master
J. King 4 years ago
parent
commit
4e5c2bfb5e
  1. 7
      .php_cs.dist
  2. 2
      lib/Parser/Construct.php
  3. 2
      tests/cases/Util/MimeTypeTest.php

7
.php_cs.dist

@ -1,4 +1,5 @@
<?php <?php
declare(strict_types=1); declare(strict_types=1);
const BASE = __DIR__.DIRECTORY_SEPARATOR; const BASE = __DIR__.DIRECTORY_SEPARATOR;
@ -18,7 +19,6 @@ $rules = [
'operators' => ['=>' => "align_single_space"], 'operators' => ['=>' => "align_single_space"],
], ],
'cast_spaces' => ['space' => "single"], 'cast_spaces' => ['space' => "single"],
'concat_space' => ['spacing' => "none"],
'list_syntax' => ['syntax' => "short"], 'list_syntax' => ['syntax' => "short"],
'magic_constant_casing' => true, 'magic_constant_casing' => true,
'magic_method_casing' => true, 'magic_method_casing' => true,
@ -48,11 +48,13 @@ $rules = [
// PSR standard to apply // PSR standard to apply
'@PSR2' => true, '@PSR2' => true,
// PSR-12 rules; php-cs-fixer does not yet support PSR-12 natively // PSR-12 rules; php-cs-fixer does not yet support PSR-12 natively
'blank_line_after_opening_tag' => true,
'compact_nullable_typehint' => true, 'compact_nullable_typehint' => true,
'declare_equal_normalize' => ['space' => "none"], 'declare_equal_normalize' => ['space' => "none"],
'function_typehint_space' => true, 'function_typehint_space' => true,
'lowercase_cast' => true, 'lowercase_cast' => true,
'lowercase_static_reference' => true, 'lowercase_static_reference' => true,
'method_argument_space' => ['on_multiline' => 'ensure_fully_multiline'],
'no_alternative_syntax' => true, 'no_alternative_syntax' => true,
'no_empty_statement' => true, 'no_empty_statement' => true,
'no_leading_import_slash' => true, 'no_leading_import_slash' => true,
@ -65,8 +67,9 @@ $rules = [
// house exceptions to PSR rules // house exceptions to PSR rules
'braces' => ['position_after_functions_and_oop_constructs' => "same"], 'braces' => ['position_after_functions_and_oop_constructs' => "same"],
'function_declaration' => ['closure_function_spacing' => "none"], 'function_declaration' => ['closure_function_spacing' => "none"],
'concat_space' => ['spacing' => "none"],
'new_with_braces' => false, // no option to specify absence of braces 'new_with_braces' => false, // no option to specify absence of braces
]; ];
$finder = \PhpCsFixer\Finder::create(); $finder = \PhpCsFixer\Finder::create();
foreach ($paths as $path) { foreach ($paths as $path) {

2
lib/Parser/Construct.php

@ -8,8 +8,6 @@ namespace MensBeam\Lax\Parser;
use MensBeam\Lax\Collection; use MensBeam\Lax\Collection;
use MensBeam\Lax\Date; use MensBeam\Lax\Date;
use MensBeam\Lax\MimeType;
use MensBeam\Lax\Url;
trait Construct { trait Construct {
/** Trims plain text and collapses whitespace */ /** Trims plain text and collapses whitespace */

2
tests/cases/Util/MimeTypeTest.php

@ -61,7 +61,7 @@ class MimeTypeTest extends \PHPUnit\Framework\TestCase {
]; ];
} }
public function testManipulateAnIncompleteType():void { public function testManipulateAnIncompleteType(): void {
$t = MimeType::parseLoose("text; charset=utf-8"); $t = MimeType::parseLoose("text; charset=utf-8");
$this->assertSame("text", $t->type); $this->assertSame("text", $t->type);
$this->assertSame("", $t->subtype); $this->assertSame("", $t->subtype);

Loading…
Cancel
Save