From 3cf86da0c1b548197ef16942103a8770b4411688 Mon Sep 17 00:00:00 2001 From: Matheus Martins Date: Mon, 1 Jun 2026 21:16:31 +0200 Subject: [PATCH 1/2] repo: collapse monorepo to single xphp package tools and playground code will live on their own repo Co-Authored-By: Claude Opus 4.7 (1M context) --- .github/workflows/ci-core.yml | 12 +- .github/workflows/ci-lsp.yml | 94 - .github/workflows/ci-phpstorm-plugin.yml | 141 -- .github/workflows/release-phpstorm-plugin.yml | 133 - CONTRIBUTING.md | 191 +- core/Makefile => Makefile | 0 README.md | 109 +- {core/bin => bin}/xphp | 0 core/composer.json => composer.json | 0 core/composer.lock => composer.lock | 0 core/CONTRIBUTING.md | 12 - core/README.md | 55 - core/docs/roadmap.md | 72 - .../fixture/compile/docs/source/Client.xphp | 12 - .../compile/docs/source/Model/Box.xphp | 9 - .../compile/docs/source/Model/Food.xphp | 4 - docker-compose.yml | 48 +- {core/docs => docs}/compiler.md | 0 docs/roadmap.md | 76 +- {core/docs => docs}/type-system/comparison.md | 0 .../type-system/generics/index.md | 0 core/infection.json5 => infection.json5 | 0 core/phpunit.xml.dist => phpunit.xml.dist | 0 playground/.gitignore | 3 - playground/README.md | 53 - playground/_site_src/.gitignore | 1 - playground/_site_src/index.md | 88 - .../_site_src/src/Containers/Box.xphp.md | 29 - .../src/Containers/Collection.xphp.md | 42 - .../src/Containers/InMemoryRepository.xphp.md | 37 - .../_site_src/src/Containers/Map.xphp.md | 41 - .../_site_src/src/Containers/Pair.xphp.md | 26 - .../src/Containers/Repository.xphp.md | 24 - .../src/Containers/StringableBox.xphp.md | 29 - .../_site_src/src/Containers/Util.xphp.md | 30 - .../_site_src/src/Containers/Wrapper.xphp.md | 31 - .../_site_src/src/Demos/ArraySugar.xphp.md | 45 - playground/_site_src/src/Demos/Bounds.xphp.md | 38 - .../src/Demos/GenericFunction.xphp.md | 39 - .../src/Demos/GenericInterface.xphp.md | 49 - .../_site_src/src/Demos/GenericMethod.xphp.md | 50 - .../src/Demos/InstanceofTemplate.xphp.md | 41 - .../_site_src/src/Demos/MultiType.xphp.md | 42 - .../src/Demos/NestedTransitive.xphp.md | 33 - .../_site_src/src/Demos/SingleType.xphp.md | 37 - playground/_site_src/src/Models/Food.xphp.md | 24 - .../_site_src/src/Models/Plastic.xphp.md | 24 - playground/_site_src/src/Models/Tag.xphp.md | 29 - playground/_site_src/src/Models/User.xphp.md | 24 - ...b6a023199482af4f6a278a33d8bd9ebe44f.php.md | 26 - ...25438ff880765b54fb07b0698700f21a0cd.php.md | 26 - ...1da6bb3165b1a8f0c07236c92d911df85ed.php.md | 36 - ...1da6bb3165b1a8f0c07236c92d911df85ed.php.md | 32 - ...7efa95da520d87d6728a4c41906ecce5bca.php.md | 36 - ...6cf6d925ef67d412e2b8743703540f18bdd.php.md | 22 - ...4e76250619a79189c7cb33652fd9815b2ed.php.md | 22 - ...1da6bb3165b1a8f0c07236c92d911df85ed.php.md | 21 - ...ca5ac1055bf09f6e08d6c63ea8845032b8c.php.md | 26 - ...25438ff880765b54fb07b0698700f21a0cd.php.md | 26 - .../_site_src/var/dist/Containers/Box.php.md | 19 - .../var/dist/Containers/Collection.php.md | 19 - .../dist/Containers/InMemoryRepository.php.md | 19 - .../_site_src/var/dist/Containers/Map.php.md | 19 - .../_site_src/var/dist/Containers/Pair.php.md | 19 - .../var/dist/Containers/Repository.php.md | 19 - .../var/dist/Containers/StringableBox.php.md | 19 - .../_site_src/var/dist/Containers/Util.php.md | 31 - .../var/dist/Containers/Wrapper.php.md | 20 - .../var/dist/Demos/ArraySugar.php.md | 36 - .../_site_src/var/dist/Demos/Bounds.php.md | 32 - .../var/dist/Demos/GenericFunction.php.md | 46 - .../var/dist/Demos/GenericInterface.php.md | 40 - .../var/dist/Demos/GenericMethod.php.md | 42 - .../var/dist/Demos/InstanceofTemplate.php.md | 33 - .../_site_src/var/dist/Demos/MultiType.php.md | 35 - .../var/dist/Demos/NestedTransitive.php.md | 27 - .../var/dist/Demos/SingleType.php.md | 30 - .../_site_src/var/dist/Models/Food.php.md | 22 - .../_site_src/var/dist/Models/Plastic.php.md | 22 - .../_site_src/var/dist/Models/Tag.php.md | 26 - .../_site_src/var/dist/Models/User.php.md | 22 - playground/bin/build-site | 263 -- playground/bin/run | 50 - playground/composer.json | 36 - playground/src/Containers/Box.xphp | 17 - playground/src/Containers/Collection.xphp | 30 - .../src/Containers/InMemoryRepository.xphp | 30 - playground/src/Containers/Map.xphp | 29 - playground/src/Containers/Pair.xphp | 14 - playground/src/Containers/Repository.xphp | 14 - playground/src/Containers/StringableBox.xphp | 17 - playground/src/Containers/Util.xphp | 18 - playground/src/Containers/Wrapper.xphp | 19 - playground/src/Demos/ArraySugar.xphp | 33 - playground/src/Demos/Bounds.xphp | 26 - playground/src/Demos/GenericFunction.xphp | 27 - playground/src/Demos/GenericInterface.xphp | 38 - playground/src/Demos/GenericMethod.xphp | 38 - playground/src/Demos/Inheritance.xphp | 32 - playground/src/Demos/InstanceofTemplate.xphp | 29 - playground/src/Demos/MultiType.xphp | 30 - playground/src/Demos/NestedTransitive.xphp | 21 - playground/src/Demos/Phase3BoundAware.xphp | 30 - playground/src/Demos/Phase3ClosedFile.xphp | 25 - .../src/Demos/Phase3ScopeAwareVars.xphp | 54 - playground/src/Demos/Phase3StaticProp.xphp | 23 - .../src/Demos/Phase3SubclassProtected.xphp | 31 - playground/src/Demos/Phase3TieBreak.xphp | 28 - playground/src/Demos/Phase3Utf16.xphp | 27 - playground/src/Demos/SingleType.xphp | 25 - playground/src/Models/Animal.xphp | 33 - playground/src/Models/Cat.xphp | 13 - playground/src/Models/Dog.xphp | 9 - playground/src/Models/Food.xphp | 12 - playground/src/Models/Plastic.xphp | 12 - playground/src/Models/Stats.xphp | 31 - playground/src/Models/Tag.xphp | 17 - playground/src/Models/User.xphp | 12 - playground/tests/Fixtures/User.xphp | 29 - .../Console/ApplicationConsole.php | 0 .../Console/Command/CompileCommand.php | 0 {core/src => src}/FileSystem/FileFinder.php | 0 .../FileFinder/NativeFileFinder.php | 0 {core/src => src}/FileSystem/FileReader.php | 0 .../FileReader/NativeFileReader.php | 0 {core/src => src}/FileSystem/FileWriter.php | 0 .../FileWriter/NativeFileWriter.php | 0 .../src => src}/FileSystem/FilepathArray.php | 0 .../Transpiler/Monomorphize/ByteOffsetMap.php | 0 .../Monomorphize/CallSiteRewriter.php | 0 .../Transpiler/Monomorphize/CompileResult.php | 0 .../Transpiler/Monomorphize/Compiler.php | 0 .../Monomorphize/GenericDefinition.php | 0 .../Monomorphize/GenericInstantiation.php | 0 .../Monomorphize/GenericMethodCompiler.php | 0 .../Monomorphize/ParseWithMapResult.php | 0 .../Transpiler/Monomorphize/Registry.php | 0 .../Monomorphize/RegistryCollector.php | 0 .../SpecializedClassGenerator.php | 0 .../Transpiler/Monomorphize/Specializer.php | 0 .../Transpiler/Monomorphize/TypeHierarchy.php | 0 .../Transpiler/Monomorphize/TypeParam.php | 0 .../Transpiler/Monomorphize/TypeRef.php | 0 .../Monomorphize/XphpSourceParser.php | 0 .../FileSystem/FilepathArrayTest.php | 0 .../ArraySugarIntegrationTest.php | 0 .../BoundedGenericIntegrationTest.php | 0 .../Monomorphize/ByteOffsetMapTest.php | 0 .../Monomorphize/CompilerDepthCapTest.php | 0 .../Monomorphize/CompilerIntegrationTest.php | 0 .../GenericFunctionIntegrationTest.php | 0 .../GenericInterfaceIntegrationTest.php | 0 .../GenericMethodIntegrationTest.php | 0 .../MultiTypeGenericsIntegrationTest.php | 0 .../NestedArgsInSpecializedFunctionTest.php | 0 .../NestedGenericsIntegrationTest.php | 0 .../Monomorphize/RegistryBoundsTest.php | 0 .../Transpiler/Monomorphize/RegistryTest.php | 0 .../Monomorphize/TypeHierarchyTest.php | 0 .../Transpiler/Monomorphize/TypeRefTest.php | 0 .../Monomorphize/VisitorGuardsTest.php | 0 .../Monomorphize/XphpSourceParserTest.php | 0 {core/test => test}/bootstrap.php | 0 .../source/Containers/Collection.xphp | 0 .../array_sugar/source/Models/User.xphp | 0 .../compile/array_sugar/source/Use.xphp | 0 .../bounds_happy/source/Containers/Box.xphp | 0 .../bounds_happy/source/Models/Tag.xphp | 0 .../compile/bounds_happy/source/Use.xphp | 0 .../box_generic/source/Containers/Box.xphp | 0 .../box_generic/source/Helpers/Helper.xphp | 0 .../box_generic/source/Models/Metal.xphp | 0 .../box_generic/source/Models/Plastic.xphp | 0 .../compile/box_generic/source/Use.xphp | 0 .../source/Containers/Recursive.xphp | 0 .../fixture/compile/depth_cap/source/Use.xphp | 0 .../compile/generic_function/source/Use.xphp | 0 .../generic_function/source/funcs.xphp | 0 .../source/Containers/Box.xphp | 0 .../source/Use.xphp | 0 .../source/funcs.xphp | 0 .../source/Containers/Box.xphp | 0 .../source/Containers/Container.xphp | 0 .../source/Models/Plastic.xphp | 0 .../source/Models/Polymer.xphp | 0 .../compile/generic_interface/source/Use.xphp | 0 .../compile/generic_method/source/Use.xphp | 0 .../compile/generic_method/source/Util.xphp | 0 .../multi_type/source/Containers/Map.xphp | 0 .../multi_type/source/Containers/Pair.xphp | 0 .../multi_type/source/Models/Plastic.xphp | 0 .../multi_type/source/Models/User.xphp | 0 .../compile/multi_type/source/Use.xphp | 0 .../source/Containers/Box.xphp | 0 .../source/Containers/Lst.xphp | 0 .../source/Models/Plastic.xphp | 0 .../nested_instantiation/source/Use.xphp | 0 .../source/Containers/Box.xphp | 0 .../source/Containers/Wrapper.xphp | 0 .../source/Models/Plastic.xphp | 0 .../compile/nested_typehint/source/Use.xphp | 0 tools/lsp/.gitignore | 5 - tools/lsp/CONTRIBUTING.md | 53 - tools/lsp/Makefile | 95 - tools/lsp/README.md | 93 - tools/lsp/bin/xphp-lsp | 57 - tools/lsp/box.json | 14 - tools/lsp/composer.json | 47 - tools/lsp/docs/features/index.md | 380 --- tools/lsp/docs/roadmap.md | 291 --- tools/lsp/infection.json5 | 2136 ----------------- tools/lsp/phpunit.xml.dist | 58 - tools/lsp/src/Analyzer/Analyzer.php | 229 -- .../Analyzer/ConstructorArgumentChecker.php | 704 ------ tools/lsp/src/Analyzer/Diagnostic.php | 31 - tools/lsp/src/Analyzer/DiagnosticCode.php | 96 - tools/lsp/src/Analyzer/DiagnosticSeverity.php | 17 - tools/lsp/src/Analyzer/ParseResult.php | 34 - .../lsp/src/Analyzer/ParsedDocumentCache.php | 114 - .../Analyzer/ParsedDocumentCacheWarmer.php | 122 - tools/lsp/src/Analyzer/WorkspaceAnalyzer.php | 257 -- .../src/Diagnostics/DiagnosticTranslator.php | 33 - .../Diagnostics/XphpDiagnosticsProvider.php | 133 - .../Dispatcher/LspObjectArgumentResolver.php | 102 - tools/lsp/src/Handler/AstPositionResolver.php | 87 - .../src/Handler/SemanticTokens/AstVisitor.php | 640 ----- .../src/Handler/SemanticTokens/Encoder.php | 86 - .../Handler/SemanticTokens/TokenLegend.php | 91 - .../src/Handler/SemanticTokens/TokenSpec.php | 43 - .../src/Handler/TypeArgPositionDetector.php | 168 -- tools/lsp/src/Handler/WorkspaceSymbols.php | 266 -- .../src/Handler/XphpCallHierarchyHandler.php | 732 ------ .../lsp/src/Handler/XphpCodeActionHandler.php | 102 - .../Handler/XphpCodeActionResolveHandler.php | 52 - tools/lsp/src/Handler/XphpCodeLensHandler.php | 279 --- .../lsp/src/Handler/XphpCompletionHandler.php | 350 --- .../Handler/XphpCompletionResolveHandler.php | 89 - .../lsp/src/Handler/XphpDefinitionHandler.php | 268 --- .../Handler/XphpDocumentHighlightHandler.php | 98 - .../src/Handler/XphpDocumentSymbolHandler.php | 279 --- .../src/Handler/XphpFileWatcherHandler.php | 122 - .../src/Handler/XphpFoldingRangeHandler.php | 144 -- tools/lsp/src/Handler/XphpHoverHandler.php | 372 --- .../src/Handler/XphpImplementationHandler.php | 302 --- .../lsp/src/Handler/XphpInlayHintHandler.php | 178 -- .../Handler/XphpPullDiagnosticsHandler.php | 94 - .../lsp/src/Handler/XphpReferencesHandler.php | 67 - tools/lsp/src/Handler/XphpRenameHandler.php | 80 - .../src/Handler/XphpSemanticTokensHandler.php | 149 -- .../src/Handler/XphpSignatureHelpHandler.php | 382 --- .../src/Handler/XphpTextDocumentHandler.php | 113 - .../src/Handler/XphpTypeDefinitionHandler.php | 85 - .../src/Handler/XphpTypeHierarchyHandler.php | 531 ---- .../Handler/XphpWillRenameFilesHandler.php | 332 --- .../Handler/XphpWorkspaceSymbolHandler.php | 163 -- tools/lsp/src/LspDispatcherFactory.php | 404 ---- tools/lsp/src/PositionMap.php | 207 -- .../Reflection/FilesystemSourceLocator.php | 187 -- tools/lsp/src/Reflection/FqnIndex.php | 1566 ------------ tools/lsp/src/Reflection/FqnIndexWarmer.php | 74 - tools/lsp/src/Reflection/ReflectorFactory.php | 297 --- .../src/Reflection/WorkspaceSourceLocator.php | 129 - tools/lsp/src/Resolver/ClassFqnPredicate.php | 73 - tools/lsp/src/Resolver/ClassLikeLookup.php | 32 - .../src/Resolver/ClassNameImportContext.php | 154 -- tools/lsp/src/Resolver/CompletionIndex.php | 71 - .../src/Resolver/CompositeClassLikeLookup.php | 41 - .../Resolver/DiagnosticCodeActionProvider.php | 167 -- .../Resolver/FilesystemClassLikeLookup.php | 34 - .../lsp/src/Resolver/GenericParamRegistry.php | 133 - tools/lsp/src/Resolver/GenericResolver.php | 1640 ------------- .../src/Resolver/ImportCodeActionProvider.php | 273 --- .../Resolver/InvalidRenameNameException.php | 17 - .../src/Resolver/MethodCallSubstitution.php | 34 - .../src/Resolver/NamespaceMoveProvider.php | 576 ----- .../OptimizeImportsCodeActionProvider.php | 236 -- .../lsp/src/Resolver/PhpCompletionContext.php | 262 -- .../src/Resolver/PhpCompletionResolver.php | 1117 --------- .../src/Resolver/PhpDefinitionResolver.php | 821 ------- tools/lsp/src/Resolver/PhpHoverResolver.php | 662 ----- tools/lsp/src/Resolver/ReferenceFinder.php | 1447 ----------- tools/lsp/src/Resolver/RenameProvider.php | 295 --- tools/lsp/src/Resolver/ResolvedType.php | 31 - tools/lsp/src/Resolver/StubsIndex.php | 187 -- tools/lsp/src/Resolver/TypeUnionSplitter.php | 205 -- tools/lsp/src/Resolver/VarBinding.php | 29 - .../src/Resolver/WorkspaceClassLikeLookup.php | 103 - tools/lsp/src/Server.php | 118 - tools/lsp/src/Stderr.php | 50 - tools/lsp/test/Analyzer/AnalyzerTest.php | 273 --- .../ConstructorArgumentCheckerTest.php | 335 --- .../lsp/test/Analyzer/DiagnosticCodeTest.php | 75 - .../test/Analyzer/ParsedDocumentCacheTest.php | 182 -- .../ParsedDocumentCacheWarmerTest.php | 224 -- .../test/Analyzer/WorkspaceAnalyzerTest.php | 382 --- .../XphpDiagnosticsProviderTest.php | 476 ---- .../LspObjectArgumentResolverTest.php | 131 - .../test/Handler/AstPositionResolverTest.php | 122 - .../Handler/SemanticTokens/AstVisitorTest.php | 445 ---- .../Handler/SemanticTokens/EncoderTest.php | 147 -- .../SemanticTokens/TokenLegendTest.php | 66 - .../Handler/TypeArgPositionDetectorTest.php | 217 -- .../lsp/test/Handler/WorkspaceSymbolsTest.php | 206 -- .../Handler/XphpCallHierarchyHandlerTest.php | 322 --- .../Handler/XphpCodeActionHandlerTest.php | 192 -- .../test/Handler/XphpCodeLensHandlerTest.php | 312 --- .../Handler/XphpCompletionHandlerTest.php | 534 ----- .../XphpCompletionResolveHandlerTest.php | 171 -- .../Handler/XphpDefinitionHandlerTest.php | 545 ----- .../XphpDocumentHighlightHandlerTest.php | 269 --- .../Handler/XphpDocumentSymbolHandlerTest.php | 251 -- .../Handler/XphpFileWatcherHandlerTest.php | 296 --- .../Handler/XphpFoldingRangeHandlerTest.php | 186 -- .../lsp/test/Handler/XphpHoverHandlerTest.php | 600 ----- .../Handler/XphpImplementationHandlerTest.php | 265 -- .../test/Handler/XphpInlayHintHandlerTest.php | 179 -- .../XphpPullDiagnosticsHandlerTest.php | 143 -- .../Handler/XphpReferencesHandlerTest.php | 1123 --------- .../test/Handler/XphpRenameHandlerTest.php | 553 ----- .../Handler/XphpSemanticTokensHandlerTest.php | 153 -- .../Handler/XphpSignatureHelpHandlerTest.php | 194 -- .../Handler/XphpTextDocumentHandlerTest.php | 117 - .../Handler/XphpTypeDefinitionHandlerTest.php | 204 -- .../Handler/XphpTypeHierarchyHandlerTest.php | 340 --- .../XphpWillRenameFilesHandlerTest.php | 699 ------ .../XphpWorkspaceSymbolHandlerTest.php | 271 --- tools/lsp/test/LspDispatcherFactoryTest.php | 222 -- tools/lsp/test/PositionMapTest.php | 448 ---- .../FilesystemSourceLocatorTest.php | 321 --- tools/lsp/test/Reflection/FqnIndexTest.php | 863 ------- .../test/Reflection/FqnIndexWarmerTest.php | 117 - .../test/Reflection/ReflectorFactoryTest.php | 311 --- .../Reflection/WorkspaceSourceLocatorTest.php | 158 -- .../test/Resolver/ClassFqnPredicateTest.php | 79 - .../Resolver/ClassNameImportContextTest.php | 207 -- .../lsp/test/Resolver/CompletionIndexTest.php | 98 - .../Resolver/CompositeClassLikeLookupTest.php | 58 - .../DiagnosticCodeActionProviderTest.php | 135 -- .../FilesystemClassLikeLookupTest.php | 85 - .../Resolver/GenericParamRegistryTest.php | 202 -- .../lsp/test/Resolver/GenericResolverTest.php | 883 ------- .../Resolver/ImportCodeActionProviderTest.php | 219 -- .../OptimizeImportsCodeActionProviderTest.php | 120 - .../Resolver/PhpCompletionContextTest.php | 197 -- .../Resolver/PhpCompletionResolverTest.php | 1224 ---------- .../Resolver/PhpDefinitionResolverTest.php | 592 ----- .../test/Resolver/PhpHoverResolverTest.php | 1077 --------- tools/lsp/test/Resolver/StubsIndexTest.php | 113 - .../test/Resolver/TypeUnionSplitterTest.php | 70 - tools/lsp/test/StderrTest.php | 112 - tools/lsp/test/bootstrap.php | 12 - tools/lsp/var/xphp-lsp.phar | Bin 4538203 -> 0 bytes tools/phpstorm-plugin/.gitignore | 18 - tools/phpstorm-plugin/Makefile | 95 - tools/phpstorm-plugin/README.md | 108 - tools/phpstorm-plugin/build.gradle.kts | 210 -- tools/phpstorm-plugin/docs/roadmap.md | 232 -- tools/phpstorm-plugin/gradle.properties | 56 - .../gradle/wrapper/gradle-wrapper.jar | Bin 45457 -> 0 bytes .../gradle/wrapper/gradle-wrapper.properties | 8 - tools/phpstorm-plugin/gradlew | 251 -- tools/phpstorm-plugin/gradlew.bat | 94 - tools/phpstorm-plugin/settings.gradle.kts | 32 - .../main/kotlin/com/xphp/lsp/PharExtractor.kt | 139 -- .../kotlin/com/xphp/lsp/XphpClassFileSync.kt | 181 -- .../com/xphp/lsp/XphpFileRenameListener.kt | 346 --- .../com/xphp/lsp/XphpLspServerDescriptor.kt | 219 -- .../xphp/lsp/XphpLspServerSupportProvider.kt | 38 - .../lsp/XphpShowReferencesCommandsSupport.kt | 372 --- .../com/xphp/lsp/settings/XphpSettings.kt | 97 - .../lsp/settings/XphpSettingsConfigurable.kt | 82 - .../xphp/lsp/textmate/XphpBundleRegistrar.kt | 229 -- .../src/main/resources/META-INF/plugin.xml | 222 -- .../kotlin/com/xphp/lsp/PharExtractorTest.kt | 106 - .../lsp/textmate/XphpBundleRegistrarTest.kt | 143 -- tools/vscode-extension/.gitignore | 5 - tools/vscode-extension/.vscode/launch.json | 19 - tools/vscode-extension/.vscode/tasks.json | 17 - tools/vscode-extension/Makefile | 17 - tools/vscode-extension/README.md | 63 - .../language-configuration.json | 26 - tools/vscode-extension/package.json | 72 - tools/vscode-extension/src/extension.ts | 103 - .../syntaxes/xphp.tmLanguage.json | 46 - tools/vscode-extension/tsconfig.json | 20 - 385 files changed, 132 insertions(+), 50143 deletions(-) delete mode 100644 .github/workflows/ci-lsp.yml delete mode 100644 .github/workflows/ci-phpstorm-plugin.yml delete mode 100644 .github/workflows/release-phpstorm-plugin.yml rename core/Makefile => Makefile (100%) rename {core/bin => bin}/xphp (100%) rename core/composer.json => composer.json (100%) rename core/composer.lock => composer.lock (100%) delete mode 100644 core/CONTRIBUTING.md delete mode 100644 core/README.md delete mode 100644 core/docs/roadmap.md delete mode 100644 core/test/fixture/compile/docs/source/Client.xphp delete mode 100644 core/test/fixture/compile/docs/source/Model/Box.xphp delete mode 100644 core/test/fixture/compile/docs/source/Model/Food.xphp rename {core/docs => docs}/compiler.md (100%) rename {core/docs => docs}/type-system/comparison.md (100%) rename {core/docs => docs}/type-system/generics/index.md (100%) rename core/infection.json5 => infection.json5 (100%) rename core/phpunit.xml.dist => phpunit.xml.dist (100%) delete mode 100644 playground/.gitignore delete mode 100644 playground/README.md delete mode 100644 playground/_site_src/.gitignore delete mode 100644 playground/_site_src/index.md delete mode 100644 playground/_site_src/src/Containers/Box.xphp.md delete mode 100644 playground/_site_src/src/Containers/Collection.xphp.md delete mode 100644 playground/_site_src/src/Containers/InMemoryRepository.xphp.md delete mode 100644 playground/_site_src/src/Containers/Map.xphp.md delete mode 100644 playground/_site_src/src/Containers/Pair.xphp.md delete mode 100644 playground/_site_src/src/Containers/Repository.xphp.md delete mode 100644 playground/_site_src/src/Containers/StringableBox.xphp.md delete mode 100644 playground/_site_src/src/Containers/Util.xphp.md delete mode 100644 playground/_site_src/src/Containers/Wrapper.xphp.md delete mode 100644 playground/_site_src/src/Demos/ArraySugar.xphp.md delete mode 100644 playground/_site_src/src/Demos/Bounds.xphp.md delete mode 100644 playground/_site_src/src/Demos/GenericFunction.xphp.md delete mode 100644 playground/_site_src/src/Demos/GenericInterface.xphp.md delete mode 100644 playground/_site_src/src/Demos/GenericMethod.xphp.md delete mode 100644 playground/_site_src/src/Demos/InstanceofTemplate.xphp.md delete mode 100644 playground/_site_src/src/Demos/MultiType.xphp.md delete mode 100644 playground/_site_src/src/Demos/NestedTransitive.xphp.md delete mode 100644 playground/_site_src/src/Demos/SingleType.xphp.md delete mode 100644 playground/_site_src/src/Models/Food.xphp.md delete mode 100644 playground/_site_src/src/Models/Plastic.xphp.md delete mode 100644 playground/_site_src/src/Models/Tag.xphp.md delete mode 100644 playground/_site_src/src/Models/User.xphp.md delete mode 100644 playground/_site_src/var/cache/Generated/App/Containers/Box/T_3036c16466fa04e2ed024d6b75086b6a023199482af4f6a278a33d8bd9ebe44f.php.md delete mode 100644 playground/_site_src/var/cache/Generated/App/Containers/Box/T_de1e0eaabedbafa176d971782f59025438ff880765b54fb07b0698700f21a0cd.php.md delete mode 100644 playground/_site_src/var/cache/Generated/App/Containers/Collection/T_d59a159d1113876f898c70f94a3971da6bb3165b1a8f0c07236c92d911df85ed.php.md delete mode 100644 playground/_site_src/var/cache/Generated/App/Containers/InMemoryRepository/T_d59a159d1113876f898c70f94a3971da6bb3165b1a8f0c07236c92d911df85ed.php.md delete mode 100644 playground/_site_src/var/cache/Generated/App/Containers/Map/T_ddc02d7f9d24d965819939d5b07227efa95da520d87d6728a4c41906ecce5bca.php.md delete mode 100644 playground/_site_src/var/cache/Generated/App/Containers/Pair/T_307894382bcf10563dfe258ab0eef6cf6d925ef67d412e2b8743703540f18bdd.php.md delete mode 100644 playground/_site_src/var/cache/Generated/App/Containers/Pair/T_3ca1518773f5e15bb180bc027c8394e76250619a79189c7cb33652fd9815b2ed.php.md delete mode 100644 playground/_site_src/var/cache/Generated/App/Containers/Repository/T_d59a159d1113876f898c70f94a3971da6bb3165b1a8f0c07236c92d911df85ed.php.md delete mode 100644 playground/_site_src/var/cache/Generated/App/Containers/StringableBox/T_9ee204cfe5d624be0e92ae24c31f6ca5ac1055bf09f6e08d6c63ea8845032b8c.php.md delete mode 100644 playground/_site_src/var/cache/Generated/App/Containers/Wrapper/T_de1e0eaabedbafa176d971782f59025438ff880765b54fb07b0698700f21a0cd.php.md delete mode 100644 playground/_site_src/var/dist/Containers/Box.php.md delete mode 100644 playground/_site_src/var/dist/Containers/Collection.php.md delete mode 100644 playground/_site_src/var/dist/Containers/InMemoryRepository.php.md delete mode 100644 playground/_site_src/var/dist/Containers/Map.php.md delete mode 100644 playground/_site_src/var/dist/Containers/Pair.php.md delete mode 100644 playground/_site_src/var/dist/Containers/Repository.php.md delete mode 100644 playground/_site_src/var/dist/Containers/StringableBox.php.md delete mode 100644 playground/_site_src/var/dist/Containers/Util.php.md delete mode 100644 playground/_site_src/var/dist/Containers/Wrapper.php.md delete mode 100644 playground/_site_src/var/dist/Demos/ArraySugar.php.md delete mode 100644 playground/_site_src/var/dist/Demos/Bounds.php.md delete mode 100644 playground/_site_src/var/dist/Demos/GenericFunction.php.md delete mode 100644 playground/_site_src/var/dist/Demos/GenericInterface.php.md delete mode 100644 playground/_site_src/var/dist/Demos/GenericMethod.php.md delete mode 100644 playground/_site_src/var/dist/Demos/InstanceofTemplate.php.md delete mode 100644 playground/_site_src/var/dist/Demos/MultiType.php.md delete mode 100644 playground/_site_src/var/dist/Demos/NestedTransitive.php.md delete mode 100644 playground/_site_src/var/dist/Demos/SingleType.php.md delete mode 100644 playground/_site_src/var/dist/Models/Food.php.md delete mode 100644 playground/_site_src/var/dist/Models/Plastic.php.md delete mode 100644 playground/_site_src/var/dist/Models/Tag.php.md delete mode 100644 playground/_site_src/var/dist/Models/User.php.md delete mode 100755 playground/bin/build-site delete mode 100755 playground/bin/run delete mode 100644 playground/composer.json delete mode 100644 playground/src/Containers/Box.xphp delete mode 100644 playground/src/Containers/Collection.xphp delete mode 100644 playground/src/Containers/InMemoryRepository.xphp delete mode 100644 playground/src/Containers/Map.xphp delete mode 100644 playground/src/Containers/Pair.xphp delete mode 100644 playground/src/Containers/Repository.xphp delete mode 100644 playground/src/Containers/StringableBox.xphp delete mode 100644 playground/src/Containers/Util.xphp delete mode 100644 playground/src/Containers/Wrapper.xphp delete mode 100644 playground/src/Demos/ArraySugar.xphp delete mode 100644 playground/src/Demos/Bounds.xphp delete mode 100644 playground/src/Demos/GenericFunction.xphp delete mode 100644 playground/src/Demos/GenericInterface.xphp delete mode 100644 playground/src/Demos/GenericMethod.xphp delete mode 100644 playground/src/Demos/Inheritance.xphp delete mode 100644 playground/src/Demos/InstanceofTemplate.xphp delete mode 100644 playground/src/Demos/MultiType.xphp delete mode 100644 playground/src/Demos/NestedTransitive.xphp delete mode 100644 playground/src/Demos/Phase3BoundAware.xphp delete mode 100644 playground/src/Demos/Phase3ClosedFile.xphp delete mode 100644 playground/src/Demos/Phase3ScopeAwareVars.xphp delete mode 100644 playground/src/Demos/Phase3StaticProp.xphp delete mode 100644 playground/src/Demos/Phase3SubclassProtected.xphp delete mode 100644 playground/src/Demos/Phase3TieBreak.xphp delete mode 100644 playground/src/Demos/Phase3Utf16.xphp delete mode 100644 playground/src/Demos/SingleType.xphp delete mode 100644 playground/src/Models/Animal.xphp delete mode 100644 playground/src/Models/Cat.xphp delete mode 100644 playground/src/Models/Dog.xphp delete mode 100644 playground/src/Models/Food.xphp delete mode 100644 playground/src/Models/Plastic.xphp delete mode 100644 playground/src/Models/Stats.xphp delete mode 100644 playground/src/Models/Tag.xphp delete mode 100644 playground/src/Models/User.xphp delete mode 100644 playground/tests/Fixtures/User.xphp rename {core/src => src}/Console/ApplicationConsole.php (100%) rename {core/src => src}/Console/Command/CompileCommand.php (100%) rename {core/src => src}/FileSystem/FileFinder.php (100%) rename {core/src => src}/FileSystem/FileFinder/NativeFileFinder.php (100%) rename {core/src => src}/FileSystem/FileReader.php (100%) rename {core/src => src}/FileSystem/FileReader/NativeFileReader.php (100%) rename {core/src => src}/FileSystem/FileWriter.php (100%) rename {core/src => src}/FileSystem/FileWriter/NativeFileWriter.php (100%) rename {core/src => src}/FileSystem/FilepathArray.php (100%) rename {core/src => src}/Transpiler/Monomorphize/ByteOffsetMap.php (100%) rename {core/src => src}/Transpiler/Monomorphize/CallSiteRewriter.php (100%) rename {core/src => src}/Transpiler/Monomorphize/CompileResult.php (100%) rename {core/src => src}/Transpiler/Monomorphize/Compiler.php (100%) rename {core/src => src}/Transpiler/Monomorphize/GenericDefinition.php (100%) rename {core/src => src}/Transpiler/Monomorphize/GenericInstantiation.php (100%) rename {core/src => src}/Transpiler/Monomorphize/GenericMethodCompiler.php (100%) rename {core/src => src}/Transpiler/Monomorphize/ParseWithMapResult.php (100%) rename {core/src => src}/Transpiler/Monomorphize/Registry.php (100%) rename {core/src => src}/Transpiler/Monomorphize/RegistryCollector.php (100%) rename {core/src => src}/Transpiler/Monomorphize/SpecializedClassGenerator.php (100%) rename {core/src => src}/Transpiler/Monomorphize/Specializer.php (100%) rename {core/src => src}/Transpiler/Monomorphize/TypeHierarchy.php (100%) rename {core/src => src}/Transpiler/Monomorphize/TypeParam.php (100%) rename {core/src => src}/Transpiler/Monomorphize/TypeRef.php (100%) rename {core/src => src}/Transpiler/Monomorphize/XphpSourceParser.php (100%) rename {core/test => test}/FileSystem/FilepathArrayTest.php (100%) rename {core/test => test}/Transpiler/Monomorphize/ArraySugarIntegrationTest.php (100%) rename {core/test => test}/Transpiler/Monomorphize/BoundedGenericIntegrationTest.php (100%) rename {core/test => test}/Transpiler/Monomorphize/ByteOffsetMapTest.php (100%) rename {core/test => test}/Transpiler/Monomorphize/CompilerDepthCapTest.php (100%) rename {core/test => test}/Transpiler/Monomorphize/CompilerIntegrationTest.php (100%) rename {core/test => test}/Transpiler/Monomorphize/GenericFunctionIntegrationTest.php (100%) rename {core/test => test}/Transpiler/Monomorphize/GenericInterfaceIntegrationTest.php (100%) rename {core/test => test}/Transpiler/Monomorphize/GenericMethodIntegrationTest.php (100%) rename {core/test => test}/Transpiler/Monomorphize/MultiTypeGenericsIntegrationTest.php (100%) rename {core/test => test}/Transpiler/Monomorphize/NestedArgsInSpecializedFunctionTest.php (100%) rename {core/test => test}/Transpiler/Monomorphize/NestedGenericsIntegrationTest.php (100%) rename {core/test => test}/Transpiler/Monomorphize/RegistryBoundsTest.php (100%) rename {core/test => test}/Transpiler/Monomorphize/RegistryTest.php (100%) rename {core/test => test}/Transpiler/Monomorphize/TypeHierarchyTest.php (100%) rename {core/test => test}/Transpiler/Monomorphize/TypeRefTest.php (100%) rename {core/test => test}/Transpiler/Monomorphize/VisitorGuardsTest.php (100%) rename {core/test => test}/Transpiler/Monomorphize/XphpSourceParserTest.php (100%) rename {core/test => test}/bootstrap.php (100%) rename {core/test => test}/fixture/compile/array_sugar/source/Containers/Collection.xphp (100%) rename {core/test => test}/fixture/compile/array_sugar/source/Models/User.xphp (100%) rename {core/test => test}/fixture/compile/array_sugar/source/Use.xphp (100%) rename {core/test => test}/fixture/compile/bounds_happy/source/Containers/Box.xphp (100%) rename {core/test => test}/fixture/compile/bounds_happy/source/Models/Tag.xphp (100%) rename {core/test => test}/fixture/compile/bounds_happy/source/Use.xphp (100%) rename {core/test => test}/fixture/compile/box_generic/source/Containers/Box.xphp (100%) rename {core/test => test}/fixture/compile/box_generic/source/Helpers/Helper.xphp (100%) rename {core/test => test}/fixture/compile/box_generic/source/Models/Metal.xphp (100%) rename {core/test => test}/fixture/compile/box_generic/source/Models/Plastic.xphp (100%) rename {core/test => test}/fixture/compile/box_generic/source/Use.xphp (100%) rename {core/test => test}/fixture/compile/depth_cap/source/Containers/Recursive.xphp (100%) rename {core/test => test}/fixture/compile/depth_cap/source/Use.xphp (100%) rename {core/test => test}/fixture/compile/generic_function/source/Use.xphp (100%) rename {core/test => test}/fixture/compile/generic_function/source/funcs.xphp (100%) rename {core/test => test}/fixture/compile/generic_function_nested_args/source/Containers/Box.xphp (100%) rename {core/test => test}/fixture/compile/generic_function_nested_args/source/Use.xphp (100%) rename {core/test => test}/fixture/compile/generic_function_nested_args/source/funcs.xphp (100%) rename {core/test => test}/fixture/compile/generic_interface/source/Containers/Box.xphp (100%) rename {core/test => test}/fixture/compile/generic_interface/source/Containers/Container.xphp (100%) rename {core/test => test}/fixture/compile/generic_interface/source/Models/Plastic.xphp (100%) rename {core/test => test}/fixture/compile/generic_interface/source/Models/Polymer.xphp (100%) rename {core/test => test}/fixture/compile/generic_interface/source/Use.xphp (100%) rename {core/test => test}/fixture/compile/generic_method/source/Use.xphp (100%) rename {core/test => test}/fixture/compile/generic_method/source/Util.xphp (100%) rename {core/test => test}/fixture/compile/multi_type/source/Containers/Map.xphp (100%) rename {core/test => test}/fixture/compile/multi_type/source/Containers/Pair.xphp (100%) rename {core/test => test}/fixture/compile/multi_type/source/Models/Plastic.xphp (100%) rename {core/test => test}/fixture/compile/multi_type/source/Models/User.xphp (100%) rename {core/test => test}/fixture/compile/multi_type/source/Use.xphp (100%) rename {core/test => test}/fixture/compile/nested_instantiation/source/Containers/Box.xphp (100%) rename {core/test => test}/fixture/compile/nested_instantiation/source/Containers/Lst.xphp (100%) rename {core/test => test}/fixture/compile/nested_instantiation/source/Models/Plastic.xphp (100%) rename {core/test => test}/fixture/compile/nested_instantiation/source/Use.xphp (100%) rename {core/test => test}/fixture/compile/nested_typehint/source/Containers/Box.xphp (100%) rename {core/test => test}/fixture/compile/nested_typehint/source/Containers/Wrapper.xphp (100%) rename {core/test => test}/fixture/compile/nested_typehint/source/Models/Plastic.xphp (100%) rename {core/test => test}/fixture/compile/nested_typehint/source/Use.xphp (100%) delete mode 100644 tools/lsp/.gitignore delete mode 100644 tools/lsp/CONTRIBUTING.md delete mode 100644 tools/lsp/Makefile delete mode 100644 tools/lsp/README.md delete mode 100755 tools/lsp/bin/xphp-lsp delete mode 100644 tools/lsp/box.json delete mode 100644 tools/lsp/composer.json delete mode 100644 tools/lsp/docs/features/index.md delete mode 100644 tools/lsp/docs/roadmap.md delete mode 100644 tools/lsp/infection.json5 delete mode 100644 tools/lsp/phpunit.xml.dist delete mode 100644 tools/lsp/src/Analyzer/Analyzer.php delete mode 100644 tools/lsp/src/Analyzer/ConstructorArgumentChecker.php delete mode 100644 tools/lsp/src/Analyzer/Diagnostic.php delete mode 100644 tools/lsp/src/Analyzer/DiagnosticCode.php delete mode 100644 tools/lsp/src/Analyzer/DiagnosticSeverity.php delete mode 100644 tools/lsp/src/Analyzer/ParseResult.php delete mode 100644 tools/lsp/src/Analyzer/ParsedDocumentCache.php delete mode 100644 tools/lsp/src/Analyzer/ParsedDocumentCacheWarmer.php delete mode 100644 tools/lsp/src/Analyzer/WorkspaceAnalyzer.php delete mode 100644 tools/lsp/src/Diagnostics/DiagnosticTranslator.php delete mode 100644 tools/lsp/src/Diagnostics/XphpDiagnosticsProvider.php delete mode 100644 tools/lsp/src/Dispatcher/LspObjectArgumentResolver.php delete mode 100644 tools/lsp/src/Handler/AstPositionResolver.php delete mode 100644 tools/lsp/src/Handler/SemanticTokens/AstVisitor.php delete mode 100644 tools/lsp/src/Handler/SemanticTokens/Encoder.php delete mode 100644 tools/lsp/src/Handler/SemanticTokens/TokenLegend.php delete mode 100644 tools/lsp/src/Handler/SemanticTokens/TokenSpec.php delete mode 100644 tools/lsp/src/Handler/TypeArgPositionDetector.php delete mode 100644 tools/lsp/src/Handler/WorkspaceSymbols.php delete mode 100644 tools/lsp/src/Handler/XphpCallHierarchyHandler.php delete mode 100644 tools/lsp/src/Handler/XphpCodeActionHandler.php delete mode 100644 tools/lsp/src/Handler/XphpCodeActionResolveHandler.php delete mode 100644 tools/lsp/src/Handler/XphpCodeLensHandler.php delete mode 100644 tools/lsp/src/Handler/XphpCompletionHandler.php delete mode 100644 tools/lsp/src/Handler/XphpCompletionResolveHandler.php delete mode 100644 tools/lsp/src/Handler/XphpDefinitionHandler.php delete mode 100644 tools/lsp/src/Handler/XphpDocumentHighlightHandler.php delete mode 100644 tools/lsp/src/Handler/XphpDocumentSymbolHandler.php delete mode 100644 tools/lsp/src/Handler/XphpFileWatcherHandler.php delete mode 100644 tools/lsp/src/Handler/XphpFoldingRangeHandler.php delete mode 100644 tools/lsp/src/Handler/XphpHoverHandler.php delete mode 100644 tools/lsp/src/Handler/XphpImplementationHandler.php delete mode 100644 tools/lsp/src/Handler/XphpInlayHintHandler.php delete mode 100644 tools/lsp/src/Handler/XphpPullDiagnosticsHandler.php delete mode 100644 tools/lsp/src/Handler/XphpReferencesHandler.php delete mode 100644 tools/lsp/src/Handler/XphpRenameHandler.php delete mode 100644 tools/lsp/src/Handler/XphpSemanticTokensHandler.php delete mode 100644 tools/lsp/src/Handler/XphpSignatureHelpHandler.php delete mode 100644 tools/lsp/src/Handler/XphpTextDocumentHandler.php delete mode 100644 tools/lsp/src/Handler/XphpTypeDefinitionHandler.php delete mode 100644 tools/lsp/src/Handler/XphpTypeHierarchyHandler.php delete mode 100644 tools/lsp/src/Handler/XphpWillRenameFilesHandler.php delete mode 100644 tools/lsp/src/Handler/XphpWorkspaceSymbolHandler.php delete mode 100644 tools/lsp/src/LspDispatcherFactory.php delete mode 100644 tools/lsp/src/PositionMap.php delete mode 100644 tools/lsp/src/Reflection/FilesystemSourceLocator.php delete mode 100644 tools/lsp/src/Reflection/FqnIndex.php delete mode 100644 tools/lsp/src/Reflection/FqnIndexWarmer.php delete mode 100644 tools/lsp/src/Reflection/ReflectorFactory.php delete mode 100644 tools/lsp/src/Reflection/WorkspaceSourceLocator.php delete mode 100644 tools/lsp/src/Resolver/ClassFqnPredicate.php delete mode 100644 tools/lsp/src/Resolver/ClassLikeLookup.php delete mode 100644 tools/lsp/src/Resolver/ClassNameImportContext.php delete mode 100644 tools/lsp/src/Resolver/CompletionIndex.php delete mode 100644 tools/lsp/src/Resolver/CompositeClassLikeLookup.php delete mode 100644 tools/lsp/src/Resolver/DiagnosticCodeActionProvider.php delete mode 100644 tools/lsp/src/Resolver/FilesystemClassLikeLookup.php delete mode 100644 tools/lsp/src/Resolver/GenericParamRegistry.php delete mode 100644 tools/lsp/src/Resolver/GenericResolver.php delete mode 100644 tools/lsp/src/Resolver/ImportCodeActionProvider.php delete mode 100644 tools/lsp/src/Resolver/InvalidRenameNameException.php delete mode 100644 tools/lsp/src/Resolver/MethodCallSubstitution.php delete mode 100644 tools/lsp/src/Resolver/NamespaceMoveProvider.php delete mode 100644 tools/lsp/src/Resolver/OptimizeImportsCodeActionProvider.php delete mode 100644 tools/lsp/src/Resolver/PhpCompletionContext.php delete mode 100644 tools/lsp/src/Resolver/PhpCompletionResolver.php delete mode 100644 tools/lsp/src/Resolver/PhpDefinitionResolver.php delete mode 100644 tools/lsp/src/Resolver/PhpHoverResolver.php delete mode 100644 tools/lsp/src/Resolver/ReferenceFinder.php delete mode 100644 tools/lsp/src/Resolver/RenameProvider.php delete mode 100644 tools/lsp/src/Resolver/ResolvedType.php delete mode 100644 tools/lsp/src/Resolver/StubsIndex.php delete mode 100644 tools/lsp/src/Resolver/TypeUnionSplitter.php delete mode 100644 tools/lsp/src/Resolver/VarBinding.php delete mode 100644 tools/lsp/src/Resolver/WorkspaceClassLikeLookup.php delete mode 100644 tools/lsp/src/Server.php delete mode 100644 tools/lsp/src/Stderr.php delete mode 100644 tools/lsp/test/Analyzer/AnalyzerTest.php delete mode 100644 tools/lsp/test/Analyzer/ConstructorArgumentCheckerTest.php delete mode 100644 tools/lsp/test/Analyzer/DiagnosticCodeTest.php delete mode 100644 tools/lsp/test/Analyzer/ParsedDocumentCacheTest.php delete mode 100644 tools/lsp/test/Analyzer/ParsedDocumentCacheWarmerTest.php delete mode 100644 tools/lsp/test/Analyzer/WorkspaceAnalyzerTest.php delete mode 100644 tools/lsp/test/Diagnostics/XphpDiagnosticsProviderTest.php delete mode 100644 tools/lsp/test/Dispatcher/LspObjectArgumentResolverTest.php delete mode 100644 tools/lsp/test/Handler/AstPositionResolverTest.php delete mode 100644 tools/lsp/test/Handler/SemanticTokens/AstVisitorTest.php delete mode 100644 tools/lsp/test/Handler/SemanticTokens/EncoderTest.php delete mode 100644 tools/lsp/test/Handler/SemanticTokens/TokenLegendTest.php delete mode 100644 tools/lsp/test/Handler/TypeArgPositionDetectorTest.php delete mode 100644 tools/lsp/test/Handler/WorkspaceSymbolsTest.php delete mode 100644 tools/lsp/test/Handler/XphpCallHierarchyHandlerTest.php delete mode 100644 tools/lsp/test/Handler/XphpCodeActionHandlerTest.php delete mode 100644 tools/lsp/test/Handler/XphpCodeLensHandlerTest.php delete mode 100644 tools/lsp/test/Handler/XphpCompletionHandlerTest.php delete mode 100644 tools/lsp/test/Handler/XphpCompletionResolveHandlerTest.php delete mode 100644 tools/lsp/test/Handler/XphpDefinitionHandlerTest.php delete mode 100644 tools/lsp/test/Handler/XphpDocumentHighlightHandlerTest.php delete mode 100644 tools/lsp/test/Handler/XphpDocumentSymbolHandlerTest.php delete mode 100644 tools/lsp/test/Handler/XphpFileWatcherHandlerTest.php delete mode 100644 tools/lsp/test/Handler/XphpFoldingRangeHandlerTest.php delete mode 100644 tools/lsp/test/Handler/XphpHoverHandlerTest.php delete mode 100644 tools/lsp/test/Handler/XphpImplementationHandlerTest.php delete mode 100644 tools/lsp/test/Handler/XphpInlayHintHandlerTest.php delete mode 100644 tools/lsp/test/Handler/XphpPullDiagnosticsHandlerTest.php delete mode 100644 tools/lsp/test/Handler/XphpReferencesHandlerTest.php delete mode 100644 tools/lsp/test/Handler/XphpRenameHandlerTest.php delete mode 100644 tools/lsp/test/Handler/XphpSemanticTokensHandlerTest.php delete mode 100644 tools/lsp/test/Handler/XphpSignatureHelpHandlerTest.php delete mode 100644 tools/lsp/test/Handler/XphpTextDocumentHandlerTest.php delete mode 100644 tools/lsp/test/Handler/XphpTypeDefinitionHandlerTest.php delete mode 100644 tools/lsp/test/Handler/XphpTypeHierarchyHandlerTest.php delete mode 100644 tools/lsp/test/Handler/XphpWillRenameFilesHandlerTest.php delete mode 100644 tools/lsp/test/Handler/XphpWorkspaceSymbolHandlerTest.php delete mode 100644 tools/lsp/test/LspDispatcherFactoryTest.php delete mode 100644 tools/lsp/test/PositionMapTest.php delete mode 100644 tools/lsp/test/Reflection/FilesystemSourceLocatorTest.php delete mode 100644 tools/lsp/test/Reflection/FqnIndexTest.php delete mode 100644 tools/lsp/test/Reflection/FqnIndexWarmerTest.php delete mode 100644 tools/lsp/test/Reflection/ReflectorFactoryTest.php delete mode 100644 tools/lsp/test/Reflection/WorkspaceSourceLocatorTest.php delete mode 100644 tools/lsp/test/Resolver/ClassFqnPredicateTest.php delete mode 100644 tools/lsp/test/Resolver/ClassNameImportContextTest.php delete mode 100644 tools/lsp/test/Resolver/CompletionIndexTest.php delete mode 100644 tools/lsp/test/Resolver/CompositeClassLikeLookupTest.php delete mode 100644 tools/lsp/test/Resolver/DiagnosticCodeActionProviderTest.php delete mode 100644 tools/lsp/test/Resolver/FilesystemClassLikeLookupTest.php delete mode 100644 tools/lsp/test/Resolver/GenericParamRegistryTest.php delete mode 100644 tools/lsp/test/Resolver/GenericResolverTest.php delete mode 100644 tools/lsp/test/Resolver/ImportCodeActionProviderTest.php delete mode 100644 tools/lsp/test/Resolver/OptimizeImportsCodeActionProviderTest.php delete mode 100644 tools/lsp/test/Resolver/PhpCompletionContextTest.php delete mode 100644 tools/lsp/test/Resolver/PhpCompletionResolverTest.php delete mode 100644 tools/lsp/test/Resolver/PhpDefinitionResolverTest.php delete mode 100644 tools/lsp/test/Resolver/PhpHoverResolverTest.php delete mode 100644 tools/lsp/test/Resolver/StubsIndexTest.php delete mode 100644 tools/lsp/test/Resolver/TypeUnionSplitterTest.php delete mode 100644 tools/lsp/test/StderrTest.php delete mode 100644 tools/lsp/test/bootstrap.php delete mode 100755 tools/lsp/var/xphp-lsp.phar delete mode 100644 tools/phpstorm-plugin/.gitignore delete mode 100644 tools/phpstorm-plugin/Makefile delete mode 100644 tools/phpstorm-plugin/README.md delete mode 100644 tools/phpstorm-plugin/build.gradle.kts delete mode 100644 tools/phpstorm-plugin/docs/roadmap.md delete mode 100644 tools/phpstorm-plugin/gradle.properties delete mode 100644 tools/phpstorm-plugin/gradle/wrapper/gradle-wrapper.jar delete mode 100644 tools/phpstorm-plugin/gradle/wrapper/gradle-wrapper.properties delete mode 100755 tools/phpstorm-plugin/gradlew delete mode 100644 tools/phpstorm-plugin/gradlew.bat delete mode 100644 tools/phpstorm-plugin/settings.gradle.kts delete mode 100644 tools/phpstorm-plugin/src/main/kotlin/com/xphp/lsp/PharExtractor.kt delete mode 100644 tools/phpstorm-plugin/src/main/kotlin/com/xphp/lsp/XphpClassFileSync.kt delete mode 100644 tools/phpstorm-plugin/src/main/kotlin/com/xphp/lsp/XphpFileRenameListener.kt delete mode 100644 tools/phpstorm-plugin/src/main/kotlin/com/xphp/lsp/XphpLspServerDescriptor.kt delete mode 100644 tools/phpstorm-plugin/src/main/kotlin/com/xphp/lsp/XphpLspServerSupportProvider.kt delete mode 100644 tools/phpstorm-plugin/src/main/kotlin/com/xphp/lsp/XphpShowReferencesCommandsSupport.kt delete mode 100644 tools/phpstorm-plugin/src/main/kotlin/com/xphp/lsp/settings/XphpSettings.kt delete mode 100644 tools/phpstorm-plugin/src/main/kotlin/com/xphp/lsp/settings/XphpSettingsConfigurable.kt delete mode 100644 tools/phpstorm-plugin/src/main/kotlin/com/xphp/lsp/textmate/XphpBundleRegistrar.kt delete mode 100644 tools/phpstorm-plugin/src/main/resources/META-INF/plugin.xml delete mode 100644 tools/phpstorm-plugin/src/test/kotlin/com/xphp/lsp/PharExtractorTest.kt delete mode 100644 tools/phpstorm-plugin/src/test/kotlin/com/xphp/lsp/textmate/XphpBundleRegistrarTest.kt delete mode 100644 tools/vscode-extension/.gitignore delete mode 100644 tools/vscode-extension/.vscode/launch.json delete mode 100644 tools/vscode-extension/.vscode/tasks.json delete mode 100644 tools/vscode-extension/Makefile delete mode 100644 tools/vscode-extension/README.md delete mode 100644 tools/vscode-extension/language-configuration.json delete mode 100644 tools/vscode-extension/package.json delete mode 100644 tools/vscode-extension/src/extension.ts delete mode 100644 tools/vscode-extension/syntaxes/xphp.tmLanguage.json delete mode 100644 tools/vscode-extension/tsconfig.json diff --git a/.github/workflows/ci-core.yml b/.github/workflows/ci-core.yml index 82992b7..867453d 100644 --- a/.github/workflows/ci-core.yml +++ b/.github/workflows/ci-core.yml @@ -30,11 +30,9 @@ jobs: - name: Install dependencies uses: ramsey/composer-install@v3 - with: - working-directory: core - name: Run PHPUnit - run: make -C core test/unit + run: make test/unit infection: name: Mutation testing @@ -53,13 +51,11 @@ jobs: - name: Install dependencies uses: ramsey/composer-install@v3 - with: - working-directory: core - name: Run Infection # --min-covered-msi=95 fails CI if the mutation score drops below # the gate. Threads=max parallelises mutant runs. - run: make -C core test/mutation + run: make test/mutation - name: Upload Infection report if: always() @@ -67,7 +63,7 @@ jobs: with: name: infection-report path: | - core/var/infection.log - core/var/infection.html + var/infection.log + var/infection.html if-no-files-found: ignore retention-days: 14 diff --git a/.github/workflows/ci-lsp.yml b/.github/workflows/ci-lsp.yml deleted file mode 100644 index 55169cb..0000000 --- a/.github/workflows/ci-lsp.yml +++ /dev/null @@ -1,94 +0,0 @@ -name: LSP CI - -# PHPUnit runs on every PR + push to main as a hard gate. -# Infection (mutation testing) is opt-in via workflow_dispatch -- its -# resource envelope outgrew GitHub-hosted `ubuntu-latest` (~7 GB RAM) -# once the suite passed ~150 tests, and the initial coverage run now -# OOMs as SIGTERM 143 mid-stream. Re-enable as a PR gate once the -# job is reshaped to filter / batch the test set (see follow-up). -on: - pull_request: - push: - branches: [main] - workflow_dispatch: - -# Per-workflow concurrency. See ci-core.yml for the rationale. -concurrency: - group: ci-${{ github.workflow }}-${{ github.ref }} - cancel-in-progress: true - -jobs: - phpunit-lsp: - name: PHPUnit (LSP) - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v4 - - - name: Setup PHP 8.4 - uses: shivammathur/setup-php@v2 - with: - php-version: '8.4' - extensions: dom, json, mbstring, tokenizer - coverage: none - tools: composer:v2 - - # The LSP package has its own composer.json under tools/lsp/ with a - # path-repo pointing back at the repo root. Cache its deps separately - # from the core install so a core-only change doesn't bust the LSP cache. - - name: Install LSP dependencies - uses: ramsey/composer-install@v3 - with: - working-directory: tools/lsp - - - name: Run PHPUnit (LSP) - run: make -C tools/lsp test - - infection-lsp: - name: Mutation testing (LSP) - # Gate: only run when explicitly requested via the Actions tab. The - # 424-test suite plus per-mutation reruns overruns the GitHub-hosted - # runner's RAM, killing the initial coverage subprocess with SIGTERM - # 143. PRs and merges to main get fast unambiguous signal from the - # PHPUnit job above; Infection scoring is opt-in until the job is - # reshaped to filter / batch the test set. - if: github.event_name == 'workflow_dispatch' - runs-on: ubuntu-latest - needs: phpunit-lsp - steps: - - uses: actions/checkout@v4 - - - name: Setup PHP 8.4 (with PCOV for coverage) - # PCOV is preferred over Xdebug for Infection's initial run: an - # order of magnitude less memory under the same coverage scope, - # which keeps the runner well clear of the OOM-killer. The - # Makefile target sets pcov.directory + XDEBUG_MODE=off so the - # driver choice is deterministic regardless of what else is loaded. - uses: shivammathur/setup-php@v2 - with: - php-version: '8.4' - extensions: dom, json, mbstring, tokenizer - coverage: pcov - tools: composer:v2 - - - name: Install LSP dependencies - uses: ramsey/composer-install@v3 - with: - working-directory: tools/lsp - - - name: Run Infection (LSP) - # `make -C tools/lsp test/mutation` lazily downloads infection.phar - # 0.33.1 into tools/lsp/var/ (PHAR sidesteps the composer dep conflict - # with phpactor/language-server documented in tools/lsp/README.md). - # Runs with --min-covered-msi=93; current baseline is 94%. - run: make -C tools/lsp test/mutation - - - name: Upload Infection report (LSP) - if: always() - uses: actions/upload-artifact@v4 - with: - name: infection-lsp-report - path: | - tools/lsp/var/infection.log - tools/lsp/var/infection.html - if-no-files-found: ignore - retention-days: 14 diff --git a/.github/workflows/ci-phpstorm-plugin.yml b/.github/workflows/ci-phpstorm-plugin.yml deleted file mode 100644 index 7645b56..0000000 --- a/.github/workflows/ci-phpstorm-plugin.yml +++ /dev/null @@ -1,141 +0,0 @@ -name: PhpStorm Plugin CI - -on: - pull_request: - push: - branches: [main] - -# Per-workflow concurrency. See ci-core.yml for the rationale. -concurrency: - group: ci-${{ github.workflow }}-${{ github.ref }} - cancel-in-progress: true - -jobs: - gradle-build: - name: Gradle build (PhpStorm plugin) - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v4 - - # PHP + Composer are needed to build the bundled xphp-lsp.phar that - # processResources copies into the plugin jar at build time. Skipping - # this step would still produce a buildable plugin, but it would warn - # and ship without an embedded LSP -- defeating the zero-config - # install path we shipped in chunk 5. - - name: Setup PHP 8.4 - uses: shivammathur/setup-php@v2 - with: - php-version: '8.4' - extensions: dom, json, mbstring, tokenizer - coverage: none - tools: composer:v2 - - - name: Install LSP dependencies - uses: ramsey/composer-install@v3 - with: - working-directory: tools/lsp - - - name: Build xphp-lsp.phar - # Same target ci-lsp.yml's runtime relies on; the plugin's - # processResources picks this up from tools/lsp/var/. - run: make -C tools/lsp build/phar - - - name: Setup JDK 21 - uses: actions/setup-java@v4 - with: - distribution: temurin - java-version: '21' - - - name: Setup Gradle - uses: gradle/actions/setup-gradle@v4 - with: - # Cache key is built from the wrapper version + build script - # hash, so this stays warm across PRs that don't touch the plugin - # build config. - gradle-home-cache-cleanup: true - - - name: Build plugin (compile + test) - # `make build` from this directory is `./gradlew build`, which runs - # compileKotlin, test, and packages the plugin jar via the - # IntelliJ Platform Gradle Plugin's `composedJar` task. - run: make -C tools/phpstorm-plugin build - - - name: Upload plugin jar - uses: actions/upload-artifact@v4 - with: - name: xphp-phpstorm-plugin-jar - path: tools/phpstorm-plugin/build/libs/xphp-phpstorm-plugin-*.jar - if-no-files-found: error - retention-days: 14 - - - name: Upload test reports on failure - if: failure() - uses: actions/upload-artifact@v4 - with: - name: phpstorm-plugin-test-reports - path: | - tools/phpstorm-plugin/build/reports/tests/ - tools/phpstorm-plugin/build/test-results/ - if-no-files-found: ignore - retention-days: 14 - - verify-plugin: - name: Plugin Verifier (PhpStorm plugin) - runs-on: ubuntu-latest - needs: gradle-build - steps: - - uses: actions/checkout@v4 - - # The verifier itself doesn't read the PHAR, but Gradle's build graph - # treats `processResources` as a prerequisite of `verifyPlugin` -- - # and `processResources` declares xphp-lsp.phar as a required input - # via `inputs.file(...)` in build.gradle.kts. Without the PHAR on - # disk, the build aborts before the verifier even runs: - # - # property 'xphpLspPhar' specifies file '.../xphp-lsp.phar' - # which doesn't exist. - # - # So we rebuild the same PHAR the gradle-build job built. Both - # jobs sit on fresh runners; sharing via an artifact would also - # work but the PHAR rebuild is cheap (~2s) compared to the verifier - # downloading the IDE matrix that follows. - - name: Setup PHP 8.4 - uses: shivammathur/setup-php@v2 - with: - php-version: '8.4' - extensions: dom, json, mbstring, tokenizer - coverage: none - tools: composer:v2 - - - name: Install LSP dependencies - uses: ramsey/composer-install@v3 - with: - working-directory: tools/lsp - - - name: Build xphp-lsp.phar - run: make -C tools/lsp build/phar - - - name: Setup JDK 21 - uses: actions/setup-java@v4 - with: - distribution: temurin - java-version: '21' - - - name: Setup Gradle - uses: gradle/actions/setup-gradle@v4 - - - name: Run IntelliJ Plugin Verifier - # `verifyPlugin` checks binary compatibility across the IDE matrix - # declared in build.gradle.kts `pluginVerification.ides {}` -- the - # `recommended()` set for since-build 261. A failure here means a - # platform API we depend on changed shape between IDE builds. - run: make -C tools/phpstorm-plugin verify - - - name: Upload Plugin Verifier reports on failure - if: failure() - uses: actions/upload-artifact@v4 - with: - name: phpstorm-plugin-verifier-reports - path: tools/phpstorm-plugin/build/reports/pluginVerifier/ - if-no-files-found: ignore - retention-days: 14 diff --git a/.github/workflows/release-phpstorm-plugin.yml b/.github/workflows/release-phpstorm-plugin.yml deleted file mode 100644 index 5e31d43..0000000 --- a/.github/workflows/release-phpstorm-plugin.yml +++ /dev/null @@ -1,133 +0,0 @@ -name: PhpStorm Plugin Release - -# Two trigger modes, both supported: -# - automatic: push a tag like `v0.2.0` -> CI builds and uploads the zip -# - manual: run from the Actions tab with a tag input (the tag must -# already exist; the workflow checks out THAT ref so the build is -# reproducible against the committed code, not whatever HEAD is on -# the default branch at trigger time). -on: - workflow_dispatch: - inputs: - tag: - description: 'Existing tag to build (e.g. v0.1.0). Must already be pushed.' - required: true - type: string - -permissions: - # Required to create the Release and upload assets to it. Read-only - # checkout would otherwise fail when softprops/action-gh-release tries - # to POST to the releases API. - contents: write - -# Don't cancel a release mid-upload -- a half-uploaded asset is worse -# than a duplicate run. Concurrency group keys on the tag, so two tags -# released back-to-back don't collide. -concurrency: - group: release-phpstorm-plugin-${{ github.event.inputs.tag || github.ref_name }} - cancel-in-progress: false - -jobs: - release: - name: Build + publish PhpStorm plugin - runs-on: ubuntu-latest - steps: - - name: Resolve tag + version - id: tag - # On a push:tags trigger, GITHUB_REF is `refs/tags/v0.1.0`. - # On workflow_dispatch, the user-supplied input takes over. - # `version` is the tag minus the leading `v` so it threads - # straight into Gradle's pluginVersion (which has no v prefix). - run: | - if [[ "${{ github.event_name }}" == "workflow_dispatch" ]]; then - tag="${{ github.event.inputs.tag }}" - else - tag="${GITHUB_REF#refs/tags/}" - fi - if [[ ! "$tag" =~ ^v[0-9] ]]; then - echo "::error::tag '$tag' must start with 'v' followed by a digit (e.g. v0.1.0)" - exit 1 - fi - version="${tag#v}" - echo "tag=$tag" >> "$GITHUB_OUTPUT" - echo "version=$version" >> "$GITHUB_OUTPUT" - - - name: Checkout at tag - uses: actions/checkout@v4 - with: - ref: ${{ steps.tag.outputs.tag }} - fetch-depth: 1 - - - name: Setup PHP 8.4 - uses: shivammathur/setup-php@v2 - with: - php-version: '8.4' - extensions: dom, json, mbstring, tokenizer - coverage: none - tools: composer:v2 - - - name: Install LSP dependencies - uses: ramsey/composer-install@v3 - with: - working-directory: tools/lsp - - - name: Build bundled xphp-lsp.phar - # processResources copies var/xphp-lsp.phar into the plugin jar. - # Without this step the plugin ships without an embedded LSP and - # the user-facing zero-config install path breaks. - run: make -C tools/lsp build/phar - - - name: Setup JDK 21 - uses: actions/setup-java@v4 - with: - distribution: temurin - java-version: '21' - - - name: Setup Gradle - uses: gradle/actions/setup-gradle@v4 - - - name: Build plugin zip with tag-derived version - # -PpluginVersion overrides the gradle.properties default, so: - # - the produced zip is xphp-phpstorm-plugin-.zip - # - plugin.xml's matches the git tag - # - the JetBrains Marketplace update channel (if ever published) - # reads the tag-driven version, not a stale 0.1.0 - run: | - ./tools/phpstorm-plugin/gradlew \ - -p tools/phpstorm-plugin \ - buildPlugin \ - -PpluginVersion=${{ steps.tag.outputs.version }} - - - name: Locate built zip - id: zip - # `ls` produces a single match because Gradle emits exactly one - # zip per buildPlugin run. Fail loudly if the path doesn't - # match what we expected -- catches a Gradle config drift early. - run: | - path=$(ls tools/phpstorm-plugin/build/distributions/xphp-phpstorm-plugin-${{ steps.tag.outputs.version }}.zip) - if [[ ! -f "$path" ]]; then - echo "::error::zip not found at expected path" - ls -la tools/phpstorm-plugin/build/distributions/ || true - exit 1 - fi - echo "path=$path" >> "$GITHUB_OUTPUT" - echo "name=$(basename "$path")" >> "$GITHUB_OUTPUT" - - - name: Create release and upload zip - # softprops/action-gh-release creates the GitHub Release if it - # doesn't exist yet (push:tags case) and updates it idempotently - # on workflow_dispatch re-runs. `files:` uploads the zip as a - # release asset -- the resulting download URL is: - # https://github.com///releases/download// - # i.e. the tag appears in the URL path AND inside the asset - # filename (`...-.zip`), so the version is impossible - # to miss from either direction. - uses: softprops/action-gh-release@v2 - with: - tag_name: ${{ steps.tag.outputs.tag }} - name: ${{ steps.tag.outputs.tag }} - draft: false - prerelease: false - files: ${{ steps.zip.outputs.path }} - generate_release_notes: true - fail_on_unmatched_files: true diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index bf8fe2a..0ca9e17 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -1,191 +1,12 @@ # Contributing -## Monorepo layout - -The repository hosts the `xphp` language plus the tooling that grows around it. - -Every shippable artifact lives in its own sub-project with its own build system, -lockfile, tests, and CI workflow. The xphp compiler lives under `core/`; -satellites (LSP, PhpStorm plugin, etc.) live under `tools//`. - -``` -xphp-lang/ -+-- core/ # the xphp compiler -+-- docs/ # language-level documentation -+-- playground/ # demo workspace that depends on the core -+-- tools/ -| +-- lsp/ # Language Server (PHP, phpactor/language-server) -| +-- phpstorm-plugin/ # JetBrains plugin (Kotlin + Gradle) -| `-- vscode-extension/ # VS Code client (TypeScript) -+-- .github/workflows/ -| +-- ci-core.yml # phpunit + infection for core/ -` -- ci-.yml # one file per package under tools/ -``` - -The split is a single principle in disguise: **the core compiler is the -product; everything else is a way to consume it**. A package that depends on -the core's published behavior (LSP analyzing `.xphp` source, an editor plugin -spawning the LSP, a CI lint tool calling `bin/xphp`) is a tool. The core -itself never depends on external `xphp` tools. - -### Adding a new package - -The current shape was settled when `tools/lsp/` was a dded and validated when -through `tools/phpstorm-plugin/`. - -To add a tool: - -1. **Create the directory** under `tools//`. Pick a name that names the - thing concretely (`lsp`, `phpstorm-plugin`) rather than abstractly - (`server`, `editor-integration`). - -2. **Self-contained build**: each package owns its build system. The LSP has - `tools/lsp/composer.json`; the PhpStorm plugin has - `tools/phpstorm-plugin/build.gradle.kts` + `gradle.properties` (every - version pin lives there so a single edit propagates to since-build, - IDE target, Kotlin runtime, JVM toolchain). The root never collects - per-package dependencies. - -3. **Cross-package dependency on the core**: PHP packages do this via a - path-repo back to `core/`, the way `tools/lsp/composer.json` declares - `"xphp-lang/xphp": "@dev"` with `repositories: [{type: path, url: - "../../core/"}]`. Other languages need their own analog. The PhpStorm plugin - takes a different route: it doesn't compile against xphp at all -- it - spawns the LSP as a subprocess and bundles the LSP's pre-built PHAR - (via `processResources` copying `../lsp/var/xphp-lsp.phar`) into the - plugin jar at build time. That's the cleanest cross-package dependency - when the consumer doesn't actually need symbols from the dependency. - -4. **Per-package Makefile**: each package ships its own `Makefile` at - `tools//Makefile` with short, package-relative target names: - - ```make - test: # phpunit / gradle test / cargo test / ... - test/mutation: # if the package has a mutation surface - ``` - - Invoke from the repo root with `make -C tools/ ` or - directly from inside the package with `make `. The root - `Makefile` does NOT have pass-through targets — each Makefile is the - single source of truth for its package's recipes, no delegation - layer to drift. - -5. **Per-package CI workflow** at `.github/workflows/ci-.yml`. Mirror - the existing `ci-lsp.yml` or `ci-phpstorm-plugin.yml` shape: one - workflow per package, each with its own concurrency group, each - running unconditionally (no path filters — see the next section). - `ci-phpstorm-plugin.yml` doubles as the worked example for a package - whose CI needs **both** ecosystems (PHP to build the bundled PHAR, - then JDK + Gradle to build the plugin around it). - -6. **Add the package to the roadmap** - ([`docs/roadmap.md`](/docs/roadmap.md) Shipped → Tooling once it ships) - and consider a one-line entry in the [README](/README.md) pointing at - it. - -### CI: one workflow file per package, no path filters - -`.github/workflows/ci-core.yml`, `ci-lsp.yml`, and `ci-phpstorm-plugin.yml` -are parallel, independent workflows. Each runs on every PR and every push -to `main`. A new package gets a fourth file in the same shape. - -We deliberately **do not** path-filter workflows at the `on:` level. GitHub's -branch protection requires named status checks to actually run — a -path-filtered workflow that doesn't trigger on an unrelated change reports -"expected, never received" and blocks the merge. Running every workflow -every time costs a small amount of CI minutes (the jobs are parallel); the -alternative is a coordination tax with sharp edges. - -If CI minutes ever become a real concern, the fix is to add job-level `if:` -guards using `paths-filter` action results, NOT to add `paths:` at the -workflow level. Leave required status checks intact. - -## Testing - -### Unit tests +## Test ```bash -make test/unit -``` - -Most tests are pure unit tests against `XPHP\Transpiler\Monomorphize\*`. The -handful of **integration tests** compile a fixture under -`core/test/fixture/compile//` end-to-end and either assert on the emitted -text or autoload the result and call into it at runtime. Those -runtime tests have one isolation gotcha worth knowing before you add a new one. - -#### Cross-fixture class-table collisions - -`Registry::generatedFqn` (`core/src/Transpiler/Monomorphize/Registry.php`) names -every specialized class as: - +make test/unit # PHPUnit +make test/mutation # Infection, MSI under a 95 % gate ``` -XPHP\Generated\ \ T_ -└── namespace, mirrors template ─┘ └── hash of args ONLY ──┘ -``` - -The hash covers the **argument list**, not the template's own FQN — the -template's FQN is already encoded in the namespace path. That's deliberate and -right for a single compile: it collapses identical instantiations into one class -file. - -It bites in tests because **multiple fixtures redeclare the same template path -**. -Five fixtures define an `App\Containers\Box` (with subtly different bodies — -some -have a constructor, the `generic_interface` one implements `Container`, etc.) -and -all of them instantiate it with `App\Models\Plastic`. Same template path + same -arg means -same generated FQN: `XPHP\Generated\App\Containers\Box\T_de1e0eaa…`. The on-disk -files live in -different per-test work directories, but **PHP's class table is process-wide** — -once any -integration test `new`s up that FQN, PHP caches *that* body for the rest of the -phpunit run. -A later test loading from a different fixture's work dir gets the stale class. - -The failure mode is shape-dependent and the test ordering is randomized, so this -surfaces as an intermittent flake. Two known-good patterns to avoid it: - -1. **Reflection-only assertions** when you're verifying the structural - contract (an interface chain, an `implements` link, the type of a property) - rather than runtime behavior. - `ReflectionClass::implementsInterface($marker)`, `::getParentClass()`, - `(new ReflectionProperty($fqn, 'item'))->getType()->getName()` all read the - class metadata without depending on which body PHP's class table happens to - hold. - **Example** - `test/Transpiler/Monomorphize/CompilerIntegrationTest.php::testInstanceofAgainstOriginalTemplateMatchesAllSpecializations`. - -2. **Fixture-unique concrete types** when you legitimately need `new $fqn(...)` - at runtime. - Add a model class that's only declared inside your fixture (e.g. - `test/fixture/compile/generic_interface/source/Models/Polymer.xphp`) and - instantiate - against `Box`. Other fixtures don't redefine `Box`, so the - hash is - unique and PHP's class table can't cache a competing body. **Example:** - `test/Transpiler/Monomorphize/GenericInterfaceIntegrationTest.php::testSpecializedClassIsInstanceOfOriginalInterfaceMarker`. - -Rule of thumb: if your test does `new $generatedFqn(...)` and the concrete type -is `Plastic`, -`Metal`, `User`, `Food`, or any other name that already lives in another -fixture, switch to -one of the two patterns above before pushing — random-order CI will catch it -eventually, and -the diagnostic (`ArgumentCountError`, `instanceof returns false`) won't point at -the root -cause. - -### Mutation tests - -Mutation testing is the headline quality signal -- the test suite isn't just -covering lines, it's surviving deliberate -code perturbations. Run via [Infection](https://infection.github.io/): -The CI workflow runs Infection on every PR and every push to `main`, failing the -build if MSI drops below **95%**. -`infection.json5` carries a curated set of per-mutator `ignore` rules for -equivalent / cosmetic cases so the report only -surfaces genuine test gaps when they appear. \ No newline at end of file +CI gates every PR on both targets. `infection.json5` carries a curated set +of per-mutator `ignore` rules for genuinely-equivalent / defensive +mutations so the report only surfaces real test gaps. \ No newline at end of file diff --git a/core/Makefile b/Makefile similarity index 100% rename from core/Makefile rename to Makefile diff --git a/README.md b/README.md index 0aa482a..be26ebe 100644 --- a/README.md +++ b/README.md @@ -2,9 +2,11 @@ ## What it is -`xphp` is a superset of `php` that gives developers real generics, powered by -[monomorphization](https://en.wikipedia.org/wiki/Monomorphization) at compile -time. +`xphp` is a superset of `php` that gives developers real generics, +powered by [monomorphization](https://en.wikipedia.org/wiki/Monomorphization) at compile time. + +In a more inspirational mood, it is a fast lane for the `php` language, a bridge +between what developers need today and what `php` will support in the future. ## How it works @@ -17,22 +19,57 @@ better solutions. ## Ecosystem and community first -Ideally a project should first show how it works, but ecosystem and community -are too much important to be mentioned only at the bottom of the main document. -This project **CAN NOT** be successful without their support. - The single biggest asset of any programming language is the community and -ecosystem around it, much more than its syntax and features. We believe that -meeting a community where it is, respecting their culture, history and work -compounds far better than asking them to leave all of that behind. +ecosystem around it, much more than its syntax and features. -As `xphp` is simply a superset of `php`, existing `php` code can be easily -converted into `xphp` and `xphp` code can seamlessly consume `php` -- little to -zero effort either way. +We believe that meeting a community where it is, respecting their culture, +history and work compounds far better than asking them to leave all of that +behind. The design choice to compile to vanilla `php` is a deliberate commitment to -contribute to the `php` community and its ecosystem, **not** to compete against -them. +**contribute** to the `php` community and its ecosystem. + +## Principles + +Whenever we make an architectural decision, it must be supported by the +following non-negotiable principles: + +### 1. Zero Runtime Penalty + +Abstractions should not cost performance. By relying on monomorphization rather +than runtime reflection hacks, the output is plain `php` classes. `opcache` +likes that, and execution speed remains identical to handwritten, optimized +`php` code. + +### 2. Maximum Runtime Safety + +`xphp` bakes the types directly into the generated `php` code. If a boundary is +crossed or a third-party plain `php` library misuses your code, it triggers a +native `php` error. The runtime never lies. + +### 3. Progressive Enhancement + +It must play nicely with normal `php` codebases. A team should be able to write +a single `xphp` file in a `php` application, compile it, and use it seamlessly. + +No custom runtimes, no `HHVM` style ecosystem splits. + +### 4. Developer Experience + +The tooling must be fast and native as in every modern ecosystem. IDEs should +be able to read `xphp` files, while the `php` runtime happily consumes the +compiled `php` files. + +## Generics: the start, not the finish line + +Adding native generics to `php` -- a [long-awaited php feature](https://wiki.php.net/rfc/generics) -- +is genuinely [hard work](https://thephp.foundation/blog/2024/08/19/state-of-generics-and-collections/). + +The object model that's served the ecosystem for two decades doesn't bend easily. + +Supporting generics proves that the compile-to-vanilla model handles non-trivial +type-system additions. The remaining features are on the [roadmap](docs/roadmap.md): +type aliases, literal types, mapped and conditional types to name a few. ## Getting started @@ -166,48 +203,6 @@ Meaning every place where generics are declared or used is converted into normal └── composer.json # PSR-4: XPHP\Generated\ => /Generated/ ``` -## Principles - -Whenever we make an architectural decision, it must be supported by the -following non-negotiable principles: - -### 1. Zero Runtime Penalty - -Abstractions should not cost performance. By relying on monomorphization rather -than runtime reflection hacks, the output is plain `php` classes. `opcache` -likes that, and execution speed remains identical to handwritten, optimized -`php` code. - -### 2. Maximum Runtime Safety - -`xphp` bakes the types directly into the generated `php` code. If a boundary is -crossed or a third-party plain `php` library misuses your code, it triggers a -native `php` error. The runtime never lies. - -### 3. Progressive Enhancement - -It must play nicely with normal `php` codebases. A team should be able to write -a single `xphp` file in a `php` application, compile it, and use it seamlessly. - -No custom runtimes, no `HHVM` style ecosystem splits. - -### 4. Developer Experience - -The tooling must be fast and native as every modern ecosystem. IDEs should -be able to read `xphp` files, while the `php` runtime happily consumes the -compiled `php` files. - -## Generics: the start, not the finish line - -Adding native generics to `php` -- a [long-awaited php feature](https://wiki.php.net/rfc/generics) -- -is genuinely [hard work](https://thephp.foundation/blog/2024/08/19/state-of-generics-and-collections/). - -The object model that's served the ecosystem for two decades doesn't bend easily. - -Supporting generics proves that the compile-to-vanilla model handles non-trivial -type-system additions. The remaining features are on the [roadmap](docs/roadmap.md): -type aliases, literal types, mapped and conditional types to name a few. - ## See also - [Type-system comparison](core/docs/type-system/comparison.md) diff --git a/core/bin/xphp b/bin/xphp similarity index 100% rename from core/bin/xphp rename to bin/xphp diff --git a/core/composer.json b/composer.json similarity index 100% rename from core/composer.json rename to composer.json diff --git a/core/composer.lock b/composer.lock similarity index 100% rename from core/composer.lock rename to composer.lock diff --git a/core/CONTRIBUTING.md b/core/CONTRIBUTING.md deleted file mode 100644 index 0ca9e17..0000000 --- a/core/CONTRIBUTING.md +++ /dev/null @@ -1,12 +0,0 @@ -# Contributing - -## Test - -```bash -make test/unit # PHPUnit -make test/mutation # Infection, MSI under a 95 % gate -``` - -CI gates every PR on both targets. `infection.json5` carries a curated set -of per-mutator `ignore` rules for genuinely-equivalent / defensive -mutations so the report only surfaces real test gaps. \ No newline at end of file diff --git a/core/README.md b/core/README.md deleted file mode 100644 index 7221caf..0000000 --- a/core/README.md +++ /dev/null @@ -1,55 +0,0 @@ -# xphp core - -This is the package downstream `xphp` tools consume. e.g. LSP, PhpStorm plugin -and VSCode extension. - -It contains an ahead-of-time compiler that converts `xphp` source into normal -`php` code compatible with `PSR-4`. It's installed as a `--dev` package, -**no need** for additional runtime packages. - -## Status - -The following features are already supported: - -- Single-parameter generics (`class Box`) -- Multi-parameter generics (`Pair`, any arity) -- Nested generics at arbitrary depth (`Box>`) -- Type-hint positions everywhere (param / return / property / `new`) -- Transitive fixed-point specialization (16-iteration depth cap) -- Generic interfaces (`interface Container`) -- Generic traits as templates (dropped after specialization) -- Method-scoped generics (`function NAME(...)` inside a class; static calls) -- Free generic functions (`function NAME(...)` at namespace scope) -- Type-parameter bounds (`class Box`) -- `instanceof` against the original template (marker interface) -- Collision-safe generated FQCN (`XPHP\Generated\