Skip to content

Commit c7a5e97

Browse files
Format code
1 parent e857764 commit c7a5e97

File tree

12 files changed

+86
-84
lines changed

12 files changed

+86
-84
lines changed

src/Adapters/Laravel/Facades/Phiki.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
* @method static \Phiki\Phiki grammar(string $name, string|\Phiki\Grammar\ParsedGrammar $pathOrGrammar)
1515
* @method static \Phiki\Phiki theme(string $name, string|\Phiki\Theme\ParsedTheme $pathOrTheme)
1616
* @method static \Phiki\Phiki cache(\Psr\SimpleCache\CacheInterface $cache)
17-
*
17+
*
1818
* @see \Phiki\Phiki
1919
*/
2020
class Phiki extends Facade

src/Environment.php

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,9 @@
33
namespace Phiki;
44

55
use Phiki\Contracts\ExtensionInterface;
6-
use Phiki\Grammar\Grammar;
76
use Phiki\Grammar\GrammarRepository;
87
use Phiki\Grammar\ParsedGrammar;
98
use Phiki\Theme\ParsedTheme;
10-
use Phiki\Theme\Theme;
119
use Phiki\Theme\ThemeRepository;
1210
use Psr\SimpleCache\CacheInterface;
1311

src/Grammar/Grammar.php

