Skip to content

Commit

Permalink
Merge pull request #110 from szepeviktor/mister
Browse files Browse the repository at this point in the history
Fix typos
  • Loading branch information
BrianHenryIE authored Oct 13, 2024
2 parents b7f4225 + 740dc09 commit 24cf513
Show file tree
Hide file tree
Showing 6 changed files with 10 additions and 10 deletions.
2 changes: 1 addition & 1 deletion src/Cleanup.php
Original file line number Diff line number Diff line change
Expand Up @@ -215,7 +215,7 @@ protected function cleanupFilesAutoloader(): void
if (! file_exists($file)) {
$missingFiles[] = str_replace([ $this->workingDir, 'vendor/composer/../', 'vendor/' ], '', $file);
// When `composer install --no-dev` is run, it creates an index of files autoload files which
// references the non-existant files. This causes a fatal error when the autoloader is included.
// references the non-existent files. This causes a fatal error when the autoloader is included.
// TODO: if delete_vendor_packages is true, do not create this file.
$this->filesystem->write(
str_replace($this->workingDir, '', $file),
Expand Down
2 changes: 1 addition & 1 deletion src/File.php
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ public function isPhpFile(): bool
return substr($this->sourceAbsolutePath, -4) === '.php';
}

public function addNamespace(string $namspaceName): void
public function addNamespace(string $namespaceName): void
{
}
public function addClass(string $className): void
Expand Down
2 changes: 1 addition & 1 deletion src/FileEnumerator.php
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,7 @@ protected function addFile(ComposerPackage $dependency, string $packageRelativeP
$projectRelativePath = $this->vendorDir . $outputRelativeFilepath;
$isOutsideProjectDir = 0 !== strpos($sourceAbsoluteFilepath, $this->workingDir);

$f = $this->disoveredFiles[$outputRelativeFilepath]
$f = $this->discoveredFiles[$outputRelativeFilepath]
?? new File($dependency, $packageRelativePath, $sourceAbsoluteFilepath);

$f->addAutoloader($autoloaderType);
Expand Down
4 changes: 2 additions & 2 deletions src/Prefixer.php
Original file line number Diff line number Diff line change
Expand Up @@ -249,9 +249,9 @@ public function replaceNamespace(string $contents, string $originalNamespace, st
// For prefixed functions which do not begin with a backslash, add one.
// I'm not certain this is a good idea.
// @see https://github.com/BrianHenryIE/strauss/issues/65
$functionReplacingPatten = '/\\\\?('.preg_quote(ltrim($replacement, '\\'), '/').'\\\\(?:[a-zA-Z0-9_\x7f-\xff]+\\\\)*[a-zA-Z0-9_\x7f-\xff]+\\()/';
$functionReplacingPattern = '/\\\\?('.preg_quote(ltrim($replacement, '\\'), '/').'\\\\(?:[a-zA-Z0-9_\x7f-\xff]+\\\\)*[a-zA-Z0-9_\x7f-\xff]+\\()/';
$result = preg_replace(
$functionReplacingPatten,
$functionReplacingPattern,
"\\\\$1",
$result
);
Expand Down
2 changes: 1 addition & 1 deletion tests/Issues/StraussIssue101Test.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php
/**
* Was over-eagerly deleteing autoload keys.
* Was over-eagerly deleting autoload keys.
*
* @see https://github.com/BrianHenryIE/strauss/issues/101#issuecomment-2078702245
*/
Expand Down
8 changes: 4 additions & 4 deletions tests/Issues/StraussIssue81Test.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
*/
class StraussIssue81Test extends IntegrationTestCase
{
public function test_snake_case_cli_argument_supercedes_configured_option_false_to_true()
public function test_snake_case_cli_argument_supersedes_configured_option_false_to_true()
{

$composerJsonString = <<<'EOD'
Expand Down Expand Up @@ -61,7 +61,7 @@ public function test_snake_case_cli_argument_supercedes_configured_option_false_
self::assertFileDoesNotExist($this->testsWorkingDir . 'vendor/psr/log/composer.json');
}

public function test_snkae_case_cli_argument_supercedes_configured_option_true_to_false()
public function test_snkae_case_cli_argument_supersedes_configured_option_true_to_false()
{

$composerJsonString = <<<'EOD'
Expand Down Expand Up @@ -104,7 +104,7 @@ public function test_snkae_case_cli_argument_supercedes_configured_option_true_t
self::assertFileExists($this->testsWorkingDir . 'vendor/psr/log/composer.json');
}

public function test_camel_case_cli_argument_supercedes_configured_option_false_to_true()
public function test_camel_case_cli_argument_supersedes_configured_option_false_to_true()
{

$composerJsonString = <<<'EOD'
Expand Down Expand Up @@ -148,7 +148,7 @@ public function test_camel_case_cli_argument_supercedes_configured_option_false_
self::assertFileDoesNotExist($this->testsWorkingDir . 'vendor/psr/log/composer.json');
}

public function test_camel_case_cli_argument_supercedes_configured_option_true_to_false()
public function test_camel_case_cli_argument_supersedes_configured_option_true_to_false()
{

$composerJsonString = <<<'EOD'
Expand Down

0 comments on commit 24cf513

Please sign in to comment.