prefix stringlengths 512 512 | suffix stringlengths 256 256 | middle stringlengths 14 229 | meta dict |
|---|---|---|---|
part of the Symfony package.
*
* (c) Fabien Potencier <fabien@symfony.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Symfony\Component\HttpKernel\Bundle;
use Symfony\Component\DependencyInjection\ContainerBuilder;... | ) {
}
public function boot(): void
{
$this->bundle->boot();
}
public function shutdown(): void
{
$this->bundle->shutdown();
}
public function build(ContainerBuilder $container): void
{
$this | terface as BaseBundleInterface;
/**
* @internal
*/
final class BundleAdapter implements BundleInterface
{
private string $namespace;
public function __construct(
private readonly BaseBundleInterface $bundle,
| {
"filepath": "src/Symfony/Component/HttpKernel/Bundle/BundleAdapter.php",
"language": "php",
"file_size": 1702,
"cut_index": 537,
"middle_length": 229
} |
ge.
*
* (c) Fabien Potencier <fabien@symfony.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Symfony\Component\HttpKernel\Tests\DependencyInjection;
use PHPUnit\Framework\TestCase;
use Symfony\Component\DependencyIn... | public function testCompilerPass()
{
$container = new ContainerBuilder();
$container->register('locale_aware_listener', LocaleAwareListener::class)
->setPublic(true)
->setArguments([null, null]);
| njection\RegisterLocaleAwareServicesPass;
use Symfony\Component\HttpKernel\EventListener\LocaleAwareListener;
use Symfony\Contracts\Translation\LocaleAwareInterface;
class RegisterLocaleAwareServicesPassTest extends TestCase
{
| {
"filepath": "src/Symfony/Component/HttpKernel/Tests/DependencyInjection/RegisterLocaleAwareServicesPassTest.php",
"language": "php",
"file_size": 2374,
"cut_index": 563,
"middle_length": 229
} |
ge.
*
* (c) Fabien Potencier <fabien@symfony.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Symfony\Component\HttpKernel\Tests\DependencyInjection;
use PHPUnit\Framework\TestCase;
use Symfony\Component\DependencyIn... | \FragmentRendererInterface;
class FragmentRendererPassTest extends TestCase
{
/**
* Tests that content rendering not implementing FragmentRendererInterface
* triggers an exception.
*/
public function testContentRendererWithoutInterf | ion\ServiceLocator;
use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\HttpFoundation\Response;
use Symfony\Component\HttpKernel\DependencyInjection\FragmentRendererPass;
use Symfony\Component\HttpKernel\Fragment | {
"filepath": "src/Symfony/Component/HttpKernel/Tests/DependencyInjection/FragmentRendererPassTest.php",
"language": "php",
"file_size": 2717,
"cut_index": 563,
"middle_length": 229
} |
This file is part of the Symfony package.
*
* (c) Fabien Potencier <fabien@symfony.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Symfony\Component\HttpKernel\Event;
use Symfony\Component\HttpFoundation\Response;
... | c function getResponse(): ?Response
{
return $this->response;
}
/**
* Sets a response and stops event propagation.
*/
public function setResponse(Response $response): void
{
$this->response = $response;
| on as a
* response is set.
*
* @author Bernhard Schussek <bschussek@gmail.com>
*/
class RequestEvent extends KernelEvent
{
private ?Response $response = null;
/**
* Returns the response object.
*/
publi | {
"filepath": "src/Symfony/Component/HttpKernel/Event/RequestEvent.php",
"language": "php",
"file_size": 1262,
"cut_index": 524,
"middle_length": 229
} |
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Symfony\Component\HttpKernel\Tests\DependencyInjection;
use PHPUnit\Framework\TestCase;
use Symfony\Component\DependencyInjection\Compiler\ResolveInvalidReferencesPass;
use ... | ntainer = new ContainerBuilder();
$resolver = $container->register('argument_resolver.service')->addArgument([]);
$container->register('stdClass', 'stdClass');
$container->register(TestCase::class, 'stdClass');
$container-> | torsPass;
use Symfony\Component\HttpKernel\DependencyInjection\RemoveEmptyControllerArgumentLocatorsPass;
class RemoveEmptyControllerArgumentLocatorsPassTest extends TestCase
{
public function testProcess()
{
$co | {
"filepath": "src/Symfony/Component/HttpKernel/Tests/DependencyInjection/RemoveEmptyControllerArgumentLocatorsPassTest.php",
"language": "php",
"file_size": 4308,
"cut_index": 614,
"middle_length": 229
} |
This file is part of the Symfony package.
*
* (c) Fabien Potencier <fabien@symfony.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Symfony\Component\Workflow\Attribute;
use Symfony\Component\EventDispatcher\Attribu... | ring|null $place The place name to which the listener listens to
* @param string|null $method The method to run when the listened event is triggered
* @param int $priority The priority of this listener if several are declared f | :TARGET_METHOD | \Attribute::IS_REPEATABLE)]
final class AsEnteredListener extends AsEventListener
{
use BuildEventNameTrait;
/**
* @param string|null $workflow The id of the workflow to listen to
* @param st | {
"filepath": "src/Symfony/Component/Workflow/Attribute/AsEnteredListener.php",
"language": "php",
"file_size": 1459,
"cut_index": 524,
"middle_length": 229
} |
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Symfony\Component\Workflow\DataCollector;
use Symfony\Component\ErrorHandler\ErrorRenderer\FileLinkFormatter;
use Symfony\Component\EventDispatcher\EventDispatcherInterface;... | ableWorkflow;
use Symfony\Component\Workflow\Dumper\MermaidDumper;
use Symfony\Component\Workflow\Marking;
use Symfony\Component\Workflow\TransitionBlocker;
use Symfony\Component\Workflow\WorkflowInterface;
/**
* @author Grégoire Pineau <lyrixx@lyrixx.in | aCollector\LateDataCollectorInterface;
use Symfony\Component\VarDumper\Caster\Caster;
use Symfony\Component\VarDumper\Cloner\Stub;
use Symfony\Component\Workflow\Debug\ListenerExtractor;
use Symfony\Component\Workflow\Debug\Trace | {
"filepath": "src/Symfony/Component/Workflow/DataCollector/WorkflowDataCollector.php",
"language": "php",
"file_size": 4889,
"cut_index": 614,
"middle_length": 229
} |
ow = new Workflow(new Definition([], []), new MethodMarkingStore());
$workflow->getMarking($subject);
}
public function testGetMarkingWithImpossiblePlace()
{
$this->expectException(LogicException::class);
$this->expectExceptionMessage('Place "nope" is not valid for workflow "unname... | nition, new MethodMarkingStore());
$marking = $workflow->getMarking($subject);
$this->assertInstanceOf(Marking::class, $marking);
$this->assertTrue($marking->has('a'));
$this->assertSame(['a' => 1], $subject->getMarking()) | tMarking($subject);
}
public function testGetMarkingWithEmptyInitialMarking()
{
$definition = $this->createComplexWorkflowDefinition();
$subject = new Subject();
$workflow = new Workflow($defi | {
"filepath": "src/Symfony/Component/Workflow/Tests/WorkflowTest.php",
"language": "php",
"file_size": 41723,
"cut_index": 2151,
"middle_length": 229
} |
buted with this source code.
*/
namespace Symfony\Component\Workflow\Tests\MarkingStore;
use PHPUnit\Framework\TestCase;
use Symfony\Component\Workflow\MarkingStore\MethodMarkingStore;
use Symfony\Component\Workflow\Tests\Subject;
class MethodMarkingStoreTest extends TestCase
{
public function testGetSetMarking... | $this->assertSame(['foo' => 'bar'], $subject->getContext());
$marking2 = $markingStore->getMarking($subject);
$this->assertEquals($marking, $marking2);
}
public function testGetSetMarkingWithSingleState()
{
$subjec | ertCount(0, $marking->getPlaces());
$marking->mark('first_place');
$markingStore->setMarking($subject, $marking, ['foo' => 'bar']);
$this->assertSame(['first_place' => 1], $subject->getMarking());
| {
"filepath": "src/Symfony/Component/Workflow/Tests/MarkingStore/MethodMarkingStoreTest.php",
"language": "php",
"file_size": 7798,
"cut_index": 716,
"middle_length": 229
} |
buted with this source code.
*/
namespace Symfony\Component\Workflow\Tests\MarkingStore;
use PHPUnit\Framework\TestCase;
use Symfony\Component\Workflow\MarkingStore\MethodMarkingStore;
class PropertiesMarkingStoreTest extends TestCase
{
public function testGetSetMarkingWithMultipleState()
{
$subject... | Marking($subject);
$this->assertEquals($marking, $marking2);
}
public function testGetSetMarkingWithSingleState()
{
$subject = new SubjectWithProperties();
$markingStore = new MethodMarkingStore(true, 'place', 'placeCo | es());
$marking->mark('first_place');
$markingStore->setMarking($subject, $marking, ['foo' => 'bar']);
$this->assertSame(['first_place' => 1], $subject->marking);
$marking2 = $markingStore->get | {
"filepath": "src/Symfony/Component/Workflow/Tests/MarkingStore/PropertiesMarkingStoreTest.php",
"language": "php",
"file_size": 5251,
"cut_index": 716,
"middle_length": 229
} |
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Symfony\Component\Workflow\Tests\Attribute;
use PHPUnit\Framework\Attributes\DataProvider;
use PHPUnit\Framework\TestCase;
use Symfony\Component\Workflow\Attribute;
use Symf... |
{
yield [Attribute\AsAnnounceListener::class, 'workflow.announce'];
yield [Attribute\AsAnnounceListener::class, 'workflow.w.announce', 'w'];
yield [Attribute\AsAnnounceListener::class, 'workflow.w.announce.n', 'w', 'n'];
| ?string $workflow = null, ?string $node = null)
{
$attribute = new $class($workflow, $node);
$this->assertSame($expectedEvent, $attribute->event);
}
public static function provideOkTests(): iterable | {
"filepath": "src/Symfony/Component/Workflow/Tests/Attribute/AsListenerTest.php",
"language": "php",
"file_size": 3766,
"cut_index": 614,
"middle_length": 229
} |
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Symfony\Component\Workflow\Tests\DataCollector;
use PHPUnit\Framework\TestCase;
use Symfony\Component\ErrorHandler\ErrorRenderer\FileLinkFormatter;
use Symfony\Component\Eve... | ollector\WorkflowDataCollector;
use Symfony\Component\Workflow\EventListener\ExpressionLanguage;
use Symfony\Component\Workflow\EventListener\GuardListener;
use Symfony\Component\Workflow\Tests\WorkflowBuilderTrait;
use Symfony\Component\Workflow\Workflow; | rage;
use Symfony\Component\Security\Core\Authorization\AuthorizationCheckerInterface;
use Symfony\Component\Security\Core\Role\RoleHierarchy;
use Symfony\Component\Validator\ValidatorBuilder;
use Symfony\Component\Workflow\DataC | {
"filepath": "src/Symfony/Component/Workflow/Tests/DataCollector/WorkflowDataCollectorTest.php",
"language": "php",
"file_size": 4609,
"cut_index": 614,
"middle_length": 229
} |
?php
/*
* This file is part of the Symfony package.
*
* (c) Fabien Potencier <fabien@symfony.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Symfony\Component\Workflow\Tests\SupportStrategy;
use PHPUnit\Framework\... | );
}
public function testSupportsIfNotClassInstance()
{
$strategy = new InstanceOfSupportStrategy(Subject2::class);
$this->assertFalse($strategy->supports($this->createStub(WorkflowInterface::class), new Subject1()));
}
}
| public function testSupportsIfClassInstance()
{
$strategy = new InstanceOfSupportStrategy(Subject1::class);
$this->assertTrue($strategy->supports($this->createStub(WorkflowInterface::class), new Subject1()) | {
"filepath": "src/Symfony/Component/Workflow/Tests/SupportStrategy/InstanceOfSupportStrategyTest.php",
"language": "php",
"file_size": 1037,
"cut_index": 513,
"middle_length": 229
} |
buted with this source code.
*/
namespace Symfony\Component\Workflow\Tests\Validator;
use PHPUnit\Framework\TestCase;
use Symfony\Component\Workflow\Arc;
use Symfony\Component\Workflow\Definition;
use Symfony\Component\Workflow\Exception\InvalidDefinitionException;
use Symfony\Component\Workflow\Transition;
use Symf... | ition('t1', 'a', 'b');
$transitions[] = new Transition('t1', 'a', 'c');
$definition = new Definition($places, $transitions);
(new StateMachineValidator())->validate($definition, 'foo');
// The graph looks like:
//
| $this->expectException(InvalidDefinitionException::class);
$this->expectExceptionMessage('A transition from a place/state must have an unique name.');
$places = ['a', 'b', 'c'];
$transitions[] = new Trans | {
"filepath": "src/Symfony/Component/Workflow/Tests/Validator/StateMachineValidatorTest.php",
"language": "php",
"file_size": 5507,
"cut_index": 716,
"middle_length": 229
} |
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Symfony\Component\Workflow\Tests\Validator;
use PHPUnit\Framework\TestCase;
use Symfony\Component\Workflow\Arc;
use Symfony\Component\Workflow\Definition;
use Symfony\Compon... | transitions[] = new Transition('t0', 'c', 'b');
$transitions[] = new Transition('t1', 'a', 'b');
$transitions[] = new Transition('t1', 'a', 'c');
$definition = new Definition($places, $transitions);
$this->expectException( | r\WorkflowValidator;
class WorkflowValidatorTest extends TestCase
{
use WorkflowBuilderTrait;
public function testWorkflowWithInvalidNames()
{
$places = range('a', 'c');
$transitions = [];
$ | {
"filepath": "src/Symfony/Component/Workflow/Tests/Validator/WorkflowValidatorTest.php",
"language": "php",
"file_size": 4210,
"cut_index": 614,
"middle_length": 229
} |
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Symfony\Component\Workflow\Tests\Command;
use PHPUnit\Framework\Attributes\DataProvider;
use PHPUnit\Framework\TestCase;
use Symfony\Component\Console\Application;
use Symfo... | nsition;
use Symfony\Component\Workflow\Workflow;
class WorkflowDumpCommandTest extends TestCase
{
#[DataProvider('provideCompletionSuggestions')]
public function testComplete(array $input, array $expectedSuggestions)
{
$application = | \DependencyInjection\ServiceLocator;
use Symfony\Component\EventDispatcher\EventDispatcher;
use Symfony\Component\Workflow\Command\WorkflowDumpCommand;
use Symfony\Component\Workflow\Definition;
use Symfony\Component\Workflow\Tra | {
"filepath": "src/Symfony/Component/Workflow/Tests/Command/WorkflowDumpCommandTest.php",
"language": "php",
"file_size": 3797,
"cut_index": 614,
"middle_length": 229
} |
part of the Symfony package.
*
* (c) Fabien Potencier <fabien@symfony.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Symfony\Component\Workflow\Tests\EventListener;
use PHPUnit\Framework\TestCase;
use Psr\Log\Abst... |
public function testItWorks()
{
$definition = $this->createSimpleWorkflowDefinition();
$object = new Subject();
$logger = new Logger();
$ed = new EventDispatcher();
$ed->addSubscriber(new AuditTrailListen | re;
use Symfony\Component\Workflow\Tests\Subject;
use Symfony\Component\Workflow\Tests\WorkflowBuilderTrait;
use Symfony\Component\Workflow\Workflow;
class AuditTrailListenerTest extends TestCase
{
use WorkflowBuilderTrait;
| {
"filepath": "src/Symfony/Component/Workflow/Tests/EventListener/AuditTrailListenerTest.php",
"language": "php",
"file_size": 1786,
"cut_index": 537,
"middle_length": 229
} |
buted with this source code.
*/
namespace Symfony\Component\Workflow\Tests\EventListener;
use PHPUnit\Framework\TestCase;
use Symfony\Component\Security\Core\Authentication\AuthenticationTrustResolverInterface;
use Symfony\Component\Security\Core\Authentication\Token\Storage\TokenStorage;
use Symfony\Component\Secur... | Symfony\Component\Validator\ValidatorBuilder;
use Symfony\Component\Workflow\Event\GuardEvent;
use Symfony\Component\Workflow\EventListener\ExpressionLanguage;
use Symfony\Component\Workflow\EventListener\GuardExpression;
use Symfony\Component\Workflow\Eve | e Symfony\Component\Security\Core\User\InMemoryUser;
use Symfony\Component\Validator\ConstraintViolation;
use Symfony\Component\Validator\ConstraintViolationList;
use Symfony\Component\Validator\Validator\ValidatorInterface;
use | {
"filepath": "src/Symfony/Component/Workflow/Tests/EventListener/GuardListenerTest.php",
"language": "php",
"file_size": 6650,
"cut_index": 716,
"middle_length": 229
} |
ge.
*
* (c) Fabien Potencier <fabien@symfony.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Symfony\Component\Workflow\Tests\Event;
use PHPUnit\Framework\Attributes\DataProvider;
use PHPUnit\Framework\TestCase;
use... | class-string $class
*/
#[DataProvider('getEvents')]
public function testEventNames(string $class, ?string $workflowName, ?string $transitionOrPlaceName, string $expected)
{
$name = $class::getName($workflowName, $transitionOrPlaceN | terEvent;
use Symfony\Component\Workflow\Event\GuardEvent;
use Symfony\Component\Workflow\Event\LeaveEvent;
use Symfony\Component\Workflow\Event\TransitionEvent;
class EventNameTraitTest extends TestCase
{
/**
* @param | {
"filepath": "src/Symfony/Component/Workflow/Tests/Event/EventNameTraitTest.php",
"language": "php",
"file_size": 3033,
"cut_index": 563,
"middle_length": 229
} |
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Symfony\Component\Workflow\Tests\Debug;
use PHPUnit\Framework\TestCase;
use Symfony\Component\ErrorHandler\ErrorRenderer\FileLinkFormatter;
use Symfony\Component\EventDispat... | rExtractor;
use Symfony\Component\Workflow\EventListener\ExpressionLanguage;
use Symfony\Component\Workflow\EventListener\GuardListener;
use Symfony\Component\Workflow\Tests\WorkflowBuilderTrait;
use Symfony\Component\Workflow\Workflow;
class ListenerExtr | e Symfony\Component\Security\Core\Authorization\AuthorizationCheckerInterface;
use Symfony\Component\Security\Core\Role\RoleHierarchy;
use Symfony\Component\Validator\ValidatorBuilder;
use Symfony\Component\Workflow\Debug\Listene | {
"filepath": "src/Symfony/Component/Workflow/Tests/Debug/ListenerExtractorTest.php",
"language": "php",
"file_size": 4009,
"cut_index": 614,
"middle_length": 229
} |
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Symfony\Component\Workflow\Tests\Debug;
use PHPUnit\Framework\Attributes\DataProvider;
use PHPUnit\Framework\MockObject\MockObject;
use PHPUnit\Framework\TestCase;
use Symfo... | function setUp(): void
{
$this->innerWorkflow = $this->createMock(Workflow::class);
$this->stopwatch = new Stopwatch();
$this->traceableWorkflow = new TraceableWorkflow(
$this->innerWorkflow,
$this->sto | ony\Component\Workflow\Workflow;
class TraceableWorkflowTest extends TestCase
{
private MockObject&Workflow $innerWorkflow;
private Stopwatch $stopwatch;
private TraceableWorkflow $traceableWorkflow;
protected | {
"filepath": "src/Symfony/Component/Workflow/Tests/Debug/TraceableWorkflowTest.php",
"language": "php",
"file_size": 3490,
"cut_index": 614,
"middle_length": 229
} |
ge.
*
* (c) Fabien Potencier <fabien@symfony.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Symfony\Component\Workflow\Tests\Metadata;
use PHPUnit\Framework\TestCase;
use Symfony\Component\Workflow\Metadata\InMemor... | => [
'title' => 'place_a title',
],
];
$transitionsMetadata = new \SplObjectStorage();
$this->transition = new Transition('transition_1', [], []);
$transitionsMetadata[$this->transition] = [
| ataStore $store;
private Transition $transition;
protected function setUp(): void
{
$workflowMetadata = [
'title' => 'workflow title',
];
$placesMetadata = [
'place_a' | {
"filepath": "src/Symfony/Component/Workflow/Tests/Metadata/InMemoryMetadataStoreTest.php",
"language": "php",
"file_size": 2967,
"cut_index": 563,
"middle_length": 229
} |
c function testDumpWithoutMarking($definition, $expected, $withMetadata)
{
$dump = (new GraphvizDumper())->dump($definition, null, ['with-metadata' => $withMetadata]);
$this->assertEquals($expected, $dump);
}
#[DataProvider('provideWorkflowDefinitionWithMarking')]
public function testD... | , false];
yield [self::createSimpleWorkflowDefinition(), self::provideSimpleWorkflowDumpWithoutMarking(), false];
yield [self::createComplexWorkflowDefinition(), self::provideComplexWorkflowDumpWithoutMarkingWithMetadata(), true];
y | ssertEquals($expected, $dump);
}
public static function provideWorkflowDefinitionWithoutMarking(): \Generator
{
yield [self::createComplexWorkflowDefinition(), self::provideComplexWorkflowDumpWithoutMarking() | {
"filepath": "src/Symfony/Component/Workflow/Tests/Dumper/GraphvizDumperTest.php",
"language": "php",
"file_size": 28485,
"cut_index": 1331,
"middle_length": 229
} |
buted with this source code.
*/
namespace Symfony\Component\Workflow\MarkingStore;
use Symfony\Component\Workflow\Exception\LogicException;
use Symfony\Component\Workflow\Marking;
/**
* MethodMarkingStore stores the marking with a subject's public method
* or public property.
*
* This store deals with a "single... |
final class MethodMarkingStore implements MarkingStoreInterface
{
/** @var array<class-string, \Closure(object): mixed> */
private array $getters = [];
/** @var array<class-string, \Closure(object, mixed, array)> */
private array $setters |
* marking.
*
* "multiple state" marking means a subject can be in many states at the same
* time. Use it with workflow. It uses an array of strings to store the marking.
*
* @author Grégoire Pineau <lyrixx@lyrixx.info>
*/ | {
"filepath": "src/Symfony/Component/Workflow/MarkingStore/MethodMarkingStore.php",
"language": "php",
"file_size": 5458,
"cut_index": 716,
"middle_length": 229
} |
he Symfony package.
*
* (c) Fabien Potencier <fabien@symfony.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Symfony\Component\Workflow\MarkingStore;
use Symfony\Component\Workflow\Marking;
/**
* MarkingStoreInter... | /
interface MarkingStoreInterface
{
/**
* Gets a Marking from a subject.
*/
public function getMarking(object $subject): Marking;
/**
* Sets a Marking to a subject.
*/
public function setMarking(object $subject, Marking | *
* @author Grégoire Pineau <lyrixx@lyrixx.info>
* | {
"filepath": "src/Symfony/Component/Workflow/MarkingStore/MarkingStoreInterface.php",
"language": "php",
"file_size": 897,
"cut_index": 547,
"middle_length": 52
} |
/*
* This file is part of the Symfony package.
*
* (c) Fabien Potencier <fabien@symfony.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Symfony\Component\Workflow\Exception;
use Symfony\Component\Workflow\Workflow... | essage);
}
public function getSubject(): object
{
return $this->subject;
}
public function getTransitionName(): string
{
return $this->transitionName;
}
public function getWorkflow(): WorkflowInterface
| construct(
private object $subject,
private string $transitionName,
private WorkflowInterface $workflow,
string $message,
private array $context = [],
) {
parent::__construct($m | {
"filepath": "src/Symfony/Component/Workflow/Exception/TransitionException.php",
"language": "php",
"file_size": 1131,
"cut_index": 518,
"middle_length": 229
} |
This file is part of the Symfony package.
*
* (c) Fabien Potencier <fabien@symfony.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Symfony\Component\Workflow\Attribute;
use Symfony\Component\EventDispatcher\Attribu... | m string|null $transition The transition name to which the listener listens to
* @param string|null $method The method to run when the listened event is triggered
* @param int $priority The priority of this listener if several are d | e::TARGET_METHOD | \Attribute::IS_REPEATABLE)]
final class AsCompletedListener extends AsEventListener
{
use BuildEventNameTrait;
/**
* @param string|null $workflow The id of the workflow to listen to
* @para | {
"filepath": "src/Symfony/Component/Workflow/Attribute/AsCompletedListener.php",
"language": "php",
"file_size": 1490,
"cut_index": 524,
"middle_length": 229
} |
This file is part of the Symfony package.
*
* (c) Fabien Potencier <fabien@symfony.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Symfony\Component\Workflow\Attribute;
use Symfony\Component\EventDispatcher\Attribu... | |null $place The place name to which the listener listens to
* @param string|null $method The method to run when the listened event is triggered
* @param int $priority The priority of this listener if several are declared for t | ARGET_METHOD | \Attribute::IS_REPEATABLE)]
final class AsEnterListener extends AsEventListener
{
use BuildEventNameTrait;
/**
* @param string|null $workflow The id of the workflow to listen to
* @param string | {
"filepath": "src/Symfony/Component/Workflow/Attribute/AsEnterListener.php",
"language": "php",
"file_size": 1453,
"cut_index": 524,
"middle_length": 229
} |
This file is part of the Symfony package.
*
* (c) Fabien Potencier <fabien@symfony.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Symfony\Component\Workflow\Attribute;
use Symfony\Component\EventDispatcher\Attribu... | string|null $transition The transition name to which the listener listens to
* @param string|null $method The method to run when the listened event is triggered
* @param int $priority The priority of this listener if several are dec | TARGET_METHOD | \Attribute::IS_REPEATABLE)]
final class AsTransitionListener extends AsEventListener
{
use BuildEventNameTrait;
/**
* @param string|null $workflow The id of the workflow to listen to
* @param | {
"filepath": "src/Symfony/Component/Workflow/Attribute/AsTransitionListener.php",
"language": "php",
"file_size": 1489,
"cut_index": 524,
"middle_length": 229
} |
hp
/*
* This file is part of the Symfony package.
*
* (c) Fabien Potencier <fabien@symfony.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Symfony\Component\Workflow\Attribute;
use Symfony\Component\Workflow\Excep... | without a "workflow" argument.', $argument, self::class));
}
return \sprintf('workflow.%s', $keyword);
}
if (null === $node) {
return \sprintf('workflow.%s.%s', $workflow, $keyword);
}
| gument, ?string $workflow = null, ?string $node = null): string
{
if (null === $workflow) {
if (null !== $node) {
throw new LogicException(\sprintf('The "%s" argument of "%s" cannot be used | {
"filepath": "src/Symfony/Component/Workflow/Attribute/BuildEventNameTrait.php",
"language": "php",
"file_size": 1076,
"cut_index": 515,
"middle_length": 229
} |
file is part of the Symfony package.
*
* (c) Fabien Potencier <fabien@symfony.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Symfony\Component\Workflow\SupportStrategy;
use Symfony\Component\Workflow\WorkflowInter... | private string $className,
) {
}
public function supports(WorkflowInterface $workflow, object $subject): bool
{
return $subject instanceof $this->className;
}
public function getClassName(): string
{
return $t | Interface
{
public function __construct(
| {
"filepath": "src/Symfony/Component/Workflow/SupportStrategy/InstanceOfSupportStrategy.php",
"language": "php",
"file_size": 861,
"cut_index": 529,
"middle_length": 52
} |
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Symfony\Component\Workflow\Validator;
use Symfony\Component\Workflow\Definition;
use Symfony\Component\Workflow\Exception\InvalidDefinitionException;
/**
* @author Tobias ... | s($definition->getPlaces(), []);
foreach ($definition->getTransitions() as $transition) {
foreach ($transition->getFroms(true) as $arc) {
$from = $arc->place;
if (\in_array($transition->getName(), $places | private bool $singlePlace = false,
) {
}
public function validate(Definition $definition, string $name): void
{
// Make sure all transitions for one place has unique name.
$places = array_fill_key | {
"filepath": "src/Symfony/Component/Workflow/Validator/WorkflowValidator.php",
"language": "php",
"file_size": 3063,
"cut_index": 614,
"middle_length": 229
} |
buted with this source code.
*/
namespace Symfony\Component\Workflow\Command;
use Symfony\Component\Console\Attribute\AsCommand;
use Symfony\Component\Console\Command\Command;
use Symfony\Component\Console\Completion\CompletionInput;
use Symfony\Component\Console\Completion\CompletionSuggestions;
use Symfony\Compone... | rkflow;
use Symfony\Component\Workflow\Dumper\GraphvizDumper;
use Symfony\Component\Workflow\Dumper\MermaidDumper;
use Symfony\Component\Workflow\Dumper\PlantUmlDumper;
use Symfony\Component\Workflow\Dumper\StateMachineGraphvizDumper;
use Symfony\Component | ption;
use Symfony\Component\Console\Output\OutputInterface;
use Symfony\Component\EventDispatcher\EventDispatcherInterface;
use Symfony\Component\Workflow\Debug\ListenerExtractor;
use Symfony\Component\Workflow\Debug\TraceableWo | {
"filepath": "src/Symfony/Component/Workflow/Command/WorkflowDumpCommand.php",
"language": "php",
"file_size": 6011,
"cut_index": 716,
"middle_length": 229
} |
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Symfony\Component\Workflow\EventListener;
use Symfony\Component\Security\Core\Authentication\AuthenticationTrustResolverInterface;
use Symfony\Component\Security\Core\Authen... | Listener
{
public function __construct(
private array $configuration,
private ExpressionLanguage $expressionLanguage,
private TokenStorageInterface $tokenStorage,
private AuthorizationCheckerInterface $authorizationCheck | use Symfony\Component\Validator\Validator\ValidatorInterface;
use Symfony\Component\Workflow\Event\GuardEvent;
use Symfony\Component\Workflow\TransitionBlocker;
/**
* @author Grégoire Pineau <lyrixx@lyrixx.info>
*/
class Guard | {
"filepath": "src/Symfony/Component/Workflow/EventListener/GuardListener.php",
"language": "php",
"file_size": 3367,
"cut_index": 614,
"middle_length": 229
} |
<?php
/*
* This file is part of the Symfony package.
*
* (c) Fabien Potencier <fabien@symfony.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Symfony\Component\Workflow\Tests;
use PHPUnit\Framework\TestCase;
use S... | lass);
$this->expectExceptionMessage('The weight must be greater than 0, 0 given.');
new Arc('not empty', 0);
}
public function testConstructorWithZeroPlaceName()
{
$arc = new Arc('0', 1);
$this->assertEquals(' | );
$this->expectExceptionMessage('The place name cannot be empty.');
new Arc('', 1);
}
public function testConstructorWithInvalidWeight()
{
$this->expectException(\InvalidArgumentException::c | {
"filepath": "src/Symfony/Component/Workflow/Tests/ArcTest.php",
"language": "php",
"file_size": 1023,
"cut_index": 512,
"middle_length": 229
} |
ge.
*
* (c) Fabien Potencier <fabien@symfony.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Symfony\Component\Workflow\Tests;
use PHPUnit\Framework\TestCase;
use Symfony\Component\Workflow\Definition;
use Symfony\C... | tialPlace()
{
$places = range('a', 'e');
$definition = new Definition($places, [], $places[3]);
$this->assertEquals([$places[3]], $definition->getInitialPlaces());
}
public function testSetInitialPlaces()
{
| e('a', 'e');
$definition = new Definition($places, []);
$this->assertCount(5, $definition->getPlaces());
$this->assertEquals(['a'], $definition->getInitialPlaces());
}
public function testSetIni | {
"filepath": "src/Symfony/Component/Workflow/Tests/DefinitionTest.php",
"language": "php",
"file_size": 2377,
"cut_index": 563,
"middle_length": 229
} |
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Symfony\Component\Workflow\Tests;
use PHPUnit\Framework\TestCase;
use Symfony\Component\EventDispatcher\EventDispatcher;
use Symfony\Component\Workflow\Definition;
use Symfo... | istry = new Registry();
$this->registry->addWorkflow(new Workflow(new Definition([], []), $this->createStub(MarkingStoreInterface::class), new EventDispatcher(), 'workflow1'), $this->createWorkflowSupportStrategy(Subject1::class));
$this-> | flow\SupportStrategy\WorkflowSupportStrategyInterface;
use Symfony\Component\Workflow\Workflow;
class RegistryTest extends TestCase
{
private Registry $registry;
protected function setUp(): void
{
$this->reg | {
"filepath": "src/Symfony/Component/Workflow/Tests/RegistryTest.php",
"language": "php",
"file_size": 4480,
"cut_index": 614,
"middle_length": 229
} |
part of the Symfony package.
*
* (c) Fabien Potencier <fabien@symfony.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Symfony\Component\Workflow\Tests;
use PHPUnit\Framework\Attributes\DataProvider;
use PHPUnit\Fra... | Tests')]
public function testConstructor(mixed $froms, mixed $tos)
{
$transition = new Transition('name', $froms, $tos);
$this->assertSame('name', $transition->getName());
$this->assertCount(1, $transition->getFroms(true)); | terable
{
yield 'plain strings' => ['a', 'b'];
yield 'array of strings' => [['a'], ['b']];
yield 'array of arcs' => [[new Arc('a', 1)], [new Arc('b', 1)]];
}
#[DataProvider('provideConstructor | {
"filepath": "src/Symfony/Component/Workflow/Tests/TransitionTest.php",
"language": "php",
"file_size": 1863,
"cut_index": 537,
"middle_length": 229
} |
t\Workflow\Transition;
trait WorkflowBuilderTrait
{
private static function createComplexWorkflowDefinition(): Definition
{
$places = range('a', 'g');
$transitions = [];
$transitions[] = new Transition('t1', 'a', ['b', 'c']);
$transitions[] = new Transition('t2', ['b', 'c'], 'd... | pStyle] = [
'label' => 'My custom transition label 1',
'color' => 'Red',
'arrow_color' => 'Green',
];
$inMemoryMetadataStore = new InMemoryMetadataStore([], [], $transitionsMetadata);
return new | );
$transitions[] = new Transition('t5', 'e', 'g');
$transitions[] = new Transition('t6', 'f', 'g');
$transitionsMetadata = new \SplObjectStorage();
$transitionsMetadata[$transitionWithMetadataDum | {
"filepath": "src/Symfony/Component/Workflow/Tests/WorkflowBuilderTrait.php",
"language": "php",
"file_size": 10867,
"cut_index": 921,
"middle_length": 229
} |
hp
/*
* This file is part of the Symfony package.
*
* (c) Fabien Potencier <fabien@symfony.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Symfony\Component\Workflow\Exception;
use Symfony\Component\Workflow\Trans... | ransitionBlockerList,
array $context = [],
) {
parent::__construct($subject, $transitionName, $workflow, \sprintf('Cannot apply transition "%s" on workflow "%s".', $transitionName, $workflow->getName()), $context);
}
public fun | s NotEnabledTransitionException extends TransitionException
{
public function __construct(
object $subject,
string $transitionName,
WorkflowInterface $workflow,
private TransitionBlockerList $t | {
"filepath": "src/Symfony/Component/Workflow/Exception/NotEnabledTransitionException.php",
"language": "php",
"file_size": 1116,
"cut_index": 515,
"middle_length": 229
} |
This file is part of the Symfony package.
*
* (c) Fabien Potencier <fabien@symfony.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Symfony\Component\Workflow\Attribute;
use Symfony\Component\EventDispatcher\Attribu... | string|null $transition The transition name to which the listener listens to
* @param string|null $method The method to run when the listened event is triggered
* @param int $priority The priority of this listener if several are dec | ::TARGET_METHOD | \Attribute::IS_REPEATABLE)]
final class AsAnnounceListener extends AsEventListener
{
use BuildEventNameTrait;
/**
* @param string|null $workflow The id of the workflow to listen to
* @param | {
"filepath": "src/Symfony/Component/Workflow/Attribute/AsAnnounceListener.php",
"language": "php",
"file_size": 1487,
"cut_index": 524,
"middle_length": 229
} |
This file is part of the Symfony package.
*
* (c) Fabien Potencier <fabien@symfony.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Symfony\Component\Workflow\Attribute;
use Symfony\Component\EventDispatcher\Attribu... | |null $place The place name to which the listener listens to
* @param string|null $method The method to run when the listened event is triggered
* @param int $priority The priority of this listener if several are declared for t | ARGET_METHOD | \Attribute::IS_REPEATABLE)]
final class AsLeaveListener extends AsEventListener
{
use BuildEventNameTrait;
/**
* @param string|null $workflow The id of the workflow to listen to
* @param string | {
"filepath": "src/Symfony/Component/Workflow/Attribute/AsLeaveListener.php",
"language": "php",
"file_size": 1453,
"cut_index": 524,
"middle_length": 229
} |
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Symfony\Component\Workflow\Validator;
use Symfony\Component\Workflow\Definition;
use Symfony\Component\Workflow\Exception\InvalidDefinitionException;
/**
* @author Tobias ... | throw new InvalidDefinitionException(\sprintf('A transition in StateMachine can only have one output. But the transition "%s" in StateMachine "%s" has %d outputs.', $transition->getName(), $name, \count($transition->getTos(true))));
}
| $transitionFromNames = [];
foreach ($definition->getTransitions() as $transition) {
// Make sure that each transition has exactly one TO
if (1 !== \count($transition->getTos(true))) {
| {
"filepath": "src/Symfony/Component/Workflow/Validator/StateMachineValidator.php",
"language": "php",
"file_size": 3316,
"cut_index": 614,
"middle_length": 229
} |
part of the Symfony package.
*
* (c) Fabien Potencier <fabien@symfony.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Symfony\Component\Workflow\EventListener;
use Symfony\Component\Security\Core\Authorization\Expr... | rent::registerFunctions();
$this->register('is_granted', static fn ($attributes, $object = 'null') => \sprintf('$auth_checker->isGranted(%s, %s)', $attributes, $object), static fn (array $variables, $attributes, $object = null) => $variables['auth | the default Symfony Security ExpressionLanguage.
*
* @author Fabien Potencier <fabien@symfony.com>
*/
class ExpressionLanguage extends BaseExpressionLanguage
{
protected function registerFunctions(): void
{
pa | {
"filepath": "src/Symfony/Component/Workflow/EventListener/ExpressionLanguage.php",
"language": "php",
"file_size": 1704,
"cut_index": 537,
"middle_length": 229
} |
ge.
*
* (c) Fabien Potencier <fabien@symfony.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Symfony\Component\Workflow\Tests;
use PHPUnit\Framework\TestCase;
use Symfony\Component\Workflow\DefinitionBuilder;
use Sy... | function testAddTransition()
{
$places = range('a', 'b');
$transition0 = new Transition('name0', $places[0], $places[1]);
$transition1 = new Transition('name1', $places[0], $places[1]);
$builder = new DefinitionBuilder( | {
$builder = new DefinitionBuilder(['a', 'b']);
$builder->setInitialPlaces('b');
$definition = $builder->build();
$this->assertEquals(['b'], $definition->getInitialPlaces());
}
public | {
"filepath": "src/Symfony/Component/Workflow/Tests/DefinitionBuilderTest.php",
"language": "php",
"file_size": 2077,
"cut_index": 563,
"middle_length": 229
} |
s part of the Symfony package.
*
* (c) Fabien Potencier <fabien@symfony.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Symfony\Component\Workflow\Tests;
final class Subject
{
private string|array|null $marking;... | this->marking;
}
public function setMarking($marking, array $context = []): void
{
$this->marking = $marking;
$this->context = $context;
}
public function getContext(): array
{
return $this->context;
}
| return $ | {
"filepath": "src/Symfony/Component/Workflow/Tests/Subject.php",
"language": "php",
"file_size": 808,
"cut_index": 536,
"middle_length": 14
} |
part of the Symfony package.
*
* (c) Fabien Potencier <fabien@symfony.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Symfony\Component\Workflow;
use Symfony\Component\Workflow\Exception\LogicException;
use Symfony... | function getMarking(object $subject): Marking;
/**
* Returns true if the transition is enabled.
*/
public function can(object $subject, string $transitionName): bool;
/**
* Builds a TransitionBlockerList to know why a transiti | /**
* Describes a workflow instance.
*
* @author Amrouche Hamza <hamza.simperfit@gmail.com>
*/
interface WorkflowInterface
{
/**
* Returns the object's Marking.
*
* @throws LogicException
*/
public | {
"filepath": "src/Symfony/Component/Workflow/WorkflowInterface.php",
"language": "php",
"file_size": 1921,
"cut_index": 537,
"middle_length": 229
} |
file is part of the Symfony package.
*
* (c) Fabien Potencier <fabien@symfony.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Symfony\Component\Workflow\Exception;
use Symfony\Component\Workflow\WorkflowInterface;
... | ject, string $transitionName, WorkflowInterface $workflow, array $context = [])
{
parent::__construct($subject, $transitionName, $workflow, \sprintf('Transition "%s" is not defined for workflow "%s".', $transitionName, $workflow->getName()), $c | eption
{
public function __construct(object $sub | {
"filepath": "src/Symfony/Component/Workflow/Exception/UndefinedTransitionException.php",
"language": "php",
"file_size": 855,
"cut_index": 529,
"middle_length": 52
} |
buted with this source code.
*/
namespace Symfony\Component\Workflow\Tests;
use PHPUnit\Framework\TestCase;
use Symfony\Component\EventDispatcher\EventDispatcher;
use Symfony\Component\Workflow\Event\GuardEvent;
use Symfony\Component\Workflow\Exception\NotEnabledTransitionException;
use Symfony\Component\Workflow\St... | ');
$this->assertTrue($net->can($subject, 't1'));
$subject->setMarking('d');
$this->assertTrue($net->can($subject, 't1'));
$subject->setMarking('b');
$this->assertFalse($net->can($subject, 't1'));
}
public | = $this->createComplexStateMachineDefinition();
$net = new StateMachine($definition);
$subject = new Subject();
// If you are in place "a" you should be able to apply "t1"
$subject->setMarking('a | {
"filepath": "src/Symfony/Component/Workflow/Tests/StateMachineTest.php",
"language": "php",
"file_size": 5721,
"cut_index": 716,
"middle_length": 229
} |
ge.
*
* (c) Fabien Potencier <fabien@symfony.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Symfony\Component\Workflow;
use Symfony\Component\Workflow\Event\AnnounceEvent;
use Symfony\Component\Workflow\Event\Compl... | nts}.
*/
final class WorkflowEvents
{
/**
* @Event("Symfony\Component\Workflow\Event\GuardEvent")
*/
public const GUARD = 'workflow.guard';
/**
* @Event("Symfony\Component\Workflow\Event\LeaveEvent")
*/
public const LE | vent\LeaveEvent;
use Symfony\Component\Workflow\Event\TransitionEvent;
/**
* To learn more about how workflow events work, check the documentation
* entry at {@link https://symfony.com/doc/current/workflow/usage.html#using-eve | {
"filepath": "src/Symfony/Component/Workflow/WorkflowEvents.php",
"language": "php",
"file_size": 2236,
"cut_index": 563,
"middle_length": 229
} |
part of the Symfony package.
*
* (c) Fabien Potencier <fabien@symfony.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Symfony\Component\Workflow\EventListener;
use Psr\Log\LoggerInterface;
use Symfony\Component\Eve... | $this->logger->info(\sprintf('Leaving "%s" for subject of class "%s" in workflow "%s".', $arc->place, $event->getSubject()::class, $event->getWorkflowName()));
}
}
public function onTransition(Event $event): void
{
$this-> | nterface
{
public function __construct(
private LoggerInterface $logger,
) {
}
public function onLeave(Event $event): void
{
foreach ($event->getTransition()->getFroms(true) as $arc) {
| {
"filepath": "src/Symfony/Component/Workflow/EventListener/AuditTrailListener.php",
"language": "php",
"file_size": 1762,
"cut_index": 537,
"middle_length": 229
} |
buted with this source code.
*/
namespace Symfony\Component\Workflow\Tests\Dumper;
use PHPUnit\Framework\Attributes\DataProvider;
use PHPUnit\Framework\TestCase;
use Symfony\Component\Workflow\Definition;
use Symfony\Component\Workflow\DefinitionBuilder;
use Symfony\Component\Workflow\Dumper\MermaidDumper;
use Symfo... | ON_TYPE_WORKFLOW);
$dump = $dumper->dump($definition);
$this->assertEquals($expected, $dump);
}
#[DataProvider('provideWorkflowWithReservedWords')]
public function testDumpWithReservedWordsAsPlacenames(Definition $definition, | wBuilderTrait;
#[DataProvider('provideWorkflowDefinitionWithoutMarking')]
public function testDumpWithoutMarking(Definition $definition, string $expected)
{
$dumper = new MermaidDumper(MermaidDumper::TRANSITI | {
"filepath": "src/Symfony/Component/Workflow/Tests/Dumper/MermaidDumperTest.php",
"language": "php",
"file_size": 6936,
"cut_index": 716,
"middle_length": 229
} |
buted with this source code.
*/
namespace Symfony\Component\Workflow\Tests\Dumper;
use PHPUnit\Framework\TestCase;
use Symfony\Component\Workflow\Definition;
use Symfony\Component\Workflow\Dumper\StateMachineGraphvizDumper;
use Symfony\Component\Workflow\Marking;
use Symfony\Component\Workflow\Metadata\InMemoryMetad... | PH'
digraph workflow {
ratio="compress" rankdir="LR"
node [fontsize="9" fontname="Arial" color="#333333" fillcolor="lightblue" fixedsize="false" width="1"];
edge [fontsize="9" fontname="Arial" color="#3 | Trait;
public function testDumpWithoutMarking()
{
$definition = $this->createComplexStateMachineDefinition();
$dump = (new StateMachineGraphvizDumper())->dump($definition);
$expected = <<<'EOGRA | {
"filepath": "src/Symfony/Component/Workflow/Tests/Dumper/StateMachineGraphvizDumperTest.php",
"language": "php",
"file_size": 5195,
"cut_index": 716,
"middle_length": 229
} |
ge.
*
* (c) Fabien Potencier <fabien@symfony.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Symfony\Component\Workflow\Tests\DependencyInjection;
use PHPUnit\Framework\TestCase;
use Symfony\Component\DependencyInje... | nction setUp(): void
{
$this->container = new ContainerBuilder();
$this->compilerPass = new WorkflowValidatorPass();
}
public function testNothingToDo()
{
$this->compilerPass->process($this->container);
$th | ValidatorInterface;
use Symfony\Component\Workflow\WorkflowInterface;
class WorkflowValidatorPassTest extends TestCase
{
private ContainerBuilder $container;
private WorkflowValidatorPass $compilerPass;
protected fu | {
"filepath": "src/Symfony/Component/Workflow/Tests/DependencyInjection/WorkflowValidatorPassTest.php",
"language": "php",
"file_size": 2062,
"cut_index": 563,
"middle_length": 229
} |
ony.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Symfony\Component\Workflow\Event;
use Symfony\Component\Workflow\Marking;
use Symfony\Component\Workflow\Transition;
use Symfony\Component\Workflow\WorkflowInterface... | */
public function __construct(object $subject, Marking $marking, ?Transition $transition = null, ?WorkflowInterface $workflow = null, array $context = [])
{
parent::__construct($subject, $marking, $transition, $workflow);
$this- | sContextTrait;
/**
* @param T $subject
| {
"filepath": "src/Symfony/Component/Workflow/Event/CompletedEvent.php",
"language": "php",
"file_size": 943,
"cut_index": 606,
"middle_length": 52
} |
ony.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Symfony\Component\Workflow\Event;
use Symfony\Component\Workflow\Marking;
use Symfony\Component\Workflow\Transition;
use Symfony\Component\Workflow\WorkflowInterface... | public function __construct(object $subject, Marking $marking, ?Transition $transition = null, ?WorkflowInterface $workflow = null, array $context = [])
{
parent::__construct($subject, $marking, $transition, $workflow);
$this->context | rait;
/**
* @param T $subject
*/
| {
"filepath": "src/Symfony/Component/Workflow/Event/EnterEvent.php",
"language": "php",
"file_size": 934,
"cut_index": 606,
"middle_length": 52
} |
part of the Symfony package.
*
* (c) Fabien Potencier <fabien@symfony.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Symfony\Component\Workflow\Event;
use Symfony\Component\Workflow\Exception\InvalidArgumentExcept... | $workflowName, $transitionName);
}
/**
* Gets the event name for workflow and place.
*
* @throws InvalidArgumentException If $placeName is provided without $workflowName
*/
private static function getNameForPlace(?string $w | nvalidArgumentException If $transitionName is provided without $workflowName
*/
private static function getNameForTransition(?string $workflowName, ?string $transitionName): string
{
return self::computeName( | {
"filepath": "src/Symfony/Component/Workflow/Event/EventNameTrait.php",
"language": "php",
"file_size": 1825,
"cut_index": 537,
"middle_length": 229
} |
ony.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Symfony\Component\Workflow\Event;
use Symfony\Component\Workflow\Marking;
use Symfony\Component\Workflow\Transition;
use Symfony\Component\Workflow\WorkflowInterface... | public function __construct(object $subject, Marking $marking, ?Transition $transition = null, ?WorkflowInterface $workflow = null, array $context = [])
{
parent::__construct($subject, $marking, $transition, $workflow);
$this->context | rait;
/**
* @param T $subject
*/
| {
"filepath": "src/Symfony/Component/Workflow/Event/LeaveEvent.php",
"language": "php",
"file_size": 934,
"cut_index": 606,
"middle_length": 52
} |
buted with this source code.
*/
namespace Symfony\Component\Workflow\Debug;
use Symfony\Component\ErrorHandler\ErrorRenderer\FileLinkFormatter;
use Symfony\Component\EventDispatcher\EventDispatcherInterface;
use Symfony\Component\Workflow\Definition;
use Symfony\Component\Workflow\EventListener\GuardExpression;
use ... | Listeners(string $name, Definition $definition): array
{
if (!$this->dispatcher) {
return [];
}
$listeners = [];
foreach ($definition->getPlaces() as $placeId => $place) {
$eventNames = [];
| Extractor
{
public function __construct(
private readonly ?EventDispatcherInterface $dispatcher = null,
private readonly ?FileLinkFormatter $fileLinkFormatter = null,
) {
}
public function extract | {
"filepath": "src/Symfony/Component/Workflow/Debug/ListenerExtractor.php",
"language": "php",
"file_size": 5346,
"cut_index": 716,
"middle_length": 229
} |
This file is part of the Symfony package.
*
* (c) Fabien Potencier <fabien@symfony.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Symfony\Component\Workflow\Attribute;
use Symfony\Component\EventDispatcher\Attribu... | l $transition The transition name to which the listener listens to
* @param string|null $method The method to run when the listened event is triggered
* @param int $priority The priority of this listener if several are declared for | T_METHOD | \Attribute::IS_REPEATABLE)]
final class AsGuardListener extends AsEventListener
{
use BuildEventNameTrait;
/**
* @param string|null $workflow The id of the workflow to listen to
* @param string|nul | {
"filepath": "src/Symfony/Component/Workflow/Attribute/AsGuardListener.php",
"language": "php",
"file_size": 1474,
"cut_index": 524,
"middle_length": 229
} |
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Symfony\Component\Workflow\Tests\Dumper;
use PHPUnit\Framework\Attributes\DataProvider;
use PHPUnit\Framework\TestCase;
use Symfony\Component\Workflow\Definition;
use Symfon... | lowWithoutMarking($definition, $marking, $expectedFileName, $title)
{
$dumper = new PlantUmlDumper(PlantUmlDumper::WORKFLOW_TRANSITION);
$dump = $dumper->dump($definition, $marking, ['title' => $title]);
// handle windows, and a | BuilderTrait;
use Symfony\Component\Workflow\Transition;
class PlantUmlDumperTest extends TestCase
{
use WorkflowBuilderTrait;
#[DataProvider('provideWorkflowDefinitionWithoutMarking')]
public function testDumpWorkf | {
"filepath": "src/Symfony/Component/Workflow/Tests/Dumper/PlantUmlDumperTest.php",
"language": "php",
"file_size": 4288,
"cut_index": 614,
"middle_length": 229
} |
buted with this source code.
*/
namespace Symfony\Component\Workflow\Tests\DependencyInjection;
use PHPUnit\Framework\TestCase;
use Symfony\Component\DependencyInjection\ContainerBuilder;
use Symfony\Component\DependencyInjection\Exception\LogicException;
use Symfony\Component\Security\Core\Authentication\Authentica... | PassTest extends TestCase
{
private ContainerBuilder $container;
private WorkflowGuardListenerPass $compilerPass;
protected function setUp(): void
{
$this->container = new ContainerBuilder();
$this->compilerPass = new Workf | ace;
use Symfony\Component\Security\Core\Role\RoleHierarchy;
use Symfony\Component\Validator\Validator\ValidatorInterface;
use Symfony\Component\Workflow\DependencyInjection\WorkflowGuardListenerPass;
class WorkflowGuardListener | {
"filepath": "src/Symfony/Component/Workflow/Tests/DependencyInjection/WorkflowGuardListenerPassTest.php",
"language": "php",
"file_size": 5161,
"cut_index": 716,
"middle_length": 229
} |
part of the Symfony package.
*
* (c) Fabien Potencier <fabien@symfony.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Symfony\Component\Workflow\Event;
use Symfony\Component\Workflow\Marking;
use Symfony\Component\... | t(
private object $subject,
private Marking $marking,
private ?Transition $transition = null,
private ?WorkflowInterface $workflow = null,
) {
}
public function getMarking(): Marking
{
return $this-> | r Grégoire Pineau <lyrixx@lyrixx.info>
* @author Carlos Pereira De Amorim <carlos@shauri.fr>
*
* @template T of object
*/
class Event extends BaseEvent
{
/**
* @param T $subject
*/
public function __construc | {
"filepath": "src/Symfony/Component/Workflow/Event/Event.php",
"language": "php",
"file_size": 1535,
"cut_index": 537,
"middle_length": 229
} |
?php
/*
* This file is part of the Symfony package.
*
* (c) Fabien Potencier <fabien@symfony.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Symfony\Component\Workflow\Event;
use Symfony\Component\Workflow\Marking... | $transition = null, ?WorkflowInterface $workflow = null, array $context = [])
{
parent::__construct($subject, $marking, $transition, $workflow);
$this->context = $context;
}
public function setContext(array $context): void
| nt
{
use EventNameTrait {
getNameForTransition as public getName;
}
use HasContextTrait;
/**
* @param T $subject
*/
public function __construct(object $subject, Marking $marking, ?Transition | {
"filepath": "src/Symfony/Component/Workflow/Event/TransitionEvent.php",
"language": "php",
"file_size": 1045,
"cut_index": 513,
"middle_length": 229
} |
ge.
*
* (c) Fabien Potencier <fabien@symfony.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Symfony\Component\Workflow\Tests;
use PHPUnit\Framework\TestCase;
use Symfony\Component\Workflow\Marking;
class MarkingTe... | => 1], $marking);
$marking->unmark('a');
$this->assertFalse($marking->has('a'));
$this->assertTrue($marking->has('b'));
$this->assertPlaces(['b' => 1], $marking);
$marking->unmark('b');
$this->assertFalse | as('b'));
$this->assertPlaces(['a' => 1], $marking);
$marking->mark('b');
$this->assertTrue($marking->has('a'));
$this->assertTrue($marking->has('b'));
$this->assertPlaces(['a' => 1, 'b' | {
"filepath": "src/Symfony/Component/Workflow/Tests/MarkingTest.php",
"language": "php",
"file_size": 2592,
"cut_index": 563,
"middle_length": 229
} |
ony.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Symfony\Component\Workflow\Event;
use Symfony\Component\Workflow\Marking;
use Symfony\Component\Workflow\Transition;
use Symfony\Component\Workflow\WorkflowInterface... | public function __construct(object $subject, Marking $marking, ?Transition $transition = null, ?WorkflowInterface $workflow = null, array $context = [])
{
parent::__construct($subject, $marking, $transition, $workflow);
$this->contex | tTrait;
/**
* @param T $subject
*/
| {
"filepath": "src/Symfony/Component/Workflow/Event/EnteredEvent.php",
"language": "php",
"file_size": 936,
"cut_index": 606,
"middle_length": 52
} |
ony.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Symfony\Component\Workflow\Event;
use Symfony\Component\Workflow\Marking;
use Symfony\Component\Workflow\Transition;
use Symfony\Component\Workflow\WorkflowInterface... | */
public function __construct(object $subject, Marking $marking, ?Transition $transition = null, ?WorkflowInterface $workflow = null, array $context = [])
{
parent::__construct($subject, $marking, $transition, $workflow);
$this-> | ContextTrait;
/**
* @param T $subject
| {
"filepath": "src/Symfony/Component/Workflow/Event/AnnounceEvent.php",
"language": "php",
"file_size": 942,
"cut_index": 606,
"middle_length": 52
} |
part of the Symfony package.
*
* (c) Fabien Potencier <fabien@symfony.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Symfony\Component\Workflow\Event;
use Symfony\Component\Workflow\Marking;
use Symfony\Component\... | tion as public getName;
}
private TransitionBlockerList $transitionBlockerList;
/**
* @param T $subject
*/
public function __construct(object $subject, Marking $marking, Transition $transition, ?WorkflowInterface $workflow = nul | abien Potencier <fabien@symfony.com>
* @author Grégoire Pineau <lyrixx@lyrixx.info>
*
* @template T of object
*
* @extends Event<T>
*/
final class GuardEvent extends Event
{
use EventNameTrait {
getNameForTransi | {
"filepath": "src/Symfony/Component/Workflow/Event/GuardEvent.php",
"language": "php",
"file_size": 1965,
"cut_index": 537,
"middle_length": 229
} |
ge.
*
* (c) Fabien Potencier <fabien@symfony.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Symfony\Component\Security\Csrf\TokenStorage;
use Symfony\Component\HttpFoundation\Exception\SessionNotFoundException;
use... | he session.
*/
public const SESSION_NAMESPACE = '_csrf';
/**
* Initializes the storage with a RequestStack object and a session namespace.
*
* @param string $namespace The namespace under which the token is stored in the reques | en storage that uses a Symfony Session object.
*
* @author Bernhard Schussek <bschussek@gmail.com>
*/
class SessionTokenStorage implements ClearableTokenStorageInterface
{
/**
* The namespace used to store values in t | {
"filepath": "src/Symfony/Component/Security/Csrf/TokenStorage/SessionTokenStorage.php",
"language": "php",
"file_size": 2874,
"cut_index": 563,
"middle_length": 229
} |
/*
* This file is part of the Symfony package.
*
* (c) Fabien Potencier <fabien@symfony.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Symfony\Component\Security\Csrf\TokenStorage;
use Symfony\Component\Security\... | $tokenId, #[\SensitiveParameter] string $token): void;
/**
* Removes a CSRF token.
*
* @return string|null Returns the removed token if one existed, NULL
* otherwise
*/
public function removeToken(strin | F token.
*
* @throws TokenNotFoundException If the token ID does not exist
*/
public function getToken(string $tokenId): string;
/**
* Stores a CSRF token.
*/
public function setToken(string | {
"filepath": "src/Symfony/Component/Security/Csrf/TokenStorage/TokenStorageInterface.php",
"language": "php",
"file_size": 1159,
"cut_index": 518,
"middle_length": 229
} |
ge.
*
* (c) Fabien Potencier <fabien@symfony.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Symfony\Component\Security\Http;
use Symfony\Component\HttpFoundation\ParameterBag;
use Symfony\Component\HttpFoundation\R... | ue.
*
* Paths like foo[bar] will be evaluated to find deeper items in nested data structures.
*
* @throws InvalidArgumentException when the given path is malformed
*/
public static function getParameterBagValue(ParameterBag $pa | cess;
use Symfony\Component\PropertyAccess\PropertyAccessorInterface;
/**
* @internal
*/
final class ParameterBagUtils
{
private static PropertyAccessorInterface $propertyAccessor;
/**
* Returns a "parameter" val | {
"filepath": "src/Symfony/Component/Security/Http/ParameterBagUtils.php",
"language": "php",
"file_size": 2921,
"cut_index": 563,
"middle_length": 229
} |
This file is part of the Symfony package.
*
* (c) Fabien Potencier <fabien@symfony.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Symfony\Component\Security\Http;
use Symfony\Component\Security\Http\Event\Interact... | igest header.
*
* @Event("Symfony\Component\Security\Http\Event\InteractiveLoginEvent")
*/
public const INTERACTIVE_LOGIN = 'security.interactive_login';
/**
* The SWITCH_USER event occurs before switch to another user and
| * into your website. It is important to distinguish this action from
* non-interactive authentication methods, such as:
* - authentication based on your session.
* - authentication using an HTTP basic or HTTP d | {
"filepath": "src/Symfony/Component/Security/Http/SecurityEvents.php",
"language": "php",
"file_size": 1461,
"cut_index": 524,
"middle_length": 229
} |
This file is part of the Symfony package.
*
* (c) Fabien Potencier <fabien@symfony.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Symfony\Component\Security\Http\EntryPoint;
use Symfony\Component\HttpFoundation\Re... | er to authenticate.
*
* This is called when an anonymous request accesses a resource that
* requires authentication. The job of this method is to return some
* response that "helps" the user start into the authentication process.
* | d to "start"
* the authentication process (see method for more details).
*
* @author Fabien Potencier <fabien@symfony.com>
*/
interface AuthenticationEntryPointInterface
{
/**
* Returns a response that directs the us | {
"filepath": "src/Symfony/Component/Security/Http/EntryPoint/AuthenticationEntryPointInterface.php",
"language": "php",
"file_size": 1418,
"cut_index": 524,
"middle_length": 229
} |
<?php
/*
* This file is part of the Symfony package.
*
* (c) Fabien Potencier <fabien@symfony.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Symfony\Component\Security\Http\Attribute;
use Symfony\Component\HttpKe... | specific cases
* @param string $resolver The class name of the resolver to use
*/
public function __construct(bool $disabled = false, string $resolver = UserValueResolver::class)
{
parent::__construct($resolver, $disabled);
} | ibute(\Attribute::TARGET_PARAMETER)]
class CurrentUser extends ValueResolver
{
/**
* @param bool $disabled Whether this value resolver is disabled, which allows to enable a value resolver globally while disabling it in | {
"filepath": "src/Symfony/Component/Security/Http/Attribute/CurrentUser.php",
"language": "php",
"file_size": 1000,
"cut_index": 512,
"middle_length": 229
} |
part of the Symfony package.
*
* (c) Fabien Potencier <fabien@symfony.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Symfony\Component\Security\Http\Attribute;
use Symfony\Component\ExpressionLanguage\Expression;
... | (
/**
* Sets the id, or an Expression or a Closure evaluated to the id, used when generating the token.
*
* @var string|Expression|\Closure(array<string,mixed>, Request, ?object):string
*/
public string|E | okenValid
{
public const SOURCE_PAYLOAD = 0b0001;
public const SOURCE_QUERY = 0b0010;
public const SOURCE_HEADER = 0b0100;
/** @var string[] */
public readonly array $methods;
public function __construct | {
"filepath": "src/Symfony/Component/Security/Http/Attribute/IsCsrfTokenValid.php",
"language": "php",
"file_size": 1809,
"cut_index": 537,
"middle_length": 229
} |
ge.
*
* (c) Fabien Potencier <fabien@symfony.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Symfony\Component\Security\Http\Attribute;
use Symfony\Component\ExpressionLanguage\Expression;
use Symfony\Component\Http... | nly array $methods;
/**
* @param string|Expression|\Closure(IsGrantedContext, mixed $subject):bool $attribute The attribute that will be checked against a given authentication token and optional subject
* @param array|st | or Ryan Weaver <ryan@knpuniversity.com>
*/
#[\Attribute(\Attribute::IS_REPEATABLE | \Attribute::TARGET_CLASS | \Attribute::TARGET_METHOD | \Attribute::TARGET_FUNCTION)]
class IsGranted
{
/** @var string[] */
public reado | {
"filepath": "src/Symfony/Component/Security/Http/Attribute/IsGranted.php",
"language": "php",
"file_size": 2470,
"cut_index": 563,
"middle_length": 229
} |
part of the Symfony package.
*
* (c) Fabien Potencier <fabien@symfony.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Symfony\Component\Security\Http\Attribute;
use Symfony\Component\Security\Core\Authentication\To... | y TokenInterface $token,
public readonly ?UserInterface $user,
private readonly AuthorizationCheckerInterface $authorizationChecker,
) {
}
public function isGranted(mixed $attribute, mixed $subject = null, ?AccessDecision $acce | urity\Core\Authorization\Voter\AuthenticatedVoter;
use Symfony\Component\Security\Core\User\UserInterface;
class IsGrantedContext implements AuthorizationCheckerInterface
{
public function __construct(
public readonl | {
"filepath": "src/Symfony/Component/Security/Http/Attribute/IsGrantedContext.php",
"language": "php",
"file_size": 1614,
"cut_index": 537,
"middle_length": 229
} |
part of the Symfony package.
*
* (c) Fabien Potencier <fabien@symfony.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Symfony\Component\Security\Http\RateLimiter;
use Symfony\Component\HttpFoundation\RateLimiter\Ab... |
*
* @author Wouter de Jong <wouter@wouterj.nl>
*/
final class DefaultLoginRateLimiter extends AbstractRequestRateLimiter
{
/**
* @param non-empty-string $secret A secret to use for hashing the IP address and username
*/
public functio | tion;
use Symfony\Component\Security\Http\SecurityRequestAttributes;
/**
* A default login throttling limiter.
*
* This limiter prevents breadth-first attacks by enforcing
* a limit on username+IP and a (higher) limit on IP. | {
"filepath": "src/Symfony/Component/Security/Http/RateLimiter/DefaultLoginRateLimiter.php",
"language": "php",
"file_size": 1977,
"cut_index": 537,
"middle_length": 229
} |
This file is part of the Symfony package.
*
* (c) Fabien Potencier <fabien@symfony.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Symfony\Component\Security\Http\Util;
use Symfony\Component\HttpFoundation\Session\... | $session->set('_security.'.$firewallName.'.target_path', $uri);
}
/**
* Returns the URL (if any) the user visited that forced them to login.
*/
private function getTargetPath(SessionInterface $session, string $firewallName): ?string | uld be redirected to after authentication.
*
* Usually, you do not need to set this directly.
*/
private function saveTargetPath(SessionInterface $session, string $firewallName, string $uri): void
{
| {
"filepath": "src/Symfony/Component/Security/Http/Util/TargetPathTrait.php",
"language": "php",
"file_size": 1337,
"cut_index": 524,
"middle_length": 229
} |
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Symfony\Component\Security\Http\RememberMe;
use Psr\Log\LoggerInterface;
use Symfony\Component\HttpFoundation\Cookie;
use Symfony\Component\HttpFoundation\RequestStack;
use ... | ace $userProvider,
protected RequestStack $requestStack,
array $options = [],
protected ?LoggerInterface $logger = null,
) {
$this->options = $options + [
'name' => 'REMEMBERME',
'lifetime' => 315 | * @author Wouter de Jong <wouter@wouterj.nl>
*/
abstract class AbstractRememberMeHandler implements RememberMeHandlerInterface
{
protected array $options;
public function __construct(
private UserProviderInterf | {
"filepath": "src/Symfony/Component/Security/Http/RememberMe/AbstractRememberMeHandler.php",
"language": "php",
"file_size": 3556,
"cut_index": 614,
"middle_length": 229
} |
buted with this source code.
*/
namespace Symfony\Component\Security\Http\RememberMe;
use Psr\Log\LoggerInterface;
use Symfony\Component\HttpFoundation\RequestStack;
use Symfony\Component\Security\Core\Authentication\RememberMe\PersistentToken;
use Symfony\Component\Security\Core\Authentication\RememberMe\TokenProvi... | derInterface}.
*
* This requires storing remember-me tokens in a database. This allows
* more control over the invalidation of remember-me tokens. See
* {@see SignatureRememberMeHandler} if you don't want to use a database.
*
* @author Wouter de Jong | \Security\Core\Exception\CookieTheftException;
use Symfony\Component\Security\Core\User\UserInterface;
use Symfony\Component\Security\Core\User\UserProviderInterface;
/**
* Implements remember-me tokens using a {@see TokenProvi | {
"filepath": "src/Symfony/Component/Security/Http/RememberMe/PersistentRememberMeHandler.php",
"language": "php",
"file_size": 6324,
"cut_index": 716,
"middle_length": 229
} |
ge.
*
* (c) Fabien Potencier <fabien@symfony.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Symfony\Component\Security\Http\RememberMe;
use Symfony\Component\Security\Core\Authentication\RememberMe\PersistentToken;... | if (!str_contains($rawCookie, self::COOKIE_DELIMITER)) {
$rawCookie = base64_decode($rawCookie);
}
$cookieParts = explode(self::COOKIE_DELIMITER, $rawCookie, 4);
if (4 !== \count($cookieParts)) {
throw n | ;
public function __construct(
private string $userIdentifier,
private int $expires,
private string $value,
) {
}
public static function fromRawCookie(string $rawCookie): self
{
| {
"filepath": "src/Symfony/Component/Security/Http/RememberMe/RememberMeDetails.php",
"language": "php",
"file_size": 2388,
"cut_index": 563,
"middle_length": 229
} |
part of the Symfony package.
*
* (c) Fabien Potencier <fabien@symfony.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Symfony\Component\Security\Http\RememberMe;
use Symfony\Component\Security\Core\Exception\Authen... | ie should be set as an attribute on the main request,
* which is transformed into a response cookie by {@see ResponseListener}.
*/
public function createRememberMeCookie(UserInterface $user): void;
/**
* Validates the remember-me co | nt to extend from
* {@see AbstractRememberMeHandler} instead.
*
* @author Wouter de Jong <wouter@wouterj.nl>
*/
interface RememberMeHandlerInterface
{
/**
* Creates a remember-me cookie.
*
* The actual cook | {
"filepath": "src/Symfony/Component/Security/Http/RememberMe/RememberMeHandlerInterface.php",
"language": "php",
"file_size": 1758,
"cut_index": 537,
"middle_length": 229
} |
This file is part of the Symfony package.
*
* (c) Fabien Potencier <fabien@symfony.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Symfony\Component\Security\Http\RememberMe;
use Symfony\Component\EventDispatcher\E... | Request when there is no actual Response, yet.
*/
public const COOKIE_ATTR_NAME = '_security_remember_me_cookie';
public function onKernelResponse(ResponseEvent $event): void
{
if (!$event->isMainRequest()) {
return;
| hannes M. Schmitt <schmittjoh@gmail.com>
*
* @final
*/
class ResponseListener implements EventSubscriberInterface
{
/**
* This attribute name can be used by the implementation if it needs to set
* a cookie on the | {
"filepath": "src/Symfony/Component/Security/Http/RememberMe/ResponseListener.php",
"language": "php",
"file_size": 1414,
"cut_index": 524,
"middle_length": 229
} |
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Symfony\Component\Security\Http\RememberMe;
use Psr\Log\LoggerInterface;
use Symfony\Component\HttpFoundation\RequestStack;
use Symfony\Component\Security\Core\Exception\Aut... | the {@see SignatureHasher}.
*
* This handler doesn't require a database for the remember-me tokens.
* However, it cannot invalidate a specific user session, all sessions for
* that user will be invalidated instead. Use {@see PersistentRememberMeHandler | Symfony\Component\Security\Core\Signature\SignatureHasher;
use Symfony\Component\Security\Core\User\UserInterface;
use Symfony\Component\Security\Core\User\UserProviderInterface;
/**
* Implements safe remember-me cookies using | {
"filepath": "src/Symfony/Component/Security/Http/RememberMe/SignatureRememberMeHandler.php",
"language": "php",
"file_size": 3138,
"cut_index": 614,
"middle_length": 229
} |
buted with this source code.
*/
namespace Symfony\Component\Security\Http\Logout;
use Symfony\Component\HttpFoundation\RequestStack;
use Symfony\Component\Routing\Generator\UrlGeneratorInterface;
use Symfony\Component\Security\Core\Authentication\Token\Storage\TokenStorageInterface;
use Symfony\Component\Security\Cs... | stStack = null,
private ?UrlGeneratorInterface $router = null,
private ?TokenStorageInterface $tokenStorage = null,
) {
}
/**
* Registers a firewall's LogoutListener, allowing its URL to be generated.
*
* @param | s LogoutUrlGenerator
{
private array $listeners = [];
private ?string $currentFirewallName = null;
private ?string $currentFirewallContext = null;
public function __construct(
private ?RequestStack $reque | {
"filepath": "src/Symfony/Component/Security/Http/Logout/LogoutUrlGenerator.php",
"language": "php",
"file_size": 5701,
"cut_index": 716,
"middle_length": 229
} |
ge.
*
* (c) Fabien Potencier <fabien@symfony.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Symfony\Component\Security\Http\Firewall;
use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\HttpKernel\E... | Security\Core\Exception\AccessDeniedException;
use Symfony\Component\Security\Http\AccessMapInterface;
use Symfony\Component\Security\Http\Event\LazyResponseEvent;
/**
* AccessListener enforces access control rules.
*
* @author Fabien Potencier <fabien | nent\Security\Core\Authorization\AccessDecision;
use Symfony\Component\Security\Core\Authorization\AccessDecisionManagerInterface;
use Symfony\Component\Security\Core\Authorization\Voter\AuthenticatedVoter;
use Symfony\Component\ | {
"filepath": "src/Symfony/Component/Security/Http/Firewall/AccessListener.php",
"language": "php",
"file_size": 3022,
"cut_index": 563,
"middle_length": 229
} |
/*
* This file is part of the Symfony package.
*
* (c) Fabien Potencier <fabien@symfony.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Symfony\Component\Security\Http\Firewall;
use Symfony\Component\HttpFoundatio... | ace $authenticatorManager,
) {
}
public function supports(Request $request): ?bool
{
return $this->authenticatorManager->supports($request);
}
public function authenticate(RequestEvent $event): void
{
$request | delegates to the authenticator system.
*
* @author Wouter de Jong <wouter@wouterj.nl>
*/
class AuthenticatorManagerListener extends AbstractListener
{
public function __construct(
private AuthenticatorManagerInterf | {
"filepath": "src/Symfony/Component/Security/Http/Firewall/AuthenticatorManagerListener.php",
"language": "php",
"file_size": 1220,
"cut_index": 518,
"middle_length": 229
} |
ge.
*
* (c) Fabien Potencier <fabien@symfony.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Symfony\Component\Security\Http\Firewall;
use Psr\Log\LoggerInterface;
use Symfony\Component\HttpFoundation\RedirectRespon... | e AccessMapInterface $map,
private ?LoggerInterface $logger = null,
private int $httpPort = 80,
private int $httpsPort = 443,
) {
}
/**
* Handles channel management.
*/
public function supports(Request $re | the HTTP protocol based on the access control
* configuration.
*
* @author Fabien Potencier <fabien@symfony.com>
*
* @final
*/
class ChannelListener extends AbstractListener
{
public function __construct(
privat | {
"filepath": "src/Symfony/Component/Security/Http/Firewall/ChannelListener.php",
"language": "php",
"file_size": 2924,
"cut_index": 563,
"middle_length": 229
} |
Component\HttpFoundation\Request;
use Symfony\Component\HttpFoundation\Session\Session;
use Symfony\Component\HttpKernel\Event\RequestEvent;
use Symfony\Component\HttpKernel\Event\ResponseEvent;
use Symfony\Component\HttpKernel\KernelEvents;
use Symfony\Component\Security\Core\Authentication\AuthenticationTrustResolver... | ecurity\Core\Exception\UnsupportedUserException;
use Symfony\Component\Security\Core\Exception\UserNotFoundException;
use Symfony\Component\Security\Core\User\EquatableInterface;
use Symfony\Component\Security\Core\User\LegacyPasswordAuthenticatedUserInter | y\Core\Authentication\Token\Storage\TokenStorageInterface;
use Symfony\Component\Security\Core\Authentication\Token\SwitchUserToken;
use Symfony\Component\Security\Core\Authentication\Token\TokenInterface;
use Symfony\Component\S | {
"filepath": "src/Symfony/Component/Security/Http/Firewall/ContextListener.php",
"language": "php",
"file_size": 14053,
"cut_index": 921,
"middle_length": 229
} |
buted with this source code.
*/
namespace Symfony\Component\Security\Http\Firewall;
use Psr\Log\LoggerInterface;
use Symfony\Component\EventDispatcher\EventDispatcherInterface;
use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\HttpFoundation\Response;
use Symfony\Component\HttpKernel\Event\Exceptio... | fony\Component\Security\Core\Exception\AccessDeniedException;
use Symfony\Component\Security\Core\Exception\AccountStatusException;
use Symfony\Component\Security\Core\Exception\AuthenticationException;
use Symfony\Component\Security\Core\Exception\Insuffi | e Symfony\Component\HttpKernel\KernelEvents;
use Symfony\Component\Security\Core\Authentication\AuthenticationTrustResolverInterface;
use Symfony\Component\Security\Core\Authentication\Token\Storage\TokenStorageInterface;
use Sym | {
"filepath": "src/Symfony/Component/Security/Http/Firewall/ExceptionListener.php",
"language": "php",
"file_size": 9018,
"cut_index": 716,
"middle_length": 229
} |
This file is part of the Symfony package.
*
* (c) Fabien Potencier <fabien@symfony.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Symfony\Component\Security\Http\Firewall;
use Symfony\Component\HttpFoundation\Requ... | Returning null means authenticate() can be called lazily when accessing the token storage.
*/
public function supports(Request $request): ?bool;
/**
* Does whatever is required to authenticate the request, typically calling $event->setR | hwork.com>
* @author Robin Chalas <robin.chalas@gmail.com>
*/
interface FirewallListenerInterface
{
/**
* Tells whether the authenticate() method should be called or not depending on the incoming request.
*
* | {
"filepath": "src/Symfony/Component/Security/Http/Firewall/FirewallListenerInterface.php",
"language": "php",
"file_size": 1277,
"cut_index": 524,
"middle_length": 229
} |
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Symfony\Component\Security\Http\Firewall;
use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\HttpKernel\Event\RequestEvent;
use Symfony\Component\Security\C... | er\EventDispatcherInterface;
/**
* LogoutListener logout users.
*
* @author Fabien Potencier <fabien@symfony.com>
*
* @final
*/
class LogoutListener extends AbstractListener
{
private array $options;
/**
* @param array $options An arra | rity\Csrf\CsrfTokenManagerInterface;
use Symfony\Component\Security\Http\Event\LogoutEvent;
use Symfony\Component\Security\Http\HttpUtils;
use Symfony\Component\Security\Http\ParameterBagUtils;
use Symfony\Contracts\EventDispatch | {
"filepath": "src/Symfony/Component/Security/Http/Firewall/LogoutListener.php",
"language": "php",
"file_size": 3600,
"cut_index": 614,
"middle_length": 229
} |
buted with this source code.
*/
namespace Symfony\Component\Security\Http\Firewall;
use Psr\Log\LoggerInterface;
use Symfony\Component\HttpFoundation\RedirectResponse;
use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\HttpKernel\Event\RequestEvent;
use Symfony\Component\Routing\Generator\UrlGenerat... | urity\Core\Exception\AccessDeniedException;
use Symfony\Component\Security\Core\Exception\AuthenticationCredentialsNotFoundException;
use Symfony\Component\Security\Core\Exception\AuthenticationException;
use Symfony\Component\Security\Core\User\UserChecke | nent\Security\Core\Authentication\Token\TokenInterface;
use Symfony\Component\Security\Core\Authorization\AccessDecision;
use Symfony\Component\Security\Core\Authorization\AccessDecisionManagerInterface;
use Symfony\Component\Sec | {
"filepath": "src/Symfony/Component/Security/Http/Firewall/SwitchUserListener.php",
"language": "php",
"file_size": 8511,
"cut_index": 716,
"middle_length": 229
} |
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Symfony\Component\Security\Http\LoginLink;
use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\Routing\Generator\UrlGeneratorInterface;
use Symfony\Component... | serProviderInterface;
use Symfony\Component\Security\Http\LoginLink\Exception\ExpiredLoginLinkException;
use Symfony\Component\Security\Http\LoginLink\Exception\InvalidLoginLinkException;
use Symfony\Component\Security\Http\ParameterBagUtils;
/**
* @auth | ponent\Security\Core\Signature\Exception\InvalidSignatureException;
use Symfony\Component\Security\Core\Signature\SignatureHasher;
use Symfony\Component\Security\Core\User\UserInterface;
use Symfony\Component\Security\Core\User\U | {
"filepath": "src/Symfony/Component/Security/Http/LoginLink/LoginLinkHandler.php",
"language": "php",
"file_size": 4354,
"cut_index": 614,
"middle_length": 229
} |
/*
* This file is part of the Symfony package.
*
* (c) Fabien Potencier <fabien@symfony.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Symfony\Component\Security\Http\LoginLink;
use Symfony\Component\HttpFoundati... | ly set
*/
public function createLoginLink(UserInterface $user, ?Request $request = null, ?int $lifetime = null): LoginLinkDetails;
/**
* Validates if this request contains a login link and returns the associated User.
*
* Throw |
interface LoginLinkHandlerInterface
{
/**
* Generate a link that can be used to authenticate as the given user.
*
* @param int|null $lifetime When not null, the argument overrides any default lifetime previous | {
"filepath": "src/Symfony/Component/Security/Http/LoginLink/LoginLinkHandlerInterface.php",
"language": "php",
"file_size": 1144,
"cut_index": 518,
"middle_length": 229
} |
ge.
*
* (c) Fabien Potencier <fabien@symfony.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Symfony\Component\Security\Http\LoginLink;
use Symfony\Bridge\Twig\Mime\NotificationEmail;
use Symfony\Component\Notifier\... | otification to ease sending login link
* emails/SMS using the Notifier component.
*
* @author Wouter de Jong <wouter@wouterj.nl>
*/
class LoginLinkNotification extends Notification implements EmailNotificationInterface, SmsNotificationInterface
{
p | ification;
use Symfony\Component\Notifier\Notification\SmsNotificationInterface;
use Symfony\Component\Notifier\Recipient\EmailRecipientInterface;
use Symfony\Component\Notifier\Recipient\SmsRecipientInterface;
/**
* Use this n | {
"filepath": "src/Symfony/Component/Security/Http/LoginLink/LoginLinkNotification.php",
"language": "php",
"file_size": 2711,
"cut_index": 563,
"middle_length": 229
} |
part of the Symfony package.
*
* (c) Fabien Potencier <fabien@symfony.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Symfony\Component\Security\Http\Session;
use Symfony\Component\HttpFoundation\Request;
use Symfo... | Schmitt <schmittjoh@gmail.com>
*/
class SessionAuthenticationStrategy implements SessionAuthenticationStrategyInterface
{
public const NONE = 'none';
public const MIGRATE = 'migrate';
public const INVALIDATE = 'invalidate';
private ?Clea | tion.
*
* Supports the following strategies:
* NONE: the session is not changed
* MIGRATE: the session id is updated, attributes are kept
* INVALIDATE: the session id is updated, attributes are lost
*
* @author Johannes M. | {
"filepath": "src/Symfony/Component/Security/Http/Session/SessionAuthenticationStrategy.php",
"language": "php",
"file_size": 1990,
"cut_index": 537,
"middle_length": 229
} |
<?php
/*
* This file is part of the Symfony package.
*
* (c) Fabien Potencier <fabien@symfony.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Symfony\Component\Security\Http\Session;
use Symfony\Component\HttpFoun... | ges to the session.
*
* This method should be called before the TokenStorage is populated with a
* Token. It should be used by authentication listeners when a session is used.
*/
public function onAuthentication(Request $request, To | ession after an interactive
* authentication attempt was successful.
*
* @author Johannes M. Schmitt <schmittjoh@gmail.com>
*/
interface SessionAuthenticationStrategyInterface
{
/**
* This performs any necessary chan | {
"filepath": "src/Symfony/Component/Security/Http/Session/SessionAuthenticationStrategyInterface.php",
"language": "php",
"file_size": 1027,
"cut_index": 512,
"middle_length": 229
} |
<?php
/*
* This file is part of the Symfony package.
*
* (c) Fabien Potencier <fabien@symfony.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Symfony\Component\Security\Http\Authentication;
use Symfony\Component\H... | . Schmitt <schmittjoh@gmail.com>
*/
interface AuthenticationFailureHandlerInterface
{
/**
* This is called when an interactive authentication attempt fails.
*/
public function onAuthenticationFailure(Request $request, AuthenticationExcep | handlers.
*
* If you want to customize the failure handling process, instead of
* overwriting the respective listener globally, you can set a custom failure
* handler which implements this interface.
*
* @author Johannes M | {
"filepath": "src/Symfony/Component/Security/Http/Authentication/AuthenticationFailureHandlerInterface.php",
"language": "php",
"file_size": 1027,
"cut_index": 512,
"middle_length": 229
} |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.