Skip to content

Commit 8e4556a

Browse files
committed
Fix styling
1 parent 5df8fd5 commit 8e4556a

37 files changed

+104
-77
lines changed

.github/workflows/test.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ jobs:
5454
run: phpstan analyse --level=4 --error-format=checkstyle src/ | cs2pr
5555

5656
- name: PHPCS
57-
run: phpcs --standard=PSR12 --ignore=\*/Tests/\*,\*Minifier.php --exclude=PSR1.Methods.CamelCapsMethodName,Generic.Files.LineLength src/ | cs2pr
57+
run: phpcs --standard=tests/phpcs.xml --ignore=\*Minifier.php src/ | cs2pr
5858

5959
- name: Upload coverage result
6060
uses: actions/upload-artifact@v1

composer.lock

Lines changed: 20 additions & 31 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/PHPDraft/Core/Autoloader.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
<?php
2+
23
declare(strict_types=1);
34

45
/**

src/PHPDraft/In/ApibFileParser.php

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
1-
<?php
2-
declare(strict_types=1);
1+
<?php declare(strict_types=1);
32

43
/**
54
* This file contains the ApibFileParser.

src/PHPDraft/In/Tests/ApibFileParserTest.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -93,10 +93,10 @@ public function testParseBasic(): void
9393
$full_property->setAccessible(true);
9494

9595
$text = "FORMAT: 1A\nHOST: https://owner-api.teslamotors.com\n";
96-
$text .="EXTRA_HOSTS: https://test.owner-api.teslamotors.com\nSOMETHING: INFO\n\n";
96+
$text .= "EXTRA_HOSTS: https://test.owner-api.teslamotors.com\nSOMETHING: INFO\n\n";
9797
$text .= "# Tesla Model S JSON API\nThis is unofficial documentation of the";
98-
$text .=" Tesla Model S JSON API used by the iOS and Android apps. It features";
99-
$text .=" functionality to monitor and control the Model S remotely.\n\nTEST";
98+
$text .= " Tesla Model S JSON API used by the iOS and Android apps. It features";
99+
$text .= " functionality to monitor and control the Model S remotely.\n\nTEST";
100100
$text .= "\n\n# Hello\nThis is a test.\nhello";
101101

102102
$this->assertSame($text, $full_property->getValue($this->class));

src/PHPDraft/Model/Category.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
<?php
2+
23
declare(strict_types=1);
34

45
/**

src/PHPDraft/Model/Comparable.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
<?php
2+
23
declare(strict_types=1);
34

45
/**

src/PHPDraft/Model/Elements/ArrayStructureElement.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
<?php
2+
23
declare(strict_types=1);
34

45
/**
@@ -42,7 +43,7 @@ public function parse(?object $object, array &$dependencies): StructureElement
4243
}
4344

4445
$key = $sub_item->element ?? 'any';
45-
$value = $sub_item->content ?? NULL;
46+
$value = $sub_item->content ?? null;
4647
$this->value[] = [$value => $key];
4748
}
4849

src/PHPDraft/Model/Elements/BasicStructureElement.php

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
<?php
2+
23
declare(strict_types=1);
34

45
/**
@@ -112,7 +113,7 @@ protected function parse_common(object $object, array &$dependencies): void
112113
$this->description = htmlentities($object->meta->description);
113114
}
114115
if ($this->description !== null) {
115-
$encoded = htmlentities($this->description, ENT_COMPAT, null, FALSE);
116+
$encoded = htmlentities($this->description, ENT_COMPAT, null, false);
116117
$this->description = MarkdownExtra::defaultTransform($encoded);
117118
}
118119

@@ -133,7 +134,7 @@ protected function parse_common(object $object, array &$dependencies): void
133134
$this->status = join(', ', $object->attributes->typeAttributes);
134135
}
135136

136-
if (!in_array($this->type, self::DEFAULTS) && $this->type !== NULL) {
137+
if (!in_array($this->type, self::DEFAULTS) && $this->type !== null) {
137138
$dependencies[] = $this->type;
138139
}
139140
}
@@ -162,18 +163,18 @@ protected function get_element_as_html($element): string
162163
*
163164
* @return string
164165
*/
165-
public function string_value($flat = FALSE)
166+
public function string_value($flat = false)
166167
{
167168
if (is_array($this->value)) {
168169
$value_key = rand(0, count($this->value));
169-
if (is_subclass_of($this->value[$value_key], StructureElement::class) && $flat === FALSE) {
170+
if (is_subclass_of($this->value[$value_key], StructureElement::class) && $flat === false) {
170171
return $this->value[$value_key]->string_value($flat);
171172
}
172173

173174
return $this->value[$value_key];
174175
}
175176

176-
if (is_subclass_of($this->value, BasicStructureElement::class) && $flat === TRUE) {
177+
if (is_subclass_of($this->value, BasicStructureElement::class) && $flat === true) {
177178
return is_array($this->value->value) ? array_keys($this->value->value)[0] : $this->value->value;
178179
}
179180
return $this->value;

src/PHPDraft/Model/Elements/EnumStructureElement.php

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
<?php
2+
23
declare(strict_types=1);
34

45
/**
@@ -27,8 +28,8 @@ public function parse(?object $object, array &$dependencies): StructureElement
2728

2829
$this->parse_common($object, $dependencies);
2930

30-
$this->key = $this->key ?? $object->content->content ?? NULL;
31-
$this->type = $this->type ?? $object->content->element ?? NULL;
31+
$this->key = $this->key ?? $object->content->content ?? null;
32+
$this->type = $this->type ?? $object->content->element ?? null;
3233

3334
if (!isset($object->content) && !isset($object->attributes)) {
3435
$this->value = $this->key;

0 commit comments

Comments
 (0)