Lines changed: 67 additions & 67 deletions
Original file line numberDiff line numberDiff line change
@@ -240,56 +240,56 @@ public function aliases(): array
240240
self::Apl => [],
241241
self::Applescript => [],
242242
self::Ara => [],
243-
self::Asciidoc => ["adoc"],
243+
self::Asciidoc => ['adoc'],
244244
self::Asm => [],
245245
self::Astro => [],
246246
self::Awk => [],
247247
self::Ballerina => [],
248-
self::Bat => ["batch"],
248+
self::Bat => ['batch'],
249249
self::Beancount => [],
250-
self::Berry => ["be"],
250+
self::Berry => ['be'],
251251
self::Bibtex => [],
252252
self::Blade => [],
253-
self::Bsl => ["1c"],
253+
self::Bsl => ['1c'],
254254
self::C => [],
255-
self::Cadence => ["cdc"],
255+
self::Cadence => ['cdc'],
256256
self::Cairo => [],
257257
self::Clarity => [],
258-
self::Clojure => ["clj"],
258+
self::Clojure => ['clj'],
259259
self::Cmake => [],
260260
self::Cobol => [],
261261
self::Codeowners => [],
262-
self::Codeql => ["ql"],
263-
self::Coffee => ["coffeescript"],
264-
self::CommonLisp => ["lisp"],
262+
self::Codeql => ['ql'],
263+
self::Coffee => ['coffeescript'],
264+
self::CommonLisp => ['lisp'],
265265
self::Coq => [],
266-
self::Cpp => ["c++"],
266+
self::Cpp => ['c++'],
267267
self::Crystal => [],
268-
self::Csharp => ["c#","cs"],
268+
self::Csharp => ['c#', 'cs'],
269269
self::Css => [],
270270
self::Csv => [],
271271
self::Cue => [],
272-
self::Cypher => ["cql"],
272+
self::Cypher => ['cql'],
273273
self::D => [],
274274
self::Dart => [],
275275
self::Dax => [],
276276
self::Desktop => [],
277277
self::Diff => [],
278-
self::Docker => ["dockerfile"],
278+
self::Docker => ['dockerfile'],
279279
self::Dotenv => [],
280280
self::DreamMaker => [],
281281
self::Edge => [],
282282
self::Elixir => [],
283283
self::Elm => [],
284-
self::EmacsLisp => ["elisp"],
284+
self::EmacsLisp => ['elisp'],
285285
self::Erb => [],
286-
self::Erlang => ["erl"],
286+
self::Erlang => ['erl'],
287287
self::Fennel => [],
288288
self::Fish => [],
289-
self::Fluent => ["ftl"],
290-
self::FortranFixedForm => ["f","for","f77"],
291-
self::FortranFreeForm => ["f90","f95","f03","f08","f18"],
292-
self::Fsharp => ["f#","fs"],
289+
self::Fluent => ['ftl'],
290+
self::FortranFixedForm => ['f', 'for', 'f77'],
291+
self::FortranFreeForm => ['f90', 'f95', 'f03', 'f08', 'f18'],
292+
self::Fsharp => ['f#', 'fs'],
293293
self::Gdresource => [],
294294
self::Gdscript => [],
295295
self::Gdshader => [],
@@ -298,17 +298,17 @@ public function aliases(): array
298298
self::GitCommit => [],
299299
self::GitRebase => [],
300300
self::Gleam => [],
301-
self::GlimmerJs => ["gjs"],
302-
self::GlimmerTs => ["gts"],
301+
self::GlimmerJs => ['gjs'],
302+
self::GlimmerTs => ['gts'],
303303
self::Glsl => [],
304304
self::Gnuplot => [],
305305
self::Go => [],
306-
self::Graphql => ["gql"],
306+
self::Graphql => ['gql'],
307307
self::Groovy => [],
308308
self::Hack => [],
309309
self::Haml => [],
310-
self::Handlebars => ["hbs"],
311-
self::Haskell => ["hs"],
310+
self::Handlebars => ['hbs'],
311+
self::Haskell => ['hs'],
312312
self::Haxe => [],
313313
self::Hcl => [],
314314
self::Hjson => [],
@@ -319,47 +319,47 @@ public function aliases(): array
319319
self::Hxml => [],
320320
self::Hy => [],
321321
self::Imba => [],
322-
self::Ini => ["properties"],
322+
self::Ini => ['properties'],
323323
self::Java => [],
324-
self::Javascript => ["js"],
324+
self::Javascript => ['js'],
325325
self::Jinja => [],
326326
self::Jison => [],
327327
self::Json => [],
328328
self::Json5 => [],
329329
self::Jsonc => [],
330330
self::Jsonl => [],
331331
self::Jsonnet => [],
332-
self::Jssm => ["fsl"],
332+
self::Jssm => ['fsl'],
333333
self::Jsx => [],
334-
self::Julia => ["jl"],
335-
self::Kotlin => ["kt","kts"],
336-
self::Kusto => ["kql"],
334+
self::Julia => ['jl'],
335+
self::Kotlin => ['kt', 'kts'],
336+
self::Kusto => ['kql'],
337337
self::Latex => [],
338-
self::Lean => ["lean4"],
338+
self::Lean => ['lean4'],
339339
self::Less => [],
340340
self::Liquid => [],
341341
self::Llvm => [],
342342
self::Log => [],
343343
self::Logo => [],
344344
self::Lua => [],
345345
self::Luau => [],
346-
self::Make => ["makefile"],
347-
self::Markdown => ["md"],
346+
self::Make => ['makefile'],
347+
self::Markdown => ['md'],
348348
self::Marko => [],
349349
self::Matlab => [],
350350
self::Mdc => [],
351351
self::Mdx => [],
352-
self::Mermaid => ["mmd"],
353-
self::Mipsasm => ["mips"],
352+
self::Mermaid => ['mmd'],
353+
self::Mipsasm => ['mips'],
354354
self::Mojo => [],
355355
self::Move => [],
356-
self::Narrat => ["nar"],
357-
self::Nextflow => ["nf"],
356+
self::Narrat => ['nar'],
357+
self::Nextflow => ['nf'],
358358
self::Nginx => [],
359359
self::Nim => [],
360360
self::Nix => [],
361-
self::Nushell => ["nu"],
362-
self::ObjectiveC => ["objc"],
361+
self::Nushell => ['nu'],
362+
self::ObjectiveC => ['objc'],
363363
self::ObjectiveCpp => [],
364364
self::Ocaml => [],
365365
self::Pascal => [],
@@ -369,83 +369,83 @@ public function aliases(): array
369369
self::Polar => [],
370370
self::Postcss => [],
371371
self::Powerquery => [],
372-
self::Powershell => ["ps","ps1"],
372+
self::Powershell => ['ps', 'ps1'],
373373
self::Prisma => [],
374374
self::Prolog => [],
375-
self::Proto => ["protobuf"],
376-
self::Pug => ["jade"],
375+
self::Proto => ['protobuf'],
376+
self::Pug => ['jade'],
377377
self::Puppet => [],
378378
self::Purescript => [],
379-
self::Python => ["py"],
379+
self::Python => ['py'],
380380
self::Qml => [],
381381
self::Qmldir => [],
382382
self::Qss => [],
383383
self::R => [],
384384
self::Racket => [],
385-
self::Raku => ["perl6"],
385+
self::Raku => ['perl6'],
386386
self::Razor => [],
387387
self::Reg => [],
388-
self::Regexp => ["regex"],
388+
self::Regexp => ['regex'],
389389
self::Rel => [],
390390
self::Riscv => [],
391391
self::Rst => [],
392-
self::Ruby => ["rb"],
393-
self::Rust => ["rs"],
392+
self::Ruby => ['rb'],
393+
self::Rust => ['rs'],
394394
self::Sas => [],
395395
self::Sass => [],
396396
self::Scala => [],
397397
self::Scheme => [],
398398
self::Scss => [],
399-
self::Sdbl => ["1c-query"],
400-
self::Shaderlab => ["shader"],
401-
self::Shellscript => ["bash","sh","shell","zsh"],
402-
self::Shellsession => ["console"],
399+
self::Sdbl => ['1c-query'],
400+
self::Shaderlab => ['shader'],
401+
self::Shellscript => ['bash', 'sh', 'shell', 'zsh'],
402+
self::Shellsession => ['console'],
403403
self::Smalltalk => [],
404404
self::Solidity => [],
405-
self::Soy => ["closure-templates"],
405+
self::Soy => ['closure-templates'],
406406
self::Sparql => [],
407-
self::Splunk => ["spl"],
407+
self::Splunk => ['spl'],
408408
self::Sql => [],
409409
self::SshConfig => [],
410410
self::Stata => [],
411-
self::Stylus => ["styl"],
411+
self::Stylus => ['styl'],
412412
self::Svelte => [],
413413
self::Swift => [],
414414
self::SystemVerilog => [],
415415
self::Systemd => [],
416-
self::Talonscript => ["talon"],
416+
self::Talonscript => ['talon'],
417417
self::Tasl => [],
418418
self::Tcl => [],
419419
self::Templ => [],
420-
self::Terraform => ["tf","tfvars"],
420+
self::Terraform => ['tf', 'tfvars'],
421421
self::Tex => [],
422422
self::Toml => [],
423-
self::TsTags => ["lit"],
423+
self::TsTags => ['lit'],
424424
self::Tsv => [],
425425
self::Tsx => [],
426426
self::Turtle => [],
427427
self::Twig => [],
428-
self::Typescript => ["ts"],
429-
self::Typespec => ["tsp"],
430-
self::Typst => ["typ"],
428+
self::Typescript => ['ts'],
429+
self::Typespec => ['tsp'],
430+
self::Typst => ['typ'],
431431
self::V => [],
432432
self::Vala => [],
433-
self::Vb => ["cmd"],
433+
self::Vb => ['cmd'],
434434
self::Verilog => [],
435435
self::Vhdl => [],
436-
self::Viml => ["vim","vimscript"],
436+
self::Viml => ['vim', 'vimscript'],
437437
self::Vue => [],
438438
self::VueHtml => [],
439439
self::VueVine => [],
440-
self::Vyper => ["vy"],
440+
self::Vyper => ['vy'],
441441
self::Wasm => [],
442442
self::Wgsl => [],
443-
self::Wikitext => ["mediawiki","wiki"],
443+
self::Wikitext => ['mediawiki', 'wiki'],
444444
self::Wit => [],
445-
self::Wolfram => ["wl"],
445+
self::Wolfram => ['wl'],
446446
self::Xml => [],
447447
self::Xsl => [],
448-
self::Yaml => ["yml"],
448+
self::Yaml => ['yml'],
449449
self::Zenscript => [],
450450
self::Zig => [],
451451
self::Antlers => [],
@@ -681,7 +681,7 @@ public function scopeName(): string
681681

