GithubHelp home page GithubHelp logo

php7backport's People

Contributors

athorcis avatar mihaeu avatar vrana avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

Forkers

vrana ronmi mihaeu

php7backport's Issues

Some Warning and a Fatal Error

I cloned the repo into the Composer/vendor folder. I run on Command Prompt

php converter.php "C:/User/..../..../ Php7CodeFolder" "C:/Users/.../..../Php5CodeFolder"

It give me some "Warning" -->

mkdir(): Invalid argument in C:\Users..........\Composer\vendor\php7backport\src\Bouda\Php7Backport\DirectoryBackporter.php on line 31

and a "Fatal Error" -->

Uncaught Error: Class 'PhpParser\Lexer\Emulative' not found in C:\Users.........\Composer\vendor\php7backport\src\Bouda\Php7Backport\Backporter.php:21

I don't understand why and how to resolve these errors.

Can you give me some help?

TODO

  • return changed node from visitor - problem with constructors, where the input node is class, but changed node is ClassMethod
  • better handling of invalidating nodes - post traversal maybe?
  • fix situation, when a node changes twice (e.g. constructor + return type) - then only one of them renders

Directory not created before file_put_contents in PHP 5.6 when running convert.php

Source files to be converted:

  • src/A.php
  • src/B/B.php

Command I use:

php convert.php src /tmp

It will produce warning like: file_put_contents(/tmp/B/B.php): failed to open stream: No such file or directory

By adding var_dump($file); to DirectoryBackporter.php Line 28, it dumps src/A.php, src/B/B.php, src/B. So the order is not what we expected.

I made some change to DirectoryBackporter.php, which can fix this bug in 5.6. I can send you PR if you think my code is okay to use.

Change to PHP 7.1

Hey there,

thanks for your work!

I just noticed that you're not using PHP 7 for the project's source code. Would you consider a PR adding PHP 7 features and a backported version for users of old versions (branch or phar)?

Cheers,
Mike

Generated identifiers are unique only within one source file

Identifiers used for generated names (e.g. anonymous classes) use sequence which is reset for each converted file. Conflicts could arise.

Proposed solution: add some kind of hash to the generated name (hashed source file maybe?) to ensure uniqueness

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.