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

PHPCodesniffer errors in Atom #104

Open
jdelia opened this issue May 29, 2017 · 6 comments
Open

PHPCodesniffer errors in Atom #104

jdelia opened this issue May 29, 2017 · 6 comments

Comments

@jdelia
Copy link
Collaborator

jdelia commented May 29, 2017

Not sure why, but I am receiving these errors only on Utility Pro project in Atom. Other projects I have set up are okay.

https://cl.ly/221C1c0P3o2n

Any ideas @GaryJones ?

@GaryJones
Copy link
Collaborator

This section is only supported in WPCS 0.12.0. The latest release is 0.11.0, but I run the develop branch of WPCS, so don't get any errors. Chances are, 0.12.0 should be out before UP 2, but if not, we can delete that section before release.

See https://github.com/WordPress-Coding-Standards/WordPress-Coding-Standards/wiki/Customizable-sniff-properties#naming-conventions-prefix-everything-in-the-global-namespace

@jdelia
Copy link
Collaborator Author

jdelia commented May 29, 2017

Thanks @GaryJones

@jdelia
Copy link
Collaborator Author

jdelia commented May 29, 2017

@GaryJones what version of PHP_CodeSniffer are you running?

@GaryJones
Copy link
Collaborator

2.9.0

@jdelia
Copy link
Collaborator Author

jdelia commented May 29, 2017

I am on 2.9.1 and after updating to WPCS 0.12.0 - this is the only error I receive:

Error running PHPCS Error: PHP Fatal error: Uncaught Error: Call to undefined function did_action() in /Users/loneduchess/Local Sites/utility-pro-2/app/public/wp-content/themes/utility-pro/vendor/tgmpa/tgm-plugin-activation/class-tgm-plugin-activation.php:2109(…)

https://cl.ly/220g3f3w2A0T

@GaryJones
Copy link
Collaborator

GaryJones commented May 29, 2017

@jdelia

We're trying to fix that in TGMPA.

Add the following to the top of it the TGMPA class file:

// Exit if accessed directly.
if ( ! defined( 'ABSPATH' ) ) {
	return;
}

See https://github.com/TGMPA/TGM-Plugin-Activation/blob/9f63adeb10dcadd8733757e5c9c23e137cc8faff/class-tgm-plugin-activation.php#L35-L38 and TGMPA/TGM-Plugin-Activation#665

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants