for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
declare(strict_types=1);
namespace Hyde\Testing;
use Hyde\Facades\Filesystem;
use Hyde\Hyde;
trait ResetsApplication
{
protected function resetApplication(): void
$this->resetMedia();
Hyde\Testing\ResetsApplication::resetMedia()
If this is a false-positive, you can also ignore this issue in your code via the ignore-deprecated annotation
ignore-deprecated
/** @scrutinizer ignore-deprecated */ $this->resetMedia();
This function has been deprecated. The supplier of the function has supplied an explanatory message.
The explanatory message should give you some clue as to whether and when the function will be removed and what other function to use instead.
$this->resetPages();
$this->resetPosts();
$this->resetDocs();
$this->resetSite();
}
/** @deprecated unless applicable usages are found */
protected function resetMedia(): void
//
protected function resetPages(): void
array_map('\Hyde\Testing\TestCase::unlinkUnlessDefault', glob(Hyde::path('_pages/*.md')));
array_map('\Hyde\Testing\TestCase::unlinkUnlessDefault', glob(Hyde::path('_pages/*.blade.php')));
protected function resetPosts(): void
array_map('\Hyde\Testing\TestCase::unlinkUnlessDefault', glob(Hyde::path('_posts/*.md')));
protected function resetDocs(): void
array_map('\Hyde\Testing\TestCase::unlinkUnlessDefault', glob(Hyde::path('_docs/*.md')));
protected function resetSite(): void
Filesystem::cleanDirectory('_site');
protected function withoutDefaultPages(): void
Hyde::unlink('_pages/404.blade.php');
Hyde::unlink('_pages/index.blade.php');
protected function restoreDefaultPages(): void
copy(Hyde::vendorPath('resources/views/homepages/welcome.blade.php'), Hyde::path('_pages/index.blade.php'));
copy(Hyde::vendorPath('resources/views/pages/404.blade.php'), Hyde::path('_pages/404.blade.php'));
protected static function unlinkUnlessDefault(string $filepath): void
$protected = [
'app.css',
'index.blade.php',
'404.blade.php',
'.gitkeep',
];
if (! in_array(basename($filepath), $protected)) {
unlink($filepath);
This function has been deprecated. The supplier of the function has supplied an explanatory message.
The explanatory message should give you some clue as to whether and when the function will be removed and what other function to use instead.