Skip to content

Commit

Permalink
wip
Browse files Browse the repository at this point in the history
Signed-off-by: Mior Muhammad Zaki <[email protected]>
  • Loading branch information
crynobone committed Oct 26, 2024
1 parent 970e1cb commit 4e2224b
Show file tree
Hide file tree
Showing 7 changed files with 20 additions and 109 deletions.
12 changes: 1 addition & 11 deletions src/Bootstrap/HandleExceptions.php
Original file line number Diff line number Diff line change
Expand Up @@ -31,17 +31,7 @@ public function __construct($testbench = null)
$this->testbench = $testbench;
}

/**
* Reports a deprecation to the "deprecations" logger.
*
* @param string $message
* @param string $file
* @param int $line
* @param int $level
* @return void
*
* @throws \Orchestra\Testbench\Exceptions\DeprecatedException
*/
/** {@inheritDoc} */
public function handleDeprecationError($message, $file, $line, $level = E_DEPRECATED)
{
parent::handleDeprecationError($message, $file, $line, $level);
Expand Down
7 changes: 1 addition & 6 deletions src/Bootstrap/LoadEnvironmentVariables.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,7 @@
*/
final class LoadEnvironmentVariables extends \Illuminate\Foundation\Bootstrap\LoadEnvironmentVariables
{
/**
* Create a Dotenv instance.
*
* @param \Illuminate\Contracts\Foundation\Application $app
* @return \Dotenv\Dotenv
*/
/** {@inheritDoc} */
protected function createDotenv($app)
{
/** @phpstan-ignore method.notFound, method.notFound */
Expand Down
39 changes: 7 additions & 32 deletions src/Exceptions/Handler.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,54 +7,29 @@

class Handler extends ExceptionHandler
{
/**
* A list of exception types with their corresponding custom log levels.
*
* @var array<class-string<\Throwable>, \Psr\Log\LogLevel::*>
*/
protected $levels = [
/** {@inheritDoc} */
protected $dontReport = [
//
];

/**
* A list of the exception types that should not be reported.
*
* @var array<int, class-string<\Throwable>>
*/
protected $dontReport = [
/** {@inheritDoc} */
protected $levels = [
//
];

/**
* A list of the inputs that are never flashed for validation exceptions.
*
* @var array<int, string>
*/
/** {@inheritDoc} */
protected $dontFlash = [
'password',
'password_confirmation',
];

/**
* Report or log an exception.
*
* This is a great spot to send exceptions to Sentry, Bugsnag, etc.
*
* @param \Throwable $e
* @return void
*/
/** {@inheritDoc} */
public function report(Throwable $e)
{
parent::report($e);
}

/**
* Render an exception into an HTTP response.
*
* @param \Illuminate\Http\Request $request
* @param \Throwable $e
* @return \Symfony\Component\HttpFoundation\Response|\Illuminate\Http\Response
*/
/** {@inheritDoc} */
public function render($request, Throwable $e)
{
return parent::render($request, $e);
Expand Down
38 changes: 6 additions & 32 deletions src/Foundation/Console/TestCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -35,11 +35,7 @@ class TestCommand extends Command
*/
protected $description = 'Run the package tests';

/**
* Create a new command instance.
*
* @return void
*/
/** {@inheritDoc} */
public function __construct()
{
parent::__construct();
Expand All @@ -49,11 +45,7 @@ public function __construct()
}
}

/**
* Execute the console command.
*
* @return mixed
*/
/** {@inheritDoc} */
public function handle()
{
Env::enablePutenv();
Expand All @@ -78,12 +70,7 @@ public function phpUnitConfigurationFile()
->first() ?? './';
}

/**
* Get the array of arguments for running PHPUnit.
*
* @param array $options
* @return array
*/
/** {@inheritDoc} */
protected function phpunitArguments($options)
{
$file = $this->phpUnitConfigurationFile();
Expand All @@ -95,12 +82,7 @@ protected function phpunitArguments($options)
->all();
}

/**
* Get the array of arguments for running Paratest.
*
* @param array $options
* @return array
*/
/** {@inheritDoc} */
protected function paratestArguments($options)
{
$file = $this->phpUnitConfigurationFile();
Expand All @@ -115,11 +97,7 @@ protected function paratestArguments($options)
])->all();
}

/**
* Get the array of environment variables for running PHPUnit.
*
* @return array
*/
/** {@inheritDoc} */
protected function phpunitEnvironmentVariables()
{
return Collection::make(defined_environment_variables())
Expand All @@ -132,11 +110,7 @@ protected function phpunitEnvironmentVariables()
->all();
}

/**
* Get the array of environment variables for running Paratest.
*
* @return array
*/
/** {@inheritDoc} */
protected function paratestEnvironmentVariables()
{
return Collection::make(defined_environment_variables())
Expand Down
6 changes: 1 addition & 5 deletions src/Foundation/Console/TestFallbackCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -35,11 +35,7 @@ class TestFallbackCommand extends Command
*/
protected $description = 'Run the package tests';

/**
* Create a new command instance.
*
* @return void
*/
/** {@inheritDoc} */
public function __construct()
{
parent::__construct();
Expand Down
20 changes: 3 additions & 17 deletions src/Foundation/PackageManifest.php
Original file line number Diff line number Diff line change
Expand Up @@ -28,11 +28,8 @@ class PackageManifest extends IlluminatePackageManifest
];

/**
* Create a new package manifest instance.
* {@inheritDoc}
*
* @param \Illuminate\Filesystem\Filesystem $files
* @param string $basePath
* @param string $manifestPath
* @param \Orchestra\Testbench\Contracts\TestCase|object|null $testbench
*/
public function __construct(Filesystem $files, $basePath, $manifestPath, $testbench = null)
Expand Down Expand Up @@ -86,11 +83,7 @@ public function requires(...$packages)
return $this;
}

/**
* Get the current package manifest.
*
* @return array
*/
/** {@inheritDoc} */
protected function getManifest()
{
$ignore = ! \is_null($this->testbench) && method_exists($this->testbench, 'ignorePackageDiscoveriesFrom')
Expand Down Expand Up @@ -144,14 +137,7 @@ protected function providersFromRoot()
];
}

/**
* Write the given manifest array to disk.
*
* @param array $manifest
* @return void
*
* @throws \Exception
*/
/** {@inheritDoc} */
protected function write(array $manifest)
{
parent::write(
Expand Down
7 changes: 1 addition & 6 deletions src/TestCase.php
Original file line number Diff line number Diff line change
Expand Up @@ -148,12 +148,7 @@ public static function tearDownAfterClass(): void
static::tearDownAfterClassUsingPHPUnit();
}

/**
* This method is called when a test method did not execute successfully.
*
* @param \Throwable $exception
* @return void
*/
/** {@inheritDoc} */
protected function onNotSuccessfulTest(Throwable $exception): void
{
parent::onNotSuccessfulTest(
Expand Down

0 comments on commit 4e2224b

Please sign in to comment.