Skip to content

Commit

Permalink
Formatting; make some tests less annoying across platforms
Browse files Browse the repository at this point in the history
  • Loading branch information
JohnathonKoster committed Dec 10, 2023
1 parent d08b70e commit 1cd2be3
Show file tree
Hide file tree
Showing 18 changed files with 71 additions and 69 deletions.
6 changes: 3 additions & 3 deletions src/Compiler/AppendState.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,9 @@ class AppendState
* @param string $value The node's compiled value.
*/
public function __construct(public AbstractNode $node,
public int $beforeLineNumber,
public int $afterLineNumber,
public string $value)
public int $beforeLineNumber,
public int $afterLineNumber,
public string $value)
{
}
}
14 changes: 7 additions & 7 deletions src/Compiler/Compiler.php
Original file line number Diff line number Diff line change
Expand Up @@ -49,13 +49,13 @@

class Compiler
{
use CompilesEchos, CompilesLayouts, CompilesClasses,
CompilesConditionals, CompilesAuthorizations, CompilesComponents,
use CompilesAuthorizations, CompilesClasses, CompilesComponents,
CompilesConditionals, CompilesCustomDirectives, CompilesEchos,
CompilesErrors, CompilesFragments, CompilesHelpers, CompilesIncludes,
CompilesInjections, CompilesJs, CompilesJson, CompilesTranslations,
CompilesStacks, CompilesRawPhp, CompilesLoops, ReflectsClosures,
ManagesCustomDirectives, ManagesCustomConditions, CompilesCustomDirectives,
InteractsWithBladeErrors, CompilesVerbatim, CompilesStyles;
CompilesInjections, CompilesJs, CompilesJson, CompilesLayouts,
CompilesLoops, CompilesRawPhp, CompilesStacks, CompilesStyles,
CompilesTranslations, CompilesVerbatim, InteractsWithBladeErrors,
ManagesCustomConditions, ManagesCustomDirectives, ReflectsClosures;

private LoopVariablesExtractor $loopExtractor;

Expand Down Expand Up @@ -727,7 +727,7 @@ public function compileString(string $template): string
}
} elseif ($node instanceof PhpTagNode) {
$this->appendToBuffer($node, $node->content);
} elseif ($node instanceof PhpBlockNode) {
} elseif ($node instanceof PhpBlockNode) {
$this->appendToBuffer($node, '<?php '.trim($node->innerContent).' ?>');
} elseif ($node instanceof VerbatimNode) {
$this->appendToBuffer($node, $node->innerContent);
Expand Down
8 changes: 4 additions & 4 deletions src/Document/Document.php
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,9 @@

class Document
{
use Macroable, QueriesGeneralNodes, ManagesDocumentStructures,
ManagesTextExtraction, InteractsWithBladeErrors,
ManagesDocumentValidation;
use InteractsWithBladeErrors, Macroable, ManagesDocumentStructures,
ManagesDocumentValidation, ManagesTextExtraction,
QueriesGeneralNodes;

private ?Utf8StringIterator $docString = null;

Expand Down Expand Up @@ -312,7 +312,7 @@ public function syncFromParser(DocumentParser $parser): Document
* @param string[] $customComponentTags A list of custom component tag names.
* @param DocumentOptions|null $documentOptions Custom document options, if any.
*/
public static function fromText(string $document, ?string $filePath = null, array $customComponentTags = [], ?DocumentOptions $documentOptions = null): Document
public static function fromText(string $document, string $filePath = null, array $customComponentTags = [], DocumentOptions $documentOptions = null): Document
{
$parser = DocumentParserFactory::makeDocumentParser();

Expand Down
4 changes: 2 additions & 2 deletions src/Document/NodeUtilities/QueriesGeneralNodes.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@

trait QueriesGeneralNodes
{
use QueriesComponents, QueriesComponents,
QueriesGenerics, QueriesComments,
use QueriesComments, QueriesComponents,
QueriesComponents, QueriesGenerics,
QueriesRelativeNodes, QueriesStructures;

private bool $hasResolvedStructures = false;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ trait ResolvesStructureDocuments
private function resolveStructureDocuments(array $nodes): void
{
foreach ($nodes as $node) {
if (! ($node instanceof DirectiveNode || $node instanceof ComponentNode)) {
if (! ($node instanceof DirectiveNode || $node instanceof ComponentNode)) {
continue;
}
if ($node->isClosedBy == null) {
Expand Down
6 changes: 3 additions & 3 deletions src/Document/Structures/StructurePairAnalyzer.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,9 @@

class StructurePairAnalyzer
{
use ScansForClosingPairs, ManagesDirectiveIndexes, ManagesConditionMetaData,
PairsConditionalStructures, ConstructsConditions, ConstructsForElse,
ConstructsSwitchStatements, ResolvesStructureDocuments, PairsComponentTags;
use ConstructsConditions, ConstructsForElse, ConstructsSwitchStatements,
ManagesConditionMetaData, ManagesDirectiveIndexes, PairsComponentTags,
PairsConditionalStructures, ResolvesStructureDocuments, ScansForClosingPairs;

private Document $document;

Expand Down
2 changes: 1 addition & 1 deletion src/Errors/ConstructContext.php
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ enum ConstructContext

public static function fromNode(AbstractNode $node): ConstructContext
{
if ($node instanceof DirectiveNode) {
if ($node instanceof DirectiveNode) {
if ($node->getIsConditionDirective()) {
return ConstructContext::Condition;
}
Expand Down
2 changes: 1 addition & 1 deletion src/Nodes/ArgumentGroupNode.php
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ public function getArgValues(): Collection
return collect((new ArgStringSplitter())->split($this->innerContent));
}

public function clone(?DirectiveNode $newOwner = null): ArgumentGroupNode
public function clone(DirectiveNode $newOwner = null): ArgumentGroupNode
{
$ownerToSet = $this->owner;

Expand Down
2 changes: 1 addition & 1 deletion src/Nodes/Components/ComponentNode.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@

class ComponentNode extends AbstractNode
{
use ManagesComponentParameters, ManagesComponentMetaData, ContainsDocumentText;
use ContainsDocumentText, ManagesComponentMetaData, ManagesComponentParameters;

public string $componentPrefix = 'x';

Expand Down
4 changes: 2 additions & 2 deletions src/Validation/PhpSyntaxValidator.php
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ protected function resetState(): void
* @param Document $document The document instance.
* @param int|null $originalLine An optional line number that will be used instead of any reported PHP line numbers.
*/
public function checkDocument(Document $document, ?int $originalLine = null): PhpSyntaxValidationResult
public function checkDocument(Document $document, int $originalLine = null): PhpSyntaxValidationResult
{
$this->resetState();
$syntaxResult = new PhpSyntaxValidationResult();
Expand Down Expand Up @@ -107,7 +107,7 @@ public function checkDocument(Document $document, ?int $originalLine = null): Ph
* @param string $content The value to check.
* @param int|null $originalLine An optional line number that will be used instead of any reported PHP line number.
*/
public function checkString(string $content, ?int $originalLine = null): PhpSyntaxValidationResult
public function checkString(string $content, int $originalLine = null): PhpSyntaxValidationResult
{
return $this->checkDocument(Document::fromText($content), $originalLine);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ class ComponentShorthandVariableParameterValidator extends AbstractNodeValidator
*/
public function validate(AbstractNode $node): ValidationResult|array|null
{
if (! $node instanceof ComponentNode || ! $node->hasParameters()) {
if (! $node instanceof ComponentNode || ! $node->hasParameters()) {
return null;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@

class InconsistentDirectiveCasingValidator extends AbstractNodeValidator
{
use CanIgnoreDirectives, AcceptsCustomDirectives;
use AcceptsCustomDirectives, CanIgnoreDirectives;

protected array $coreDirectives = [];

Expand Down
2 changes: 1 addition & 1 deletion src/Validation/Validators/NoArgumentsValidator.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@

class NoArgumentsValidator extends AbstractNodeValidator
{
use CanIgnoreDirectives, AcceptsCustomDirectives;
use AcceptsCustomDirectives, CanIgnoreDirectives;

/**
* @var string[]
Expand Down
2 changes: 1 addition & 1 deletion src/Validation/Validators/RequiredArgumentsValidator.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@

class RequiredArgumentsValidator extends AbstractNodeValidator
{
use CanIgnoreDirectives, AcceptsCustomDirectives;
use AcceptsCustomDirectives, CanIgnoreDirectives;

/**
* @var string[]
Expand Down
4 changes: 2 additions & 2 deletions src/Workspaces/Workspace.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@

class Workspace
{
use ValidatesWorkspaces, ProxiesDocumentCalls, ManagesWorkspaceErrors,
CompilesWorkspace;
use CompilesWorkspace, ManagesWorkspaceErrors, ProxiesDocumentCalls,
ValidatesWorkspaces;

/**
* Indicates if the workspace should resolve structures on document instances.
Expand Down
Loading

0 comments on commit 1cd2be3

Please sign in to comment.