Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added rgars() stub #1

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ Additionally, there are other various config changes to ignore errors, etc.
# Usage

Add to your Composer project that is already using PHPStan. This package is compatible with `phpstan/extension-installer`
so nothing outside of `composer require --dev "gravitywiz/phpstan"` is needed.
so nothing outside of `composer require --dev "gravitywiz/phpstan-gwiz"` is needed.

If you're not using `phpstan/extension-installer`, the files can be added to your `phpstan.neon` file manually by
adding them to `includes` like so:
Expand Down
1 change: 1 addition & 0 deletions gravityforms.neon
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
parameters:
stubFiles:
- stubs/gravityforms/rgar.stub
- stubs/gravityforms/rgars.stub
ignoreErrors:
-
# gf_apply_filters only specifies two params. It uses func_get_args()
Expand Down
17 changes: 17 additions & 0 deletions stubs/gravityforms/rgars.stub
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
<?php

/**
* Gets a specific property within a multidimensional array.
*
* @since Unknown
* @access public
*
* @param array $array|\ArrayAccess The array to search in.
* @param string|int $name The name of the property to find.
* @param mixed $default Optional. Value that should be returned if the property is not set or empty. Defaults to null.
*
* @return null|string|mixed The value

* @phpstan-ignore-next-line Issues with ArrayAccess
*/
function rgars( $array, $name, $default = null ) {}