Giter Site home page Giter Site logo

Comments (10)

szepeviktor avatar szepeviktor commented on August 21, 2024 1

...after a bit of thinking. Please try to talk to Elliot. Maybe he accepts a patch.

Last time I talked to him 🤣 he told me that applying my patch would fix all docblocks and he prefers fixing source code and docblocks at the same time, so he did not apply it.

from acf-pro-stubs.

szepeviktor avatar szepeviktor commented on August 21, 2024

Yes. This is not a selling point of ACF Pro, so these tags are slowly improving.
Please talk to Elliot as this is an automatically generated repo.

All I have is this.

# Remove determine_locale function
sed -i -e 's#^function determine_locale()$#//&#' "$FILE"
# - Make docblocks start with "/**"
# - Fix type and variable name order for @param
# - Remove remaining parentheses for @param
# - Fix type and variable name order for @return
# - Remove remaining parentheses for @return
# - Fix "void"
find . -type f -name "$FILE" -exec sed \
-e 's#^\(\s*/\*\)$#\1*#' \
-e 's#^\(\s*\*\s*@param\s\+\)\(\$\S\+\)\s\+(\(\S\+\))\(.*\)$#\1\3 \2\4#' \
-e 's#^\(\s*\*\s*@param\s\+\)(\(\S\+\))\(.*\)$#\1\2\3#' \
-e 's#^\(\s*\*\s*@return\s\+\)\(\$\S\+\)\s\+(\(\S\+\))\(.*\)$#\1\3 \2\4#' \
-e 's#^\(\s*\*\s*@return\s\+\)(\(\S\+\))\(.*\)$#\1\2\3#' \
-e 's#n/a#void#i' \
-i "{}" ";"

Related #8 and many more.

What do you suggest?

from acf-pro-stubs.

mundschenk-at avatar mundschenk-at commented on August 21, 2024

I don't really have a suggestion, I just noted that paulthewalton/acf-stubs was deprecated and it was advised to install php-stubs/acf-pro-stubs instead, but doing so resulted in invalid findings with PHPStan.

from acf-pro-stubs.

szepeviktor avatar szepeviktor commented on August 21, 2024

Yes, Paul did it with his hands, line by line.

I would be very happy if you figure out a mechanism to fix the docblock of daily used functions.

from acf-pro-stubs.

szepeviktor avatar szepeviktor commented on August 21, 2024

Yes, Paul did it with his hands, line by line.

No! My mistake. Paul also used giacocorsiglia/stubs-generator 3 years ago.

from acf-pro-stubs.

szepeviktor avatar szepeviktor commented on August 21, 2024

@mundschenk-at All right. Please provide me that one file (includes/fields.php) with fixed types in a secret gist and I figure out something.

from acf-pro-stubs.

szepeviktor avatar szepeviktor commented on August 21, 2024

@mundschenk-at Did a series of releases but still no improvement on "your" front.

Many docblocks have improved in v6.0.7...v6.1.0 but not in these reported functions.

from acf-pro-stubs.

crstauf avatar crstauf commented on August 21, 2024

Using acf()->fields->get_field_type() was recommended (#8 (comment)), but that throws an undefined property error.

from acf-pro-stubs.

szepeviktor avatar szepeviktor commented on August 21, 2024

You could download https://patch-diff.githubusercontent.com/raw/php-stubs/acf-pro-stubs/pull/8.patch and apply it as a patch.

from acf-pro-stubs.

crstauf avatar crstauf commented on August 21, 2024

Ended up using composer-patches:~1.0 to apply a patch (on composer install/update) to fix the return type of acf_get_field_type().

Generated the patch with this command:

git diff --no-index vendor/php-stubs/acf-pro-stubs/acf-pro-stubs.php.old vendor/php-stubs/acf-pro-stubs/acf-pro-stubs.php > dev/patches/acf-pro-stubs.patch

I tried using symplify/vendor-patches, but couldn't get the patch to apply.

from acf-pro-stubs.

Related Issues (5)

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.