Download the PHP package riverwaysoft/php-converter without Composer

On this page you can find all versions of the php package riverwaysoft/php-converter. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package php-converter

php-converter Latest Version on Packagist Tests PHPStan Total Downloads

Screen Shot 2022-10-07 at 09 04 35

Generates TypeScript & Dart out of your PHP DTO classes.

Why?

Statically typed languages like TypeScript or Dart are great because they allow catching bugs without even running your code. But unless there are well-defined contracts between the API and consumer apps, you may find yourself frequently adjusting outdated typings whenever the API changes. This library generates types for you, enabling you to move faster and encounter fewer bugs.

Requirements

PHP 8.0 or above

Quick start

1) Installation

If the installation leads to dependency conflicts, consider using the standalone Phar version of the package.

2) Mark a few classes with the #[Dto] annotation to convert them into TypeScript or Dart.

4) Run the CLI command to generate TypeScript

This will generate a file generated.ts with the following content:

Features

Customization

If you'd like to customize the conversion process, you need to copy the config script to your project folder:

Now you can customize this config and run the php-converter using the following script:

Documentation


All versions of php-converter with dependencies

PHP Build Version
Package Version
Requires php Version >=8.0
nikic/php-parser Version ^4.16
webmozart/assert Version ^1.10
jfcherng/php-diff Version ^6.10
jawira/case-converter Version ^3.4
phpstan/phpdoc-parser Version ^1.6
doctrine/inflector Version ^2.0
composer/xdebug-handler Version ^3.0
symfony/console Version ^5.3|^6.3|^6.2|^6.1|^7.0
symfony/filesystem Version ^5.3|^6.3|^6.2|^6.1|^7.0
symfony/process Version ^5.3|^6.3|^6.2|^6.1|^7.0
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package riverwaysoft/php-converter contains the following files

Collapse All

tools

  phar-composer-1.4.0.phar

.github

   workflows

    check_dart_snapshots.yml
    check_typescript_snapshots.yml
    php.yml
    static_analysis.yml

tests

   Ast

     __snapshots__
    ClassNameTest.php
    ConverterTest.php
    PhpDocTypeParserTest.php

   Bridge

     ApiPlatform

   Config

    PhpConverterConfigTest.php

   DiffRenderer

     __snapshots__
    DiffRendererTest.php

   Dto

    DtoTypeTest.php
    ExpressionTypeTest.php

   Filter

    AndFilterTest.php
    NotFilterTest.php

   OutputGenerator

     Fixtures
     __snapshots__
       GoGeneratorTest
         testDtoConstantDoesntThrow
         testNestedDtoConvert
         testNormalization
         testNormalizationDirectory
         testNormalizationWithCustomTypeResolvers
         testPhp81SuccessWhenBacked
         testUseTypeEnum
      TypeScriptGeneratorTest__testTypesWithApiClient__1.ts
      TypeScriptGeneratorTest__testTypesWithApiClientAndOverrideReturn__1.ts
      TypeScriptGeneratorTest__testPhp81SuccessWhenBacked__1.ts
      TypeScriptGeneratorTest__testNormalizationWithCustomTypeResolvers__1.ts
      TypeScriptGeneratorTest__testNormalizationTsDefault__2.ts
      TypeScriptGeneratorTest__testNormalizationTsDefault__1.json
      TypeScriptGeneratorTest__testNormalizationDirectory__2.ts
      TypeScriptGeneratorTest__testNormalizationDirectory__1.json
      TypeScriptGeneratorTest__testNestedDtoConvert__1.ts
      TypeScriptGeneratorTest__testEntityPerClassOutputWriterTypeScript__1.yml
      TypeScriptGeneratorTest__testGenericDtoWithArrayField__1.ts
      TypeScriptGeneratorTest__testDtoConstantDoesntThrow__1.ts
      TypeScriptGeneratorTest__testApiPlatformWithNewApiResource__1.ts
      TypeScriptGeneratorTest__testApiPlatformInput__2.ts
      TypeScriptGeneratorTest__testApiPlatformInput__1.ts
      TypeScriptGeneratorTest__testApiClientGenerationWithApiPlatformLegacyResource__1.ts
      GoGeneratorSimpleTest__testDart__1.go
      DartGeneratorTest__testEntityPerClassOutputWriterDart__1.yml
      DartGeneratorTest__testDart__1.dart
      DartGeneratorTest__testDartWithEquitableAndFactory__1.dart
      TypeScriptGeneratorTest__testUseTypeOverEnumTs__1.ts
    DartEnumValidatorTest.php
    DartGeneratorTest.php
    GoGeneratorSimpleTest.php
    GoGeneratorTest.php
    GoOutputGeneratorSimple.php
    TypeScriptGeneratorTest.php

   SnapshotComparator

    DartSnapshotComparator.php
    GoSnapshotComparator.php
    TypeScriptSnapshotComparator.php

src

   Ast

    ClassName.php
    Converter.php
    ConverterResult.php
    ConverterVisitor.php
    DtoVisitor.php
    PhpDocTypeParser.php
    UsageCollector.php

   Bridge

     ApiPlatform
     Symfony

   Cli

    ConvertCommand.php

   CodeProvider

    CodeProviderInterface.php
    FileSystemCodeProvider.php
    RemoteRepositoryCodeProvider.php

   Config

    PhpConverterConfig.php

   DiffRenderer

    DiffRenderer.php

   Dto

     ApiClient
     PhpType
    DtoClassProperty.php
    DtoEnumProperty.php
    DtoList.php
    DtoType.php
    ExpressionType.php

   Filter

     Attributes
     Combinators
    DocBlockFilter.php
    FilterInterface.php
    PhpAttributeFilter.php

   OutputGenerator

     Dart
     Go
     TypeScript
     UnknownTypeResolver
    ApiEndpointGeneratorInterface.php
    ImportGeneratorInterface.php
    OutputGeneratorInterface.php
    PropertyNameGeneratorInterface.php
    UnsupportedTypeException.php

   OutputWriter

     EntityPerClassOutputWriter
     OutputProcessor
     SingleFileOutputWriter
    OutputFile.php
    OutputWriterInterface.php

bin

  build.sh
  default-config.php
  php-converter

docker

  Dockerfile
  docker-compose.yml
  memory_limit.ini

docs

  class-filtering.md
  customize-output-generation.md
  development.md
  other-language-support.md
  standalone-installation.md
  troubleshooting.md
  unknown-type-resolvers.md
phpstan-baseline.neon
pubspec.yaml
pubspec.lock
phpunit.xml
phpstan.neon
phpstan-baseline.neon.php
ecs.php
package.json
package-lock.json
composer.json
README.md
Makefile
LICENSE
CONTRIBUTING.md
.gitignore
.editorconfig
tsconfig.json