Giter Club home page Giter Club logo

gravity-forms-stubs's People

Contributors

szepeviktor avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

gravity-forms-stubs's Issues

Stubs file is too big

Directory sizes

88  orders
92  system-status
96  legacy
96  query
108 locking
128 phpqrcode
320 settings
444 webapi
632 addon
672 splash-page
760 fields

Maybe distribute fields in a separate stubs file??

Preparing file list for generator

https://github.com/php-stubs/wordpress-stubs/blob/master/finder.php

@SebKay I think GF is a huge mess even compared to other products in the WordPress ecosystem.
In php-stubs org I follow a rule that deprecated and compatibility parts should be excluded from stubs.
There are class files with side-effects đŸ¤¯ new GFFormLocking(); ... and multiple classes in 1 file.
PHPStan on Level 0 says Found 131 errors

Could you look around in the GF plugin for included/excluded files/directories?

Downloading plugin ZIP in CI

https://gravityapi.com/wp-content/plugins/gravitymanager/api.php?op=get_plugin&slug=gravityforms&key=$PLUGIN_GF_KEY

the response is a serialized PHP array

$i=unserialize(stream_get_contents(STDIN));
echo $i["download_url"];

Signed URL: https://s3.amazonaws.com/gravityforms/releases/gravityforms_2.6.7.zip?....

signature and DocBlock for gf_apply_filters() is incorrect

I figure you generate the stubs in this package by running the PHP Stubs Generator on the latest GF code.

This is a difficult one. GF defines this function to only have 2 args ($filter and $value), which is reflected in the stub.

However, the function calls func_get_args() to get additional arguments (up to 9 of them). GF should change the function definition (and it's DocBlock) to use the variadic ... token. I don't know why they haven't done so.

For the time being, I have modified the stubs installed for one my GF addon plugins that calls gf_apply_filters() as be follows:

    /**
     * Gravity Forms pre-processing for apply_filters
     *
     * Allows additional filters based on form and field ID to be defined easily.
     *
     * @since  Unknown
     * @access public
     *
     * @param string|array $filter The name of the filter.
     * @param mixed $value The value to filter.
     * @param mixed ...$additional_args Additional arguments.
     *
     * @return mixed The filtered value.
     */
    function gf_apply_filters($filter, $value, ...$additional_args)
    {
    }

I'm sure it would be too much trouble for you to manually modify the generated stubs that you generate every time a new version of GF is released. But I just wanted to open this issue to raise the possibility.

How to contribute?

Hey @szepeviktor,

I was planning on attempting my own release of GF + extension stubs, but I'd much rather contribute to an existing /official project.
Is this repo something you're still working on (i see open issue, but no code), and if so how can I help?

README

@justlevine Please add a "thank you for the license" section to the top of README

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.