Skip to content

Commit c064ddb

Browse files
committed
Initial commit
0 parents  commit c064ddb

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

45 files changed

+3032
-0
lines changed

.editorconfig

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
root = true
2+
3+
[*]
4+
charset = utf-8
5+
end_of_line = lf
6+
insert_final_newline = true
7+
indent_style = space
8+
indent_size = 4
9+
trim_trailing_whitespace = true
10+
11+
[*.md]
12+
trim_trailing_whitespace = false
13+
14+
[*.{yml,yaml,neon}]
15+
indent_size = 2

.gitattributes

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
* text=auto eol=lf
2+
3+
# GIT
4+
.editorconfig export-ignore
5+
.gitattributes export-ignore
6+
.gitignore export-ignore
7+
8+
# Tools
9+
.php-cs-fixer.php export-ignore
10+
phpstan.neon export-ignore
11+
12+
# Tests + CI
13+
phpunit.xml export-ignore
14+
15+
/.github export-ignore
16+
/tests export-ignore
17+
18+
# JavaScript
19+
tsconfig.json export-ignore
20+
21+
vite.config.js export-ignore
22+
/resources/src export-ignore

.gitignore

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
# IDE
2+
/.idea
3+
/.cursor
4+
5+
# Composer
6+
/composer.lock
7+
/vendor
8+
/node_modules
9+
/build
10+
11+
# Testing
12+
test.php
13+
14+
# Toolset
15+
*.phar

.php-cs-fixer.php

