Skip to content

Generic/ScopeIndent: remove check for test constant from src code #1036

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

Merged
merged 1 commit into from
Apr 19, 2025
Merged
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
4 changes: 0 additions & 4 deletions src/Standards/Generic/Sniffs/WhiteSpace/ScopeIndentSniff.php
Original file line number Diff line number Diff line change
Expand Up @@ -106,10 +106,6 @@ class ScopeIndentSniff implements Sniff
*/
public function register()
{
if (defined('PHP_CODESNIFFER_IN_TESTS') === true) {
$this->debug = false;
}

return [T_OPEN_TAG];

}//end register()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,8 @@ final class ScopeIndentUnitTest extends AbstractSniffUnitTest
*/
public function setCliValues($testFile, $config)
{
$config->setConfigData('scope_indent_debug', false, true);

// Tab width setting is only needed for the tabbed file.
if ($testFile === 'ScopeIndentUnitTest.2.inc') {
$config->tabWidth = 4;
Expand Down
15 changes: 15 additions & 0 deletions src/Standards/PEAR/Tests/WhiteSpace/ScopeIndentUnitTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,21 @@ final class ScopeIndentUnitTest extends AbstractSniffUnitTest
{


/**
* Get a list of CLI values to set before the file is tested.
*
* @param string $testFile The name of the file being tested.
* @param \PHP_CodeSniffer\Config $config The config data for the test run.
*
* @return void
*/
public function setCliValues($testFile, $config)
{
$config->setConfigData('scope_indent_debug', false, true);

}//end setCliValues()


/**
* Returns the lines where errors should occur.
*
Expand Down