and let’s assume the following content of Bar.php:
// Bar.phpnamespaceOtherDir;useSomeDir\Foo;// This now conflicts the class OtherDir\Foo
If both files OtherDir/Foo.php and SomeDir/Foo.php are loaded in the
same runtime, you will see a PHP error such as the following:
PHP Fatal error: Cannot use SomeDir\Foo as Foo because the name is already in use in OtherDir/Foo.php
However, as OtherDir/Foo.php does not necessarily have to be loaded and the
error is only triggered if it is loaded before OtherDir/Bar.php, this problem
might go unnoticed for a while. In order to prevent this error from surfacing,
you must import the namespace with a different alias:
// Bar.phpnamespaceOtherDir;useSomeDir\FooasSomeDirFoo;// There is no conflict anymore.
Loading history...
6
use Illuminate\Http\Request;
7
8
class WebhookException extends Exception
9
{
10
public static function missingSignature()
11
{
12
return new static('The request did not contain a header named `Integrations-Signature`.');
13
}
14
15
public static function invalidSignature($signature)
16
{
17
return new static("The signature `{$signature}` found in the header named `Integrations-Signature` is invalid. Make sure that the use has configured the webhook field to the value you on the Socrates dashboard.");
18
}
19
20
public static function signingSecretNotSet()
21
{
22
return new static('The Integrations webhook signing secret is not set. Make sure that the user has configured the webhook field to the value on the Socrates dashboard.');
23
}
24
25
public static function missingType()
26
{
27
return new static('The webhook call did not contain a type. Valid Integrations webhook calls should always contain a type.');
28
}
29
30
public static function unrecognizedType($type)
31
{
32
return new static("The type {$type} is not currently supported.");
Let’s assume that you have a directory layout like this:
and let’s assume the following content of
Bar.php
:If both files
OtherDir/Foo.php
andSomeDir/Foo.php
are loaded in the same runtime, you will see a PHP error such as the following:PHP Fatal error: Cannot use SomeDir\Foo as Foo because the name is already in use in OtherDir/Foo.php
However, as
OtherDir/Foo.php
does not necessarily have to be loaded and the error is only triggered if it is loaded beforeOtherDir/Bar.php
, this problem might go unnoticed for a while. In order to prevent this error from surfacing, you must import the namespace with a different alias: