Ignoring unused parameter with code snifferThe method parameter $context is never usedMagento 2 module install error “data: current version - none, required version 2.0.0”Error during upgrade to Magento 2.1 from 2.0.7main.CRITICAL: Plugin class doesn't existMagento 2 | Component manager wont work after migrationWarning: “The method parameter $context is never used”I have created an extension to show Customer Company Name in Order grid. But when creating new order, order is not showing in order gridMagento offline custom Payment method with drop down listMagento2 Bluefoot Installation errorMagento 2 : Installing magento 2 code standards with code sniffer in ubuntuHow to change “input file” storage location in customer account edit form
What is the "ls" directory in my home directory?
In the US, can a former president run again?
Is declining an undergraduate award which causes me discomfort appropriate?
What is the oldest commercial MS-DOS program that can run on modern versions of Windows without third-party software?
Subtract the Folded Matrix
Should the party get XP for a monster they never attacked?
Why don't we have a weaning party like Avraham did?
Find the common ancestor between two nodes of a tree
Is the specular reflection on a polished gold sphere white or gold in colour?
Why do you need to heat the pan before heating the olive oil?
What is "industrial ethernet"?
What is the highest voltage from the power supply a Raspberry Pi 3 B can handle without getting damaged?
Warnings using NDSolve on wave PDE. "Using maximum number of grid points" , "Warning: scaled local spatial error estimate"
Is there any proof that high saturation and contrast makes a picture more appealing in social media?
Why does std::string_view create a dangling view in a ternary expression?
Syntax and semantics of XDV commands (XeTeX)
How can a warlock learn from a spellbook?
What are the pros and cons for the two possible "gear directions" when parking the car on a hill?
Extending prime numbers digit by digit while retaining primality
FD Battery Stations... How Do You Log?
Why does independence imply zero correlation?
Can Hunter's Mark be moved after Silence has been cast on a character?
Can i enter UK for 24 hours from a Schengen area holding an Indian passport?
How to remove stain from pavement after having dropped sulfuric acid on it?
Ignoring unused parameter with code sniffer
The method parameter $context is never usedMagento 2 module install error “data: current version - none, required version 2.0.0”Error during upgrade to Magento 2.1 from 2.0.7main.CRITICAL: Plugin class doesn't existMagento 2 | Component manager wont work after migrationWarning: “The method parameter $context is never used”I have created an extension to show Customer Company Name in Order grid. But when creating new order, order is not showing in order gridMagento offline custom Payment method with drop down listMagento2 Bluefoot Installation errorMagento 2 : Installing magento 2 code standards with code sniffer in ubuntuHow to change “input file” storage location in customer account edit form
.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty margin-bottom:0;
I'm running the codesniffer with the EcgM2 standard on my custom extension and I'm getting the warning
The method parameter
$contextis never used
for the InstallSchema.php file.
How can I make this warning go away?
My method looks like this (notice the SuppressWarnings at the top of it):
/**
* @inheritdoc
* @SuppressWarnings(PHPMD.ExcessiveMethodLength)
* @SuppressWarnings(PHPMD.UnusedFormalParameter)
*/
public function install(SchemaSetupInterface $setup, ModuleContextInterface $context)
//my install script here that does not use the parameter $context
magento2 coding-standards
add a comment |
I'm running the codesniffer with the EcgM2 standard on my custom extension and I'm getting the warning
The method parameter
$contextis never used
for the InstallSchema.php file.
How can I make this warning go away?
My method looks like this (notice the SuppressWarnings at the top of it):
/**
* @inheritdoc
* @SuppressWarnings(PHPMD.ExcessiveMethodLength)
* @SuppressWarnings(PHPMD.UnusedFormalParameter)
*/
public function install(SchemaSetupInterface $setup, ModuleContextInterface $context)
//my install script here that does not use the parameter $context
magento2 coding-standards
add a comment |
I'm running the codesniffer with the EcgM2 standard on my custom extension and I'm getting the warning
The method parameter
$contextis never used
for the InstallSchema.php file.
How can I make this warning go away?
My method looks like this (notice the SuppressWarnings at the top of it):
/**
* @inheritdoc
* @SuppressWarnings(PHPMD.ExcessiveMethodLength)
* @SuppressWarnings(PHPMD.UnusedFormalParameter)
*/
public function install(SchemaSetupInterface $setup, ModuleContextInterface $context)
//my install script here that does not use the parameter $context
magento2 coding-standards
I'm running the codesniffer with the EcgM2 standard on my custom extension and I'm getting the warning
The method parameter
$contextis never used
for the InstallSchema.php file.
How can I make this warning go away?
My method looks like this (notice the SuppressWarnings at the top of it):
/**
* @inheritdoc
* @SuppressWarnings(PHPMD.ExcessiveMethodLength)
* @SuppressWarnings(PHPMD.UnusedFormalParameter)
*/
public function install(SchemaSetupInterface $setup, ModuleContextInterface $context)
//my install script here that does not use the parameter $context
magento2 coding-standards
magento2 coding-standards
edited Jun 28 '16 at 13:25
Raphael at Digital Pianism
55.5k22130293
55.5k22130293
asked Jun 28 '16 at 13:09
Marius♦Marius
170k28329703
170k28329703
add a comment |
add a comment |
3 Answers
3
active
oldest
votes
I was able to hide the dirt under the rug like this:
// @codingStandardsIgnoreStart
public function install(SchemaSetupInterface $setup, ModuleContextInterface $context)
// @codingStandardsIgnoreEnd
....
I'm not proud of it, but it works.
adding the// @codingStandardsIgnoreEndbetween the method signature and the opening curly brace will cause a phpcs warning - phpcs: opening brace should be on the line after the declaration; found 1 blank line(s)
– Radu
Jun 11 at 14:05
right. it can be added after the opening bracket. I edited the answer.
– Marius♦
Jun 11 at 14:18
add a comment |
Update phpcs (squizlabs/PHP_CodeSniffer) to latest (v3.2.3 at 2017-03-06) and use like:
/**
* @inheritdoc
*/
// phpcs:ignore Generic.CodeAnalysis.UnusedFunctionParameter
public function install(SchemaSetupInterface $setup, ModuleContextInterface $context)
//my install script here that does not use the parameter $context
add a comment |
I'm pretty sure the suppress warning rule you will have to use is:
Generic.CodeAnalysis.UnusedFunctionParameter
So this should be the code to use in your PHP Docblock:
@SuppressWarnings(Generic.CodeAnalysis.UnusedFunctionParameter)
thanks for digging this up, but it has no effect
– Marius♦
Jun 28 '16 at 13:54
1
@Marius hmm that's annoying
– Raphael at Digital Pianism
Jun 28 '16 at 13:57
still not working :(
– Haim
Jan 15 at 14:27
add a comment |
Your Answer
StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "479"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);
else
createEditor();
);
function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: false,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: null,
bindNavPrevention: true,
postfix: "",
imageUploader:
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
,
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);
);
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmagento.stackexchange.com%2fquestions%2f123188%2fignoring-unused-parameter-with-code-sniffer%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
3 Answers
3
active
oldest
votes
3 Answers
3
active
oldest
votes
active
oldest
votes
active
oldest
votes
I was able to hide the dirt under the rug like this:
// @codingStandardsIgnoreStart
public function install(SchemaSetupInterface $setup, ModuleContextInterface $context)
// @codingStandardsIgnoreEnd
....
I'm not proud of it, but it works.
adding the// @codingStandardsIgnoreEndbetween the method signature and the opening curly brace will cause a phpcs warning - phpcs: opening brace should be on the line after the declaration; found 1 blank line(s)
– Radu
Jun 11 at 14:05
right. it can be added after the opening bracket. I edited the answer.
– Marius♦
Jun 11 at 14:18
add a comment |
I was able to hide the dirt under the rug like this:
// @codingStandardsIgnoreStart
public function install(SchemaSetupInterface $setup, ModuleContextInterface $context)
// @codingStandardsIgnoreEnd
....
I'm not proud of it, but it works.
adding the// @codingStandardsIgnoreEndbetween the method signature and the opening curly brace will cause a phpcs warning - phpcs: opening brace should be on the line after the declaration; found 1 blank line(s)
– Radu
Jun 11 at 14:05
right. it can be added after the opening bracket. I edited the answer.
– Marius♦
Jun 11 at 14:18
add a comment |
I was able to hide the dirt under the rug like this:
// @codingStandardsIgnoreStart
public function install(SchemaSetupInterface $setup, ModuleContextInterface $context)
// @codingStandardsIgnoreEnd
....
I'm not proud of it, but it works.
I was able to hide the dirt under the rug like this:
// @codingStandardsIgnoreStart
public function install(SchemaSetupInterface $setup, ModuleContextInterface $context)
// @codingStandardsIgnoreEnd
....
I'm not proud of it, but it works.
edited Jun 11 at 14:18
answered Jul 1 '16 at 8:58
Marius♦Marius
170k28329703
170k28329703
adding the// @codingStandardsIgnoreEndbetween the method signature and the opening curly brace will cause a phpcs warning - phpcs: opening brace should be on the line after the declaration; found 1 blank line(s)
– Radu
Jun 11 at 14:05
right. it can be added after the opening bracket. I edited the answer.
– Marius♦
Jun 11 at 14:18
add a comment |
adding the// @codingStandardsIgnoreEndbetween the method signature and the opening curly brace will cause a phpcs warning - phpcs: opening brace should be on the line after the declaration; found 1 blank line(s)
– Radu
Jun 11 at 14:05
right. it can be added after the opening bracket. I edited the answer.
– Marius♦
Jun 11 at 14:18
adding the
// @codingStandardsIgnoreEnd between the method signature and the opening curly brace will cause a phpcs warning - phpcs: opening brace should be on the line after the declaration; found 1 blank line(s)– Radu
Jun 11 at 14:05
adding the
// @codingStandardsIgnoreEnd between the method signature and the opening curly brace will cause a phpcs warning - phpcs: opening brace should be on the line after the declaration; found 1 blank line(s)– Radu
Jun 11 at 14:05
right. it can be added after the opening bracket. I edited the answer.
– Marius♦
Jun 11 at 14:18
right. it can be added after the opening bracket. I edited the answer.
– Marius♦
Jun 11 at 14:18
add a comment |
Update phpcs (squizlabs/PHP_CodeSniffer) to latest (v3.2.3 at 2017-03-06) and use like:
/**
* @inheritdoc
*/
// phpcs:ignore Generic.CodeAnalysis.UnusedFunctionParameter
public function install(SchemaSetupInterface $setup, ModuleContextInterface $context)
//my install script here that does not use the parameter $context
add a comment |
Update phpcs (squizlabs/PHP_CodeSniffer) to latest (v3.2.3 at 2017-03-06) and use like:
/**
* @inheritdoc
*/
// phpcs:ignore Generic.CodeAnalysis.UnusedFunctionParameter
public function install(SchemaSetupInterface $setup, ModuleContextInterface $context)
//my install script here that does not use the parameter $context
add a comment |
Update phpcs (squizlabs/PHP_CodeSniffer) to latest (v3.2.3 at 2017-03-06) and use like:
/**
* @inheritdoc
*/
// phpcs:ignore Generic.CodeAnalysis.UnusedFunctionParameter
public function install(SchemaSetupInterface $setup, ModuleContextInterface $context)
//my install script here that does not use the parameter $context
Update phpcs (squizlabs/PHP_CodeSniffer) to latest (v3.2.3 at 2017-03-06) and use like:
/**
* @inheritdoc
*/
// phpcs:ignore Generic.CodeAnalysis.UnusedFunctionParameter
public function install(SchemaSetupInterface $setup, ModuleContextInterface $context)
//my install script here that does not use the parameter $context
edited Mar 6 '18 at 15:39
sv3n
10.1k62557
10.1k62557
answered Mar 6 '18 at 15:10
likemusiclikemusic
412
412
add a comment |
add a comment |
I'm pretty sure the suppress warning rule you will have to use is:
Generic.CodeAnalysis.UnusedFunctionParameter
So this should be the code to use in your PHP Docblock:
@SuppressWarnings(Generic.CodeAnalysis.UnusedFunctionParameter)
thanks for digging this up, but it has no effect
– Marius♦
Jun 28 '16 at 13:54
1
@Marius hmm that's annoying
– Raphael at Digital Pianism
Jun 28 '16 at 13:57
still not working :(
– Haim
Jan 15 at 14:27
add a comment |
I'm pretty sure the suppress warning rule you will have to use is:
Generic.CodeAnalysis.UnusedFunctionParameter
So this should be the code to use in your PHP Docblock:
@SuppressWarnings(Generic.CodeAnalysis.UnusedFunctionParameter)
thanks for digging this up, but it has no effect
– Marius♦
Jun 28 '16 at 13:54
1
@Marius hmm that's annoying
– Raphael at Digital Pianism
Jun 28 '16 at 13:57
still not working :(
– Haim
Jan 15 at 14:27
add a comment |
I'm pretty sure the suppress warning rule you will have to use is:
Generic.CodeAnalysis.UnusedFunctionParameter
So this should be the code to use in your PHP Docblock:
@SuppressWarnings(Generic.CodeAnalysis.UnusedFunctionParameter)
I'm pretty sure the suppress warning rule you will have to use is:
Generic.CodeAnalysis.UnusedFunctionParameter
So this should be the code to use in your PHP Docblock:
@SuppressWarnings(Generic.CodeAnalysis.UnusedFunctionParameter)
answered Jun 28 '16 at 13:23
Raphael at Digital PianismRaphael at Digital Pianism
55.5k22130293
55.5k22130293
thanks for digging this up, but it has no effect
– Marius♦
Jun 28 '16 at 13:54
1
@Marius hmm that's annoying
– Raphael at Digital Pianism
Jun 28 '16 at 13:57
still not working :(
– Haim
Jan 15 at 14:27
add a comment |
thanks for digging this up, but it has no effect
– Marius♦
Jun 28 '16 at 13:54
1
@Marius hmm that's annoying
– Raphael at Digital Pianism
Jun 28 '16 at 13:57
still not working :(
– Haim
Jan 15 at 14:27
thanks for digging this up, but it has no effect
– Marius♦
Jun 28 '16 at 13:54
thanks for digging this up, but it has no effect
– Marius♦
Jun 28 '16 at 13:54
1
1
@Marius hmm that's annoying
– Raphael at Digital Pianism
Jun 28 '16 at 13:57
@Marius hmm that's annoying
– Raphael at Digital Pianism
Jun 28 '16 at 13:57
still not working :(
– Haim
Jan 15 at 14:27
still not working :(
– Haim
Jan 15 at 14:27
add a comment |
Thanks for contributing an answer to Magento Stack Exchange!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmagento.stackexchange.com%2fquestions%2f123188%2fignoring-unused-parameter-with-code-sniffer%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown