Skip to content

Commit e7b7030

Browse files
committed
Autoloading is gone from user-facing messages
1 parent 61f4b18 commit e7b7030

File tree

6 files changed

+11
-11
lines changed

6 files changed

+11
-11
lines changed

src/Broker/ClassAutoloadingException.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,14 +14,14 @@ public function __construct(
1414
{
1515
if ($previous !== null) {
1616
parent::__construct(sprintf(
17-
'%s (%s) thrown while autoloading class %s.',
17+
'%s (%s) thrown while looking for class %s.',
1818
get_class($previous),
1919
$previous->getMessage(),
2020
$functionName
2121
), 0, $previous);
2222
} else {
2323
parent::__construct(sprintf(
24-
'Class %s not found and could not be autoloaded.',
24+
'Class %s not found.',
2525
$functionName
2626
), 0);
2727
}
@@ -36,7 +36,7 @@ public function getClassName(): string
3636

3737
public function getTip(): ?string
3838
{
39-
return 'Learn more at https://phpstan.org/user-guide/autoloading';
39+
return 'Learn more at https://phpstan.org/user-guide/discovering-symbols';
4040
}
4141

4242
}

src/Broker/ClassNotFoundException.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ class ClassNotFoundException extends \PHPStan\AnalysedCodeException
99

1010
public function __construct(string $functionName)
1111
{
12-
parent::__construct(sprintf('Class %s was not found while trying to analyse it - autoloading is probably not configured properly.', $functionName));
12+
parent::__construct(sprintf('Class %s was not found while trying to analyse it - discovering symbols is probably not configured properly.', $functionName));
1313
$this->className = $functionName;
1414
}
1515

@@ -20,7 +20,7 @@ public function getClassName(): string
2020

2121
public function getTip(): ?string
2222
{
23-
return 'Learn more at https://phpstan.org/user-guide/autoloading';
23+
return 'Learn more at https://phpstan.org/user-guide/discovering-symbols';
2424
}
2525

2626
}

src/Broker/ConstantNotFoundException.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ public function getConstantName(): string
2020

2121
public function getTip(): ?string
2222
{
23-
return 'Learn more at https://phpstan.org/user-guide/autoloading';
23+
return 'Learn more at https://phpstan.org/user-guide/discovering-symbols';
2424
}
2525

2626
}

src/Broker/FunctionNotFoundException.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ class FunctionNotFoundException extends \PHPStan\AnalysedCodeException
99

1010
public function __construct(string $functionName)
1111
{
12-
parent::__construct(sprintf('Function %s not found while trying to analyse it - autoloading is probably not configured properly.', $functionName));
12+
parent::__construct(sprintf('Function %s not found while trying to analyse it - discovering symbols is probably not configured properly.', $functionName));
1313
$this->functionName = $functionName;
1414
}
1515

@@ -20,7 +20,7 @@ public function getFunctionName(): string
2020

2121
public function getTip(): ?string
2222
{
23-
return 'Learn more at https://phpstan.org/user-guide/autoloading';
23+
return 'Learn more at https://phpstan.org/user-guide/discovering-symbols';
2424
}
2525

2626
}

tests/PHPStan/Analyser/AnalyserIntegrationTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ public function testExtendingUnknownClass(): void
6969
$this->assertSame('Class ExtendingUnknownClass\Foo extends unknown class ExtendingUnknownClass\Bar.', $errors[0]->getMessage());
7070
} else {
7171
$this->assertNull($errors[0]->getLine());
72-
$this->assertSame('Class ExtendingUnknownClass\Bar not found and could not be autoloaded.', $errors[0]->getMessage());
72+
$this->assertSame('Class ExtendingUnknownClass\Bar not found.', $errors[0]->getMessage());
7373
}
7474
}
7575

tests/PHPStan/Broker/BrokerTest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ public function testClassNotFound(): void
7474
public function testFunctionNotFound(): void
7575
{
7676
$this->expectException(\PHPStan\Broker\FunctionNotFoundException::class);
77-
$this->expectExceptionMessage('Function nonexistentFunction not found while trying to analyse it - autoloading is probably not configured properly.');
77+
$this->expectExceptionMessage('Function nonexistentFunction not found while trying to analyse it - discovering symbols is probably not configured properly.');
7878

7979
$scope = $this->createMock(Scope::class);
8080
$scope->method('getNamespace')
@@ -85,7 +85,7 @@ public function testFunctionNotFound(): void
8585
public function testClassAutoloadingException(): void
8686
{
8787
$this->expectException(\PHPStan\Broker\ClassAutoloadingException::class);
88-
$this->expectExceptionMessage("ParseError (syntax error, unexpected '{') thrown while autoloading class NonexistentClass.");
88+
$this->expectExceptionMessage("ParseError (syntax error, unexpected '{') thrown while looking for class NonexistentClass.");
8989
spl_autoload_register(static function (): void {
9090
require_once __DIR__ . '/../Analyser/data/parse-error.php';
9191
}, true, true);

0 commit comments

Comments
 (0)