1. Go to this page and download the library: Download symplify/skipper library. Choose the download type require.
2. Extract the ZIP file and open the index.php.
3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
symplify / skipper example snippets
use Symfony\Component\DependencyInjection\Loader\Configurator\ContainerConfigurator;
use Symplify\Skipper\ValueObject\SkipperConfig;
return static function (ContainerConfigurator $containerConfigurator): void {
$containerConfigurator->import(SkipperConfig::FILE_PATH);
};
use Symfony\Component\DependencyInjection\Loader\Configurator\ContainerConfigurator;
use Symplify\Skipper\ValueObject\Option;
return static function (ContainerConfigurator $containerConfigurator): void {
$parameters = $containerConfigurator->parameters();
$parameters->set(Option::SKIP, [
// absolute directory
__DIR__ . '/some-path',
// absolute file
__DIR__ . '/some-path/some-file.php',
// with mask
'*/Fixture/*',
// specific class
SomeClass::class,
]);
};
use Symfony\Component\DependencyInjection\Loader\Configurator\ContainerConfigurator;
use Symplify\Skipper\ValueObject\Option;
return static function (ContainerConfigurator $containerConfigurator): void {
$parameters = $containerConfigurator->parameters();
$parameters->set(Option::SKIP, [
// specific class
SomeClass::class => [__DIR__ . '/src/OnlyHere'],
// class code in paths
SomeSniff::class . '.SomeCode' => ['*Sniff.php', '*YamlFileLoader.php'],
]);
};
use Symplify\Skipper\Skipper\Skipper;
use Symplify\SmartFileSystem\SmartFileInfo;
final class SomeClass
{
/**
* @var Skipper
*/
private $skipper;
public function __construct(Skipper $skipper)
{
$this->skipper = $skipper;
}
public function run(string|object $element, SmartFileInfo $fileInfo): void
{
// 1. skip the element?
$shouldBeSkipped = $this->skipper->shouldSkipElement($element);
// 2. skip the file path?
$shouldBeSkipped = $this->skipper->shouldSkipFileInfo($fileInfo);
// 3. skip the element in the file path?
$shouldBeSkipped = $this->skipper->shouldSkipElementAndFileInfo($element, $fileInfo);
}
}
Loading please wait ...
Before you can download the PHP files, the dependencies should be resolved. This can take some minutes. Please be patient.