Skip to content

Commit

Permalink
Revert changes to the Composer package name
Browse files Browse the repository at this point in the history
In contrast to earlier information, arrangements are now being made to allow the package to continue under its original name on Packagist. The commit (in the new repo) to rename the package [has been reverted](PHPCSStandards/PHP_CodeSniffer#135).
  • Loading branch information
jrfnl committed Dec 7, 2023
1 parent 626984e commit fec0f06
Show file tree
Hide file tree
Showing 16 changed files with 38 additions and 40 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,7 @@ Create a composer package of your coding standard by adding a `composer.json` fi
"description" : "Package contains all coding standards of the Acme company",
"require" : {
"php" : ">=5.4.0",
"phpcsstandards/php_codesniffer" : "^3.8"
"squizlabs/php_codesniffer" : "^3.6"
},
"type" : "phpcodesniffer-standard"
}
Expand Down
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
"require": {
"php": ">=5.4",
"composer-plugin-api": "^1.0 || ^2.0",
"phpcsstandards/php_codesniffer": "^2.0 || ^3.1.0 || ^4.0"
"squizlabs/php_codesniffer": "^2.0 || ^3.1.0 || ^4.0"
},
"require-dev": {
"ext-json": "*",
Expand Down
2 changes: 1 addition & 1 deletion src/Plugin.php
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ class Plugin implements PluginInterface, EventSubscriberInterface
const MESSAGE_PLUGIN_UNINSTALLED = 'PHPCodeSniffer Composer Installer is uninstalled';
const MESSAGE_RUNNING_INSTALLER = 'Running PHPCodeSniffer Composer Installer';

const PACKAGE_NAME = 'phpcsstandards/php_codesniffer';
const PACKAGE_NAME = 'squizlabs/php_codesniffer';
const PACKAGE_TYPE = 'phpcodesniffer-standard';

const PHPCS_CONFIG_REGEX = '`%s:[^\r\n]+`';
Expand Down
10 changes: 5 additions & 5 deletions tests/IntegrationTest/BaseLineTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ final class BaseLineTest extends TestCase
private $composerConfig = array(
'name' => 'phpcs-composer-installer/baseline-test',
'require-dev' => array(
'phpcsstandards/php_codesniffer' => null,
'squizlabs/php_codesniffer' => null,
'dealerdirect/phpcodesniffer-composer-installer' => '*',
),
);
Expand Down Expand Up @@ -66,7 +66,7 @@ protected function tear_down()
public function testBaseLineGlobal($phpcsVersion, $expectedStnds)
{
$config = $this->composerConfig;
$config['require-dev']['phpcsstandards/php_codesniffer'] = $phpcsVersion;
$config['require-dev']['squizlabs/php_codesniffer'] = $phpcsVersion;

$this->writeComposerJsonFile($config, static::$tempGlobalPath);
$this->assertComposerValidates(static::$tempGlobalPath);
Expand All @@ -90,7 +90,7 @@ public function testBaseLineGlobal($phpcsVersion, $expectedStnds)

// Make sure the CodeSniffer.conf file does not get created when no external standards are found.
$this->assertFileDoesNotExist(
static::$tempGlobalPath . '/vendor/phpcsstandards/php_codesniffer/CodeSniffer.conf'
static::$tempGlobalPath . '/vendor/squizlabs/php_codesniffer/CodeSniffer.conf'
);
}

Expand Down Expand Up @@ -121,7 +121,7 @@ public function testBaseLineLocal($phpcsVersion, $expectedStnds)
}

$config = $this->composerConfig;
$config['require-dev']['phpcsstandards/php_codesniffer'] = $phpcsVersion;
$config['require-dev']['squizlabs/php_codesniffer'] = $phpcsVersion;

$this->writeComposerJsonFile($config, static::$tempLocalPath);
$this->assertComposerValidates(static::$tempLocalPath);
Expand All @@ -145,7 +145,7 @@ public function testBaseLineLocal($phpcsVersion, $expectedStnds)

// Make sure the CodeSniffer.conf file does not get created when no external standards are found.
$this->assertFileDoesNotExist(
static::$tempLocalPath . '/vendor/phpcsstandards/php_codesniffer/CodeSniffer.conf'
static::$tempLocalPath . '/vendor/squizlabs/php_codesniffer/CodeSniffer.conf'
);
}

Expand Down
2 changes: 1 addition & 1 deletion tests/IntegrationTest/InstallUpdateEventsTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,7 @@ public function testPluginRunsOnReinstall()
* 2. Reinstall PHPCS.
*/
$command = sprintf(
'composer reinstall phpcsstandards/php_codesniffer -v --no-ansi --working-dir=%s',
'composer reinstall squizlabs/php_codesniffer -v --no-ansi --working-dir=%s',
escapeshellarg(static::$tempLocalPath)
);
$result = $this->executeCliCommand($command);
Expand Down
6 changes: 3 additions & 3 deletions tests/IntegrationTest/InvalidPackagesTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -28,15 +28,15 @@ final class InvalidPackagesTest extends TestCase
private $composerConfigNoRuleset = array(
'name' => 'phpcs-composer-installer/invalid-package-no-ruleset-test',
'require-dev' => array(
'phpcsstandards/php_codesniffer' => '*',
'squizlabs/php_codesniffer' => '*',
'phpcs-composer-installer/no-ruleset' => '*',
),
);

private $composerConfigIncorrectType = array(
'name' => 'phpcs-composer-installer/invalid-package-incorrect-type-test',
'require-dev' => array(
'phpcsstandards/php_codesniffer' => '*',
'squizlabs/php_codesniffer' => '*',
'phpcs-composer-installer/incorrect-type' => '*',
),
);
Expand Down Expand Up @@ -82,7 +82,7 @@ public function testDontSetInstalledPathsForInvalidPackages($config, $standardNa

// Make sure the CodeSniffer.conf file does not get created when no (valid) external standards are found.
$this->assertFileDoesNotExist(
static::$tempLocalPath . '/vendor/phpcsstandards/php_codesniffer/CodeSniffer.conf'
static::$tempLocalPath . '/vendor/squizlabs/php_codesniffer/CodeSniffer.conf'
);

// Make sure that the standard does not show up as registered with PHPCS.
Expand Down
2 changes: 1 addition & 1 deletion tests/IntegrationTest/PlayNiceWithScriptsTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ final class PlayNiceWithScriptsTest extends TestCase
private $composerConfig = array(
'name' => 'phpcs-composer-installer/dont-block-scripts-test',
'require-dev' => array(
'phpcsstandards/php_codesniffer' => '*',
'squizlabs/php_codesniffer' => '*',
'dealerdirect/phpcodesniffer-composer-installer' => '*',
'phpcs-composer-installer/dummy-subdir' => '*',
),
Expand Down
8 changes: 4 additions & 4 deletions tests/IntegrationTest/PreexistingPHPCSConfigTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ final class PreexistingPHPCSConfigTest extends TestCase
private $composerConfig = array(
'name' => 'phpcs-composer-installer/preexisting-config-test',
'require-dev' => array(
'phpcsstandards/php_codesniffer' => null,
'squizlabs/php_codesniffer' => null,
'dealerdirect/phpcodesniffer-composer-installer' => '*',
),
);
Expand Down Expand Up @@ -71,7 +71,7 @@ protected function tear_down()
public function testPreexistingNonInstalledPathsConfigIsKeptIntact($phpcsVersion)
{
$config = $this->composerConfig;
$config['require-dev']['phpcsstandards/php_codesniffer'] = $phpcsVersion;
$config['require-dev']['squizlabs/php_codesniffer'] = $phpcsVersion;

$this->writeComposerJsonFile($config, static::$tempLocalPath);

Expand All @@ -88,7 +88,7 @@ public function testPreexistingNonInstalledPathsConfigIsKeptIntact($phpcsVersion

// Verify the CodeSniffer.conf file does not exist to start with.
$this->assertFileDoesNotExist(
static::$tempLocalPath . '/vendor/phpcsstandards/php_codesniffer/CodeSniffer.conf'
static::$tempLocalPath . '/vendor/squizlabs/php_codesniffer/CodeSniffer.conf'
);

// Verify that the config is empty to start with.
Expand Down Expand Up @@ -122,7 +122,7 @@ public function testPreexistingNonInstalledPathsConfigIsKeptIntact($phpcsVersion

// Make sure the CodeSniffer.conf file has been created.
$this->assertFileExists(
static::$tempLocalPath . '/vendor/phpcsstandards/php_codesniffer/CodeSniffer.conf'
static::$tempLocalPath . '/vendor/squizlabs/php_codesniffer/CodeSniffer.conf'
);

// Verify that the config contains the newly set values.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ final class PreexistingPHPCSInstalledPathsConfigTest extends TestCase
private $composerConfig = array(
'name' => 'phpcs-composer-installer/preexisting-config-test',
'require-dev' => array(
'phpcsstandards/php_codesniffer' => null,
'squizlabs/php_codesniffer' => null,
'dealerdirect/phpcodesniffer-composer-installer' => '*',
),
);
Expand Down Expand Up @@ -88,7 +88,7 @@ protected function tear_down()
public function testPreexistingValidInstalledPathsConfigIsKeptIntact($phpcsVersion)
{
$config = $this->composerConfig;
$config['require-dev']['phpcsstandards/php_codesniffer'] = $phpcsVersion;
$config['require-dev']['squizlabs/php_codesniffer'] = $phpcsVersion;

$this->writeComposerJsonFile($config, static::$tempGlobalPath);

Expand Down Expand Up @@ -176,7 +176,7 @@ public function testPreexistingValidInstalledPathsConfigIsKeptIntact($phpcsVersi
public function testPreexistingInvalidInstalledPathsConfigIsRemoved($phpcsVersion)
{
$config = $this->composerConfig;
$config['require-dev']['phpcsstandards/php_codesniffer'] = $phpcsVersion;
$config['require-dev']['squizlabs/php_codesniffer'] = $phpcsVersion;

$this->writeComposerJsonFile($config, static::$tempLocalPath);

Expand Down Expand Up @@ -216,7 +216,7 @@ public function testPreexistingInvalidInstalledPathsConfigIsRemoved($phpcsVersio
* will error on an exception from the DirectoryIterator as used by PHPCS itself.
* The manual setting prevents this exception, but still allows us to test this use-case.
*/
$confFile = static::$tempLocalPath . '/vendor/phpcsstandards/php_codesniffer/CodeSniffer.conf';
$confFile = static::$tempLocalPath . '/vendor/squizlabs/php_codesniffer/CodeSniffer.conf';
$confContents = file_get_contents($confFile);
$this->assertNotFalse($confContents);
$confContents = str_replace(
Expand Down
18 changes: 9 additions & 9 deletions tests/IntegrationTest/RegisterExternalStandardsTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ final class RegisterExternalStandardsTest extends TestCase
private $configOneStandard = array(
'name' => 'phpcs-composer-installer/register-external-stnds-one-stnd',
'require-dev' => array(
'phpcsstandards/php_codesniffer' => null,
'squizlabs/php_codesniffer' => null,
'phpcs-composer-installer/dummy-subdir' => '*',
'dealerdirect/phpcodesniffer-composer-installer' => '*',
),
Expand All @@ -30,15 +30,15 @@ final class RegisterExternalStandardsTest extends TestCase
private $configOneStandardMultiRuleset = array(
'name' => 'phpcs-composer-installer/register-external-stnds-multistnd',
'require-dev' => array(
'phpcsstandards/php_codesniffer' => null,
'squizlabs/php_codesniffer' => null,
'phpcs-composer-installer/multistandard' => '*',
),
);

private $configOneStandardInSrcSubdir = array(
'name' => 'phpcs-composer-installer/register-external-stnds-in-src-subdir',
'require-dev' => array(
'phpcsstandards/php_codesniffer' => null,
'squizlabs/php_codesniffer' => null,
'phpcs-composer-installer/dummy-src' => '*',
),
);
Expand Down Expand Up @@ -73,7 +73,7 @@ protected function tear_down()
public function testRegisterOneStandardGlobal($phpcsVersion)
{
$config = $this->configOneStandard;
$config['require-dev']['phpcsstandards/php_codesniffer'] = $phpcsVersion;
$config['require-dev']['squizlabs/php_codesniffer'] = $phpcsVersion;

$this->writeComposerJsonFile($config, static::$tempGlobalPath);
$this->assertComposerValidates(static::$tempGlobalPath);
Expand All @@ -99,7 +99,7 @@ public function testRegisterOneStandardGlobal($phpcsVersion)

// Make sure the CodeSniffer.conf file has been created.
$this->assertFileExists(
static::$tempGlobalPath . '/vendor/phpcsstandards/php_codesniffer/CodeSniffer.conf'
static::$tempGlobalPath . '/vendor/squizlabs/php_codesniffer/CodeSniffer.conf'
);

// Verify that PHPCS sees the external standard.
Expand Down Expand Up @@ -138,7 +138,7 @@ public function testRegisterOneStandardGlobal($phpcsVersion)
public function testRegisterOneStandardLocal($phpcsVersion)
{
$config = $this->configOneStandard;
$config['require-dev']['phpcsstandards/php_codesniffer'] = $phpcsVersion;
$config['require-dev']['squizlabs/php_codesniffer'] = $phpcsVersion;

$this->writeComposerJsonFile($config, static::$tempLocalPath);
$this->assertComposerValidates(static::$tempLocalPath);
Expand Down Expand Up @@ -168,7 +168,7 @@ public function testRegisterOneStandardLocal($phpcsVersion)

// Make sure the CodeSniffer.conf file has been created.
$this->assertFileExists(
static::$tempLocalPath . '/vendor/phpcsstandards/php_codesniffer/CodeSniffer.conf'
static::$tempLocalPath . '/vendor/squizlabs/php_codesniffer/CodeSniffer.conf'
);

// Verify that PHPCS sees the external standard.
Expand Down Expand Up @@ -219,7 +219,7 @@ public function dataRegisterOneStandard()
public function testRegisterOneStandardWithMultipleRulesets($phpcsVersion)
{
$config = $this->configOneStandardMultiRuleset;
$config['require-dev']['phpcsstandards/php_codesniffer'] = $phpcsVersion;
$config['require-dev']['squizlabs/php_codesniffer'] = $phpcsVersion;

$this->writeComposerJsonFile($config, static::$tempLocalPath);

Expand Down Expand Up @@ -287,7 +287,7 @@ public function dataRegisterOneStandardMultipleRulesets()
public function testRegisterOneStandardInSrcSubdir($phpcsVersion)
{
$config = $this->configOneStandardInSrcSubdir;
$config['require-dev']['phpcsstandards/php_codesniffer'] = $phpcsVersion;
$config['require-dev']['squizlabs/php_codesniffer'] = $phpcsVersion;

$this->writeComposerJsonFile($config, static::$tempGlobalPath);

Expand Down
8 changes: 3 additions & 5 deletions tests/TestCase.php
Original file line number Diff line number Diff line change
Expand Up @@ -368,13 +368,11 @@ protected static function stabilizeCommand($command, $workingDir = null)
*/
protected static function getPhpcsCommand($workingDir = null)
{
$command = '"vendor/phpcsstandards/php_codesniffer/bin/phpcs"'; // PHPCS 3.x.
$command = '"vendor/squizlabs/php_codesniffer/bin/phpcs"'; // PHPCS 3.x.

if (is_string($workingDir)
&& file_exists($workingDir . '/vendor/phpcsstandards/php_codesniffer/scripts/phpcs')
) {
if (is_string($workingDir) && file_exists($workingDir . '/vendor/squizlabs/php_codesniffer/scripts/phpcs')) {
// PHPCS 2.x.
$command = '"vendor/phpcsstandards/php_codesniffer/scripts/phpcs"';
$command = '"vendor/squizlabs/php_codesniffer/scripts/phpcs"';
}

return $command;
Expand Down
2 changes: 1 addition & 1 deletion tests/fixtures/dummy-src/composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"license" : "MIT",
"require" : {
"php" : ">=5.4",
"phpcsstandards/php_codesniffer" : "*",
"squizlabs/php_codesniffer" : "*",
"dealerdirect/phpcodesniffer-composer-installer" : "*"
},
"config": {
Expand Down
2 changes: 1 addition & 1 deletion tests/fixtures/dummy-subdir/composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,6 @@
"license" : "MIT",
"require" : {
"php" : ">=5.4",
"phpcsstandards/php_codesniffer" : "*"
"squizlabs/php_codesniffer" : "*"
}
}
2 changes: 1 addition & 1 deletion tests/fixtures/incorrect-type/composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"license" : "MIT",
"require" : {
"php" : ">=5.4",
"phpcsstandards/php_codesniffer" : "*",
"squizlabs/php_codesniffer" : "*",
"dealerdirect/phpcodesniffer-composer-installer" : "*"
},
"config": {
Expand Down
2 changes: 1 addition & 1 deletion tests/fixtures/multistandard/composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"license" : "MIT",
"require" : {
"php" : ">=5.4",
"phpcsstandards/php_codesniffer" : "*",
"squizlabs/php_codesniffer" : "*",
"dealerdirect/phpcodesniffer-composer-installer" : "*"
},
"config": {
Expand Down
2 changes: 1 addition & 1 deletion tests/fixtures/no-ruleset/composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"license" : "MIT",
"require" : {
"php" : ">=5.4",
"phpcsstandards/php_codesniffer" : "*",
"squizlabs/php_codesniffer" : "*",
"dealerdirect/phpcodesniffer-composer-installer" : "*"
},
"config": {
Expand Down

0 comments on commit fec0f06

Please sign in to comment.