682682
public function path(): string
683683
{
684-
return __DIR__ . "/../../resources/grammars/{$this->value}.json";
684+
return __DIR__."/../../resources/grammars/{$this->value}.json";
685685
}
686686

687687
public static function parse(array $grammar): ParsedGrammar

src/Output/Html/PendingHtmlOutput.php

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@
1313
use Phiki\Theme\ParsedTheme;
1414
use Phiki\Token\HighlightedToken;
1515
use Phiki\Token\Token;
16-
use Phiki\Transformers\Decorations\DecorationsTransformer;
1716
use Phiki\Transformers\Decorations\DecorationTransformer;
1817
use Phiki\Transformers\Decorations\LineDecoration;
1918
use Psr\SimpleCache\CacheInterface;
@@ -110,7 +109,7 @@ public function toString(): string
110109

111110
public function cacheKey(): string
112111
{
113-
return 'phiki_html_' . md5(serialize([
112+
return 'phiki_html_'.md5(serialize([
114113
$this->code,
115114
$this->grammar->scopeName,
116115
array_keys($this->themes),

src/Phiki.php

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
namespace Phiki;
44

55
use Phiki\Contracts\ExtensionInterface;
6-
use Phiki\Environment;
76
use Phiki\Grammar\Grammar;
87
use Phiki\Grammar\ParsedGrammar;
98
use Phiki\Highlighting\Highlighter;
@@ -83,7 +82,7 @@ public function grammar(string $name, string|ParsedGrammar $pathOrGrammar): stat
8382

8483
return $this;
8584
}
86-
85+
8786
public function theme(string $name, string|ParsedTheme $pathOrTheme): static
8887
{
8988
$this->environment->themes->register($name, $pathOrTheme);

src/Theme/Theme.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ enum Theme: string
7070
public function path(): string
7171
{
7272
return match ($this) {
73-
default => __DIR__ . "/../../resources/themes/{$this->value}.json",
73+
default => __DIR__."/../../resources/themes/{$this->value}.json",
7474
};
7575
}
7676

src/Transformers/Decorations/DecorationTransformer.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
class DecorationTransformer extends AbstractTransformer
99
{
1010
/**
11-
* @param array<int, LineDecoration> $decorations
11+
* @param array<int, LineDecoration> $decorations
1212
*/
1313
public function __construct(
1414
public array &$decorations,

src/Transformers/Decorations/LineDecoration.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,10 @@
77
class LineDecoration
88
{
99
/**
10-
* @param int | array<int> $line
10+
* @param int | array<int> $line
1111
*/
1212
public function __construct(
13-
public int | array $line,
13+
public int|array $line,
1414
public ClassList $classes,
1515
) {}
1616

tests/Adapters/Laravel/Components/CodeTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727
<x-phiki::code grammar="php" theme="github-light" gutter :starting-line="10">
2828
echo "Hello, world!";
2929
</x-phiki::code>
30-
BLADE);
30+
BLADE);
3131

3232
expect($output)->toContain('10</span>');
3333
});

tests/Adapters/Laravel/Facades/PhikiTest.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,19 +12,19 @@
1212
});
1313

1414
it('can register a custom grammar', function () {
15-
Phiki::grammar('custom', __DIR__ . '/../../../Fixtures/example.json');
15+
Phiki::grammar('custom', __DIR__.'/../../../Fixtures/example.json');
1616

1717
expect(Phiki::environment()->grammars->has('custom'))->toBeTrue();
1818
});
1919

2020
it('can register a custom theme', function () {
21-
Phiki::theme('custom', __DIR__ . '/../../../Fixtures/theme.json');
21+
Phiki::theme('custom', __DIR__.'/../../../Fixtures/theme.json');
2222

2323
expect(Phiki::environment()->themes->has('custom'))->toBeTrue();
2424
});
2525

2626
it('can register an extension', function () {
27-
$extension = new EmptyExtension();
27+
$extension = new EmptyExtension;
2828

2929
Phiki::extend($extension);
3030

0 commit comments

Comments
 (0)