Lines changed: 252 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,252 @@
1+
<?php
2+
3+
$files = PhpCsFixer\Finder::create()
4+
->in([
5+
__DIR__ . '/src'
6+
])
7+
->filter(static fn (\SplFileInfo $file): bool
8+
=> !\in_array(\realpath($file->getPathname()), [
9+
// "public private(set) ?Window $default" detects as ternary operator
10+
\realpath(__DIR__ . '/src/Window/Manager/WindowManager.php'),
11+
// Fixer doesnt support an abstract properties
12+
\realpath(__DIR__ . '/src/Shared/IdValueGenerator/IntValueGenerator.php'),
13+
\realpath(__DIR__ . '/src/Http/Headers/ContentDispositionHeader.php'),
14+
], true)
15+
)
16+
;
17+
18+
return (new PhpCsFixer\Config())
19+
->setRules([
20+
'@PER-CS2.0' => true,
21+
'@PER-CS2.0:risky' => true,
22+
// broken in v3.70.2 (`$property { get; set; }` -> `$property { get; }`)
23+
'no_empty_statement' => false,
24+
// broken in v3.70.2 (`public private(set) Some $x` -> `public private(set) public Some $x`)
25+
'visibility_required' => false,
26+
'strict_param' => true,
27+
'align_multiline_comment' => true,
28+
'array_syntax' => [
29+
'syntax' => 'short',
30+
],
31+
'backtick_to_shell_exec' => true,
32+
'binary_operator_spaces' => true,
33+
'blank_line_before_statement' => [
34+
'statements' => [
35+
'return',
36+
],
37+
],
38+
'braces_position' => [
39+
'allow_single_line_anonymous_functions' => true,
40+
'allow_single_line_empty_anonymous_classes' => true,
41+
],
42+
'class_attributes_separation' => [
43+
'elements' => [
44+
'method' => 'one',
45+
],
46+
],
47+
'class_reference_name_casing' => true,
48+
'clean_namespace' => true,
49+
'declare_parentheses' => true,
50+
'echo_tag_syntax' => true,
51+
'empty_loop_body' => ['style' => 'braces'],
52+
'empty_loop_condition' => true,
53+
'fully_qualified_strict_types' => true,
54+
'general_phpdoc_tag_rename' => [
55+
'replacements' => [
56+
'inheritDocs' => 'inheritDoc',
57+
],
58+
],
59+
'global_namespace_import' => [
60+
'import_classes' => false,
61+
'import_constants' => false,
62+
'import_functions' => false,
63+
],
64+
'include' => true,
65+
'increment_style' => true,
66+
'integer_literal_case' => true,
67+
'lambda_not_used_import' => true,
68+
'linebreak_after_opening_tag' => true,
69+
'magic_constant_casing' => true,
70+
'magic_method_casing' => true,
71+
'native_function_casing' => true,
72+
'native_type_declaration_casing' => true,
73+
'no_alias_language_construct_call' => true,
74+
'no_alternative_syntax' => true,
75+
'no_binary_string' => true,
76+
'no_blank_lines_after_phpdoc' => true,
77+
'no_empty_comment' => true,
78+
'no_empty_phpdoc' => true,
79+
'no_extra_blank_lines' => [
80+
'tokens' => [
81+
'attribute',
82+
'case',
83+
'continue',
84+
'curly_brace_block',
85+
'default',
86+
'extra',
87+
'parenthesis_brace_block',
88+
'square_brace_block',
89+
'switch',
90+
'throw',
91+
'use',
92+
],
93+
],
94+
'no_leading_namespace_whitespace' => true,
95+
'no_mixed_echo_print' => true,
96+
'no_null_property_initialization' => true,
97+
'no_short_bool_cast' => true,
98+
'no_singleline_whitespace_before_semicolons' => true,
99+
'no_spaces_around_offset' => true,
100+
'no_superfluous_phpdoc_tags' => [
101+
'allow_hidden_params' => true,
102+
'remove_inheritdoc' => true,
103+
],
104+
'no_trailing_comma_in_singleline' => true,
105+
'no_unneeded_braces' => [
106+
'namespaces' => true,
107+
],
108+
'no_unneeded_control_parentheses' => [
109+
'statements' => [
110+
'break',
111+
'clone',
112+
'continue',
113+
'echo_print',
114+
'others',
115+
'return',
116+
'switch_case',
117+
'yield',
118+
'yield_from',
119+
],
120+
],
121+
'no_unneeded_import_alias' => true,
122+
'no_unset_cast' => true,
123+
'no_unused_imports' => true,
124+
'no_useless_concat_operator' => true,
125+
'no_useless_nullsafe_operator' => true,
126+
'no_whitespace_before_comma_in_array' => true,
127+
'normalize_index_brace' => true,
128+
'nullable_type_declaration' => true,
129+
'nullable_type_declaration_for_default_null_value' => true,
130+
'object_operator_without_whitespace' => true,
131+
'operator_linebreak' => [
132+
'only_booleans' => true,
133+
],
134+
'ordered_imports' => [
135+
'imports_order' => [
136+
'class',
137+
'function',
138+
'const',
139+
],
140+
'sort_algorithm' => 'alpha',
141+
],
142+
'ordered_types' => [
143+
'null_adjustment' => 'always_last',
144+
'sort_algorithm' => 'none',
145+
],
146+
'php_unit_fqcn_annotation' => true,
147+
'php_unit_method_casing' => true,
148+
'phpdoc_align' => false,
149+
'phpdoc_annotation_without_dot' => true,
150+
'phpdoc_indent' => true,
151+
'phpdoc_inline_tag_normalizer' => true,
152+
'phpdoc_no_access' => true,
153+
'phpdoc_no_alias_tag' => false,
154+
'phpdoc_no_package' => true,
155+
'phpdoc_no_useless_inheritdoc' => true,
156+
'phpdoc_order' => [
157+
'order' => [
158+
'api',
159+
'template',
160+
'template-extends',
161+
'extends',
162+
'template-implements',
163+
'implements',
164+
'property',
165+
'property-read',
166+
'property-write',
167+
'psalm-require-implements',
168+
'phpstan-require-implements',
169+
'psalm-require-extends',
170+
'phpstan-require-extends',
171+
'mixin',
172+
'readonly',
173+
'psalm-readonly',
174+
'phpstan-readonly',
175+
'param',
176+
'return',
177+
'throws',
178+
'internal',
179+
'psalm-internal',
180+
'psalm-suppress',
181+
],
182+
],
183+
'phpdoc_return_self_reference' => true,
184+
'phpdoc_scalar' => true,
185+
'phpdoc_separation' => [
186+
'groups' => [
187+
[
188+
'property',
189+
'property-read',
190+
'property-write',
191+
],
192+
['internal', 'psalm-internal', 'phpstan-internal'],
193+
[
194+
'template',
195+
'template-extends',
196+
'extends',
197+
'template-implements',
198+
'implements',
199+
'psalm-require-implements',
200+
'phpstan-require-implements',
201+
'psalm-require-extends',
202+
'phpstan-require-extends',
203+
'mixin',
204+
],
205+
['psalm-taint-sink', 'param'],
206+
['return', 'throws'],
207+
['psalm-suppress'],
208+
],
209+
],
210+
'phpdoc_single_line_var_spacing' => true,
211+
'phpdoc_tag_type' => [
212+
'tags' => [
213+
'inheritDoc' => 'inline',
214+
],
215+
],
216+
'phpdoc_to_comment' => false,
217+
'phpdoc_trim' => true,
218+
'phpdoc_trim_consecutive_blank_line_separation' => true,
219+
'phpdoc_types' => true,
220+
'phpdoc_types_order' => [
221+
'null_adjustment' => 'always_last',
222+
'sort_algorithm' => 'none',
223+
],
224+
'phpdoc_var_without_name' => true,
225+
'semicolon_after_instruction' => true,
226+
'simple_to_complex_string_variable' => true,
227+
'single_class_element_per_statement' => true,
228+
'single_import_per_statement' => true,
229+
'single_line_comment_spacing' => true,
230+
'single_line_comment_style' => [
231+
'comment_types' => [
232+
'hash',
233+
],
234+
],
235+
'single_line_throw' => false,
236+
'single_quote' => true,
237+
'space_after_semicolon' => [
238+
'remove_in_empty_for_expressions' => true,
239+
],
240+
'standardize_increment' => true,
241+
'standardize_not_equals' => true,
242+
'switch_continue_to_break' => true,
243+
'trailing_comma_in_multiline' => true,
244+
'trim_array_spaces' => true,
245+
'type_declaration_spaces' => true,
246+
'types_spaces' => true,
247+
'unary_operator_spaces' => true,
248+
'whitespace_after_comma_in_array' => true,
249+
'yoda_style' => false,
250+
])
251+
->setCacheFile(__DIR__ . '/vendor/.cache.php-cs-fixer')
252+
->setFinder($files);

LICENSE

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
The MIT License (MIT)
2+
3+
Copyright (c) Nesmeyanov Kirill
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in all
13+
copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
SOFTWARE.

box.json

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
{
2+
"check-requirements": false,
3+
"dump-autoload": false,
4+
"stub": "entrypoint.php",
5+
"output": "app.phar",
6+
"main": false,
7+
"compression": "GZ",
8+
"finder": [
9+
{
10+
"name": [
11+
"*.php",
12+
"*.js",
13+
"*.css",
14+
"*.woff2",
15+
"*.html",
16+
"*.svg"
17+
],
18+
"exclude": [
19+
"Test",
20+
"test",
21+
"Tests",
22+
"tests"
23+
],
24+
"in": [
25+
"src",
26+
"public",
27+
"vendor"
28+
]
29+
}
30+
]
31+
}

compile.php

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
<?php
2+
3+
require __DIR__ . '/vendor/autoload.php';
4+
5+
echo \passthru('php ' . __DIR__ . '/box.phar compile');
6+
7+
@\mkdir(__DIR__ . '/build', recursive: true);
8+
\copy(__DIR__ . '/vendor/boson-php/runtime/bin/libboson-windows-x86_64.dll',
9+
__DIR__ . '/build/libboson-windows-x86_64.dll');
10+
11+
$output = \fopen(__DIR__ . '/build/open-ray.exe', 'wb+');
12+
$ini = <<<'INI'
13+
ffi.enable=1
14+
opcache.enable=1
15+
opcache.enable_cli=1
16+
opcache.jit_buffer_size=128M
17+
INI;
18+
19+
\stream_copy_to_stream(\fopen(__DIR__ . '/micro.sfx', 'rb'), $output);
20+
\fwrite($output, "\xfd\xf6\x69\xe6");
21+
\fwrite($output, \pack('N', \strlen($ini)));
22+
\fwrite($output, $ini);
23+
\fwrite($output, \file_get_contents(__DIR__ . '/app.phar'));
24+
\fclose($output);
25+
26+
echo \passthru(__DIR__ . '/build/open-ray.exe');

0 commit comments

Comments
 (0)