Giter Site home page Giter Site logo

pre-plugin's People

Contributors

anibalsanchez avatar assertchris avatar halloffamer avatar ircmaxell avatar szepeviktor 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  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  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

pre-plugin's Issues

Use some cache ?

Hi!
As I think I've seen, the .pre files are recompiled each time the classes are called by autoloader, even in production.
I think it should be interesting to make a cache system to avoid recompiling for nothing at each call, or (even better imo) a build system with a command line (webpack/babel like) to compile all the files.

What are your thoughts about that?

Thanks for you amazing work.

Bug when using a VM or Docker containers.

Hi,
I have a bug with the implementation of macros.
I have some docker containers for my servers, and when I do a composer dump, the macros are registered with the wrong path ('PRE_BASE_DIR' is constructed with my local path, and not the servers one).

I have to execute composer from inside my containers (and I do not have composer in theses containers.

A rapid solution could be to put a relative path in the pre.macros file instead an absolute one.

PHP Fatal error: Cannot redeclare Pre\Plugin\find() (previously declared in ...

Hi,

I'm creating a new plugin. Testing the case on pre-trailing-commas, I've executed the command `composer dump-autoload --optimize' and produced the error. In some way, the helpers file is being included twice:

This is the output:

...../pre-trailing-commas$ composer update
Loading composer repositories with package information
Updating dependencies (including require-dev)
Package operations: 30 installs, 0 updates, 0 removals
  - Installing pre/plugin (0.11.3): Loading from cache
  - Installing sebastian/version (2.0.1): Loading from cache
  - Installing sebastian/resource-operations (1.0.0): Loading from cache
  - Installing sebastian/recursion-context (3.0.0): Loading from cache
  - Installing sebastian/object-reflector (1.1.1): Loading from cache
  - Installing sebastian/object-enumerator (3.0.3): Loading from cache
  - Installing sebastian/global-state (2.0.0): Loading from cache
  - Installing sebastian/exporter (3.1.0): Loading from cache
  - Installing sebastian/environment (3.1.0): Loading from cache
  - Installing sebastian/diff (2.0.1): Loading from cache
  - Installing sebastian/comparator (2.1.3): Loading from cache
  - Installing doctrine/instantiator (1.1.0): Loading from cache
  - Installing phpunit/php-text-template (1.2.1): Loading from cache
  - Installing phpunit/phpunit-mock-objects (5.0.10): Loading from cache
  - Installing phpunit/php-timer (1.0.9): Loading from cache
  - Installing phpunit/php-file-iterator (1.4.5): Loading from cache
  - Installing theseer/tokenizer (1.1.0): Loading from cache
  - Installing sebastian/code-unit-reverse-lookup (1.0.1): Loading from cache
  - Installing phpunit/php-token-stream (2.0.2): Loading from cache
  - Installing phpunit/php-code-coverage (5.3.2): Loading from cache
  - Installing symfony/polyfill-ctype (v1.10.0): Loading from cache
  - Installing webmozart/assert (1.4.0): Loading from cache
  - Installing phpdocumentor/reflection-common (1.0.1): Loading from cache
  - Installing phpdocumentor/type-resolver (0.4.0): Loading from cache
  - Installing phpdocumentor/reflection-docblock (4.3.0): Loading from cache
  - Installing phpspec/prophecy (1.8.0): Loading from cache
  - Installing phar-io/version (1.0.1): Loading from cache
  - Installing phar-io/manifest (1.0.1): Loading from cache
  - Installing myclabs/deep-copy (1.8.1): Loading from cache
  - Installing phpunit/phpunit (6.5.13): Loading from cache
sebastian/global-state suggests installing ext-uopz (*)
phpunit/phpunit suggests installing phpunit/php-invoker (^1.1)
Writing lock file
Generating autoload files
...../pre-trailing-commas$ composer dump-autoload --optimize
Generating optimized autoload files
PHP Fatal error:  Cannot redeclare Pre\Plugin\find() (previously declared in /home/...../pre-trailing-commas/vendor/pre/plugin/source/functions.php:5) in /home/...../pre-trailing-commas/vendor/pre/plugin/source/functions.php on line 22

Fatal error: Cannot redeclare Pre\Plugin\find() (previously declared in /home/...../pre-trailing-commas/vendor/pre/plugin/source/functions.php:5) in /home/...../pre-trailing-commas/vendor/pre/plugin/source/functions.php on line 22

Case <?php in the PHP script itself

The plugin assumes that <?php is not present in the script itself. If <?php is included in the file, at any point, the engine injects the macro.yay in the result.

You can verify the issue in this file, processing it with any plugin: https://github.com/symfony/translation/blob/master/Translator.php#L344

As a workaround, I've implemented in the caller a preprocessing of the text to escape <?php before the call. But, I think it has to be fixed in the engine to support any PHP script.

Update all Pre Macros to use the new sigil($) notation?

Seems that marcioAlmada's Yay library has already updated the master branch to use its new macro syntax, so I think it's time to refactor macros from pre library too? I see you are already doing this for Optional Catch and Trailing Comma too.

I have up-to-date macros for the other pre libraries myself, though I cant get the short-closure one to work properly. Are you interested in receiving these files? I can send them to your email, it will save you some work, while you can make some corrections if I've made a mistake. What do you think?

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.