text
stringlengths
14
100k
source
stringclasses
1 value
repo
stringclasses
810 values
language
stringclasses
13 values
<|fim_prefix|><?php namespace Wallabag\Command\Import; use Simpleue\Worker\QueueWorker; use Symfony\Component\Config\Definition\Exception\Exception; use Symfony\Component\Console\Command\Command; use Symfony\Component\Console\Input\InputArgument; use Symfony\Component\Console\Input\InputInterface; use Symfony\Compone...
fim
wallabag/wallabag
php
<|fim_prefix|><?php namespace Wallabag\Command\Import; use Doctrine\DBAL\Driver\Middleware; use Doctrine\DBAL\Logging\Middleware as LoggingMiddleware; use Doctrine\ORM\EntityManagerInterface; use Symfony\Component\Config\Definition\Exception\Exception; use Symfony\Component\Console\Command\Command; use Symfony\Compon...
fim
wallabag/wallabag
php
<|fim_prefix|><?php namespace Wallabag\Command; use Doctrine\DBAL\Connection; use Doctrine\DBAL\Exception\DriverException; use Doctrine\DBAL\Platforms\MySQLPlatform; use Doctrine\DBAL\Platforms\PostgreSQLPlatform; use Doctrine\DBAL\Platforms\SqlitePlatform; use Doctrine\Migrations\Metadata\Storage\TableMetadataStorag...
fim
wallabag/wallabag
php
<|fim_suffix|> $user->getEmail(), $user->isEnabled() ? 'yes' : 'no', $user->hasRole('ROLE_SUPER_ADMIN') || $user->hasRole('ROLE_ADMIN') ? 'yes' : 'no', ]; } $io->table(['username', 'email', 'is enabled?', 'is admin?'], $rows); $io->success( ...
fim
wallabag/wallabag
php
<|fim_suffix|>nputArgument::OPTIONAL, 'Reload entries only for the given user') ->addOption( 'only-not-parsed', null, InputOption::VALUE_NONE, 'Only reload entries which have `is_not_parsed` set to `true`' ); } protected fu...
fim
wallabag/wallabag
php
<|fim_suffix|> $this->showUser($user); } catch (NoResultException) { $this->io->error(\sprintf('User "%s" not found.', $username)); return 1; } return 0; } private function showUser(User $user): void { $this->io->listing([ \sp...
fim
wallabag/wallabag
php
<|fim_suffix|> return 0; } /** * Fetches a user from its username. * * @param string $username * * @return User */ private function getUser($username) { return $this->userRepository->findOneByUserName($username); } } <|fim_prefix|><?php namespace Walla...
fim
wallabag/wallabag
php
<|fim_prefix|><?php namespace Wallabag\Command; use Doctrine\ORM\EntityManagerInterface; use Symfony\Component\Console\Command\Command; use Symfony\Component\Console\Input\InputArgument; use Symfony\Component\Console\Input\InputInterface; use Symfony\Component\Console\Output\OutputInterface; use Symfony\Component\Con...
fim
wallabag/wallabag
php
<|fim_prefix|><?php namespace Wallabag\Consumer; use OldSound\RabbitMqBundle\RabbitMq\ConsumerInterface; use PhpAmqpLi<|fim_suffix|>nds AbstractConsumer implements ConsumerInterface { public function execute(AMQPMessage $msg): int|bool { return $this->handleMessage($msg->getBody()); } } <|fim_midd...
fim
wallabag/wallabag
php
<|fim_prefix|><?php namespace Wallabag\Consumer; use Doctrine\ORM\EntityManagerInterface; use Psr\Log\LoggerInterface; use Psr\Log\NullLogger; use Symfony\Component\EventDispatcher\EventDispatcherInterface; use Wallabag\Entity\Entry; use Wallabag\Event\EntrySavedEvent; use Wallabag\Import\AbstractImport; use Wallabag...
fim
wallabag/wallabag
php
<|fim_prefix|><?php namespace Wallabag\Consumer; use OldSound\RabbitMqBundle\RabbitMq\Consumer; /** * A proxy class only used to count messages in a queue while lazy loading RabbitMQ services. * Only used in ImportController. */ class RabbitMQConsumerTotalProxy { public function __construct( private r...
fim
wallabag/wallabag
php
<|fim_suffix|>m string $job Content of the message (directly from Redis) * * @return true */ public function isMyJob($job) { return true; } } <|fim_prefix|><?php namespace Wallabag\Consumer; use Simpleue\Job\Job; class RedisEntryConsumer extends AbstractConsumer implements Job { ...
fim
wallabag/wallabag
php
<|fim_suffix|> $user = parent::getUser(); \assert(null === $user || $user instanceof User); return $user; } } <|fim_prefix|><?php namespace Wallab<|fim_middle|>ag\Controller; use Symfony\Bundle\FrameworkBundle\Controller\AbstractController as BaseAbstractController; use Wallabag\Entity\User...
fim
wallabag/wallabag
php
<|fim_prefix|><?php namespace Wallabag\Controller; use Doctrine\ORM\EntityManagerInterface; use FOS\RestBundle\Controller\AbstractFOSRestController; use JMS\Serializer\SerializerInterface; use Sensio\Bundle\FrameworkExtraBundle\Configuration\IsGranted; use Symfony\Component\Form\FormFactoryInterface; use Symfony\Comp...
fim
wallabag/wallabag
php
<|fim_prefix|><?php namespace Wallabag\Controller\Api; use Nelmio\ApiDocBundle\Annotation\Operation; use OpenApi\Annotations as OA; use Sensio\Bundle\FrameworkExtraBundle\Configuration\IsGranted; use Symfony\Component\HttpFoundation\Request; use Symfony\Component\HttpFoundation\Response; use Symfony\Component\Routing...
fim
wallabag/wallabag
php
<|fim_prefix|><?php namespace Wallabag\Controller\Api; use JMS\Serializer\SerializationContext; use JMS\Serializer\SerializerInterface; use Nelmio\ApiDocBundle\Annotation\Operation; use OpenApi\Annotations as OA; use Symfony\Component\HttpFoundation\JsonResponse; use Symfony\Component\Routing\Annotation\Route; class...
fim
wallabag/wallabag
php
<|fim_suffix|>indexAction(ClientRepository $repo) { $clients = $repo->findByUser($this->getUser()->getId()); return $this->render('Developer/index.html.twig', [ 'clients' => $clients, ]); } /** * Create a client (an app). * * @return Response */ ...
fim
wallabag/wallabag
php
<|fim_prefix|><?php namespace Wallabag\Controller\Api; use Hateoas\Configuration\Route as HateoasRoute; use Hateoas\Representation\Factory\PagerfantaFactory; use Nelmio\ApiDocBundle\Annotation\Operation; use OpenApi\Annotations as OA; use Pagerfanta\Pagerfanta; use Psr\Log\LoggerInterface; use Sensio\Bundle\Framework...
fim
wallabag/wallabag
php
<|fim_suffix|> $page = $request->query->getInt('page', 1); $perPage = $request->query->getInt('perPage', 30); $qb = $entryRepository->getBuilderForSearchByUser( $this->getUser()->getId(), $term, null ); $pagerAdapter = new DoctrineORMAdapter(...
fim
wallabag/wallabag
php
<|fim_prefix|><?php namespace Wallabag\Controller\Api; use Nelmio\ApiDocBundle\Annotation\Operation; use OpenApi\Annotations as OA; use Symfony\Component\HttpFoundation\JsonResponse; use Symfony\Component\HttpFoundation\Request; use Symfony\Component\Routing\Annotation\Route; use Wallabag\Entity\Entry; use Wallabag\E...
fim
wallabag/wallabag
php
<?php namespace Wallabag\Controller\Api; use JMS\Serializer\SerializationContext; use JMS\Serializer\SerializerBuilder; use Nelmio\ApiDocBundle\Annotation\Operation; use OpenApi\Annotations as OA; use Symfony\Component\HttpFoundation\Response; use Symfony\Component\Routing\Annotation\Route; class TaggingRuleRestCont...
fim
wallabag/wallabag
php
<|fim_prefix|><?php namespace Wallabag\Controller\Api; use Craue\ConfigBundle\Util\Config; use Doctrine\ORM\EntityManagerInterface; use FOS\UserBundle\Event\UserEvent; use FOS\UserBundle\FOSUserEvents; use FOS\UserBundle\Model\UserManagerInterface; use JMS\Serializer\SerializationContext; use Nelmio\ApiDocBundle\Anno...
fim
wallabag/wallabag
php
<?php namespace Wallabag\Controller\Api; use Craue\ConfigBundle\Util\Config; use Doctrine\ORM\EntityManagerInterface; use FOS\RestBundle\Controller\AbstractFOSRestController; use JMS\Serializer\SerializationContext; use JMS\Serializer\SerializerInterface; use Nelmio\ApiDocBundle\Annotation\Model; use Nelmio\ApiDocBun...
fim
wallabag/wallabag
php
<|fim_prefix|><?php namespace Wallabag\Controller; use Craue\ConfigBundle\Util\Config; use Doctrine\DBAL\Platforms\SqlitePlatform; use Doctrine\ORM\EntityManagerInterface; use FOS\UserBundle\Model\UserManagerInterface; use JMS\Serializer\SerializationContext; use JMS\Serializer\SerializerBuilder; use PragmaRX\Recover...
fim
wallabag/wallabag
php
<|fim_suffix|>.twig', ['entry' => $entry] ); } /** * Reload an entry. * Refetch content from the website and make it readable again. * * @return RedirectResponse */ #[Route(path: '/reload/{id}', name: 'reload_entry', methods: ['POST'], requirements: ['id' => '\d...
fim
wallabag/wallabag
php
<|fim_prefix|><?php namespace Wallabag\Controller; use Sensio\Bundle\FrameworkExtraBundle\Configuration\IsGranted; use Symfony\Component\HttpFoundation\Request; use Symfony\Component\HttpFoundation\Response; use Symfony\Component\HttpKernel\Exception\NotFoundHttpException; use Symfony\Component\Routing\Annotation\Rou...
fim
wallabag/wallabag
php
<?php namespace Wallabag\Controller; use Pagerfanta\Adapter\ArrayAdapter; use Pagerfanta\Doctrine\ORM\QueryAdapter as DoctrineORMAdapter; use Pagerfanta\Exception\OutOfRangeCurrentPageException; use Pagerfanta\Pagerfanta; use Sensio\Bundle\FrameworkExtraBundle\Configuration\IsGranted; use Sensio\Bundle\FrameworkExtra...
fim
wallabag/wallabag
php
<|fim_prefix|><?php namespace Wallabag\Controller; use Doctrine\ORM\EntityManagerInterface; use Sensio\Bundle\FrameworkExtraBundle\Configuration\IsGranted; use Symfony\Component\Form\Form; use Symfony\Component\Form\FormInterface; use Symfony\Component\HttpFoundation\RedirectResponse; use Symfony\Component\HttpFounda...
fim
wallabag/wallabag
php
<|fim_suffix|> $this->addFlash('notice', $message); return $this->redirect($this->generateUrl('homepage')); } $this->addFlash('notice', 'flashes.import.notice.failed_on_file'); } return $this->render($this->getImportTemplate(), [ 'form' => ...
fim
wallabag/wallabag
php
<|fim_prefix|><?php namespace Wallabag\Controller\Import; use Craue\ConfigBundle\Util\Conf<|fim_suffix|>mponent\Routing\Annotation\Route; use Symfony\Contracts\Translation\TranslatorInterface; use Wallabag\Import\ChromeImport; use Wallabag\Redis\Producer as RedisProducer; class ChromeController extends BrowserContro...
fim
wallabag/wallabag
php
<|fim_suffix|>g\Redis\Producer as RedisProducer; class DeliciousController extends AbstractController { public function __construct( private readonly RabbitMqProducer $rabbitMqProducer, private readonly RedisProducer $redisProducer, private readonly array $allowMimetypes, private re...
fim
wallabag/wallabag
php
<|fim_suffix|>roducer); } elseif ($this->craueConfig->get('import_with_redis')) { $this->elcuratorImport->setProducer($this->redisProducer); } return $this->elcuratorImport; } protected function getImportTemplate() { return 'Import/Elcurator/index.html.twig'; ...
fim
wallabag/wallabag
php
<|fim_suffix|>Template() { return 'Import/Firefox/index.html.twig'; } } <|fim_prefix|><?php namespace Wallabag\Controller\Import; use Craue\ConfigBundle\Util\Config; use OldSound\RabbitMqBundle\RabbitMq\Producer as RabbitMqProducer; use Sensio\Bundle\FrameworkExtraBundle\Configuration\IsGranted; use S...
fim
wallabag/wallabag
php
<|fim_prefix|><?php namespace Wallabag\Controller\Import; use Sensio\Bundle\FrameworkExtraBundle\Configuration\IsGranted; use Symfony\Component\HttpFoundation\Request; use Symfony\Component\HttpFoundation\Response; use Symfony\Component\Routing\Annotation\Route; use Symfony\Contracts\Translation\TranslatorInterface; ...
fim
wallabag/wallabag
php
<|fim_suffix|> + $this->redisClient->llen('wallabag.import.chrome') + $this->redisClient->llen('wallabag.import.instapaper') + $this->redisClient->llen('wallabag.import.pinboard') + $this->redisClient->llen('wallabag.import.delicious') + $t...
fim
wallabag/wallabag
php
<|fim_prefix|><?php namespace Wal<|fim_suffix|>r->setProducer($this->rabbitMqProducer); } elseif ($craueConfig->get('import_with_redis')) { $instapaper->setProducer($this->redisProducer); } if ($form->isSubmitted() && $form->isValid()) { $file = $form->get('file')->getD...
fim
wallabag/wallabag
php
<?php namespace Wallabag\Controller\Import; use Craue\ConfigBundle\Util\Config; use OldSound\RabbitMqBundle\RabbitMq\Producer as RabbitMqProducer; use Sensio\Bundle\FrameworkExtraBundle\Configuration\IsGranted; use Symfony\Component\HttpFoundation\Request; use Symfony\Component\Routing\Annotation\Route; use Symfony\C...
fim
wallabag/wallabag
php
<|fim_suffix|>_file'); } return $this->render('Import/Pinboard/index.html.twig', [ 'form' => $form->createView(), 'import' => $pinboard, ]); } } <|fim_prefix|><?php namespace Wallabag\Controller\Import; use Craue\ConfigBundle\Util\Config; use OldSound\RabbitMqBundl...
fim
wallabag/wallabag
php
<|fim_suffix|>ocket = $this->getPocketImportService($pocketImport); $markAsRead = $this->session->get('mark_as_read'); $this->session->remove('mark_as_read'); // something bad happend on pocket side if (false === $pocket->authorize($this->session->get('import.pocket.code'))) { ...
fim
wallabag/wallabag
php
<|fim_suffix|>ce', 'flashes.import.notice.failed_on_file'); } return $this->render('Import/PocketCsv/index.html.twig', [ 'form' => $form->createView(), 'import' => $this->pocketCsvImport, ]); } protected function getImportService() { if ($this->craue...
fim
wallabag/wallabag
php
<|fim_suffix|> } return $this->pocketHtmlImport; } protected function getImportTemplate() { return 'Import/PocketHtml/index.html.twig'; } } <|fim_prefix|><?php namespace Wallabag\Controller\Import; use Craue\ConfigBundle\Util\Config; use OldSound\RabbitMqBundle\RabbitMq\Producer ...
fim
wallabag/wallabag
php
<|fim_suffix|>notice', 'flashes.import.notice.failed_on_file'); } return $this->render('Import/Readability/index.html.twig', [ 'form' => $form->createView(), 'import' => $readability, ]); } } <|fim_prefix|><?php namespace Wallabag\Controller\Import; use Craue\Confi...
fim
wallabag/wallabag
php
<|fim_prefix|><?php namespace Wallabag\Controller\Import; use Craue\ConfigBundle\Util\Config; use OldSound\RabbitMqBundle\RabbitMq\Producer as RabbitMqProducer; use Sensio\Bundle\FrameworkExtraBundle\Configuration\IsGranted; use Symfony\Component\HttpFoundation\Request; use Symfony\Component\Routing\Annotation\Route;...
fim
wallabag/wallabag
php
<|fim_suffix|> $message = 'flashes.import.notice.failed'; if (true === $res) { $summary = $wallabag->getSummary(); $message = $translator->trans('flashes.import.notice.summary', [ '%imported%' => $summary['imported'], ...
fim
wallabag/wallabag
php
<|fim_prefix|><?php namespace Wallabag\Controller\Import; use Craue\ConfigBundle\Util\Config; use OldSound\RabbitMqBundle\RabbitMq\Producer as RabbitMqProducer; use Sensio\Bundl<|fim_suffix|>\Import\WallabagV1Import; use Wallabag\Redis\Producer as RedisProducer; class WallabagV1Controller extends WallabagController ...
fim
wallabag/wallabag
php
<?php namespace Wallabag\Controller\Import; use Craue\ConfigBundle\Util\Config; use OldSound\RabbitMqBundle\RabbitMq\Producer as RabbitMqProducer; use Sensio\Bundle\FrameworkExtraBundle\Configuration\IsGranted; use Symfony\Component\HttpFoundation\Request; use Symfony\Component\Routing\Annotation\Route; use Symfony\C...
fim
wallabag/wallabag
php
<|fim_prefix|><?php namespace Wallabag\Controller; use Craue\ConfigBundle\Util\Config; use Doctrine\ORM\EntityManagerInterface; use Sensio\Bundle\FrameworkExtraBundle\Configuration\IsGranted; use Symfony\Component\Form\Form; use Symfony\Component\Form\FormInterface; use Symfony\Component\HttpFoundation\RedirectRespon...
fim
wallabag/wallabag
php
<|fim_prefix|><?php namespace Wallabag\Controller; use Sensio\Bundle\FrameworkExtraBundle\Configuration\IsGranted; use Symfony\Component\Routing\Annotation\Route; class StaticController extends AbstractController { public function __construct( private readonly array $addonsUrl, private readonly s...
fim
wallabag/wallabag
php
<|fim_prefix|><?php namespace Wallabag\Controller; use Doctrine\ORM\EntityManagerInterface; use Doctrine\ORM\QueryBuilder; use Pagerfanta\Adapter\ArrayAdapter; use Pagerfanta\Exception\OutOfRangeCurrentPageException; use Sensio\Bundle\FrameworkExtraBundle\Configuration\IsGranted; use Sensio\Bundle\FrameworkExtraBundl...
fim
wallabag/wallabag
php
<|fim_prefix|><?php namespace Wallabag\Controller; use Doctrine\ORM\EntityManagerInterface; use FOS\UserBundle\Event\UserEvent; use FOS\UserBundle\FOSUserEvents; use FOS\UserBundle\Model\UserManagerInterface; use Pagerfanta\Doctrine\ORM\QueryAdapter as DoctrineORMAdapter; use Pagerfanta\Exception\OutOfRangeCurrentPag...
fim
wallabag/wallabag
php
<|fim_prefix|><?php namespace Wallabag\Doctrine; use Doctrine\DBAL\Platforms\AbstractPlatform; use Doctrine\DBAL\Types\J<|fim_suffix|>n order to avoid error during migrations. * * @see https://github.com/doctrine/dbal/commit/6ed32a9a941acf0cb6ad384b84deb8df68ca83f8 * @see https://dunglas.dev/2022/01/json-columns-a...
fim
wallabag/wallabag
php
<?php namespace Wallabag\Doctrine; use Doctrine\Migrations\AbstractMigration; use Doctrine\Migrations\Version\MigrationFactory; /** * Decorates the migration factory to pass some additional information to the migration instances. */ class MigrationFactoryDecorator implements MigrationFactory { public function ...
fim
wallabag/wallabag
php
<|fim_prefix|><?php namespace Wallabag\Doctrine; use Doctrine\DBAL\Platforms\PostgreSQLPlatform; use Doctrine\DBAL\Schema\Schema; use Doctrine\Migrations\AbstractMigration; abstract class WallabagMigration extends AbstractMigration { public<|fim_suffix|>on (only needed for PHP 8) * * @see https://githu...
fim
wallabag/wallabag
php
<|fim_prefix|><?php namespace Wallabag\Entity; use Doctrine\ORM\Mapping as ORM; use JMS\Serializer\Annotation\Exclude; use JMS\Serializer\Annotation\ExclusionPolicy; use JMS\Serializer\Annotation\Groups; use JMS\Serializer\Annotation\SerializedName; use JMS\Serializer\Annotation\VirtualProperty; use Symfony\Component...
fim
wallabag/wallabag
php
<|fim_suffix|>d', onDelete: 'CASCADE')] #[ORM\ManyToOne(targetEntity: User::class)] protected $user; } <|fim_prefix|><?php namespace Wallabag\Entity\Api; use Doctrine\ORM\Mapping as ORM; use FOS\OAuthServerBundle\Entity\AccessToken as BaseAccessToken; use Wallabag\Entity\User; #[ORM\Table('oauth2_access_toke...
fim
wallabag/wallabag
php
<|fim_suffix|>registration = $allowed_registration; } } <|fim_prefix|><?php namespace Wallabag\Entity\Api; use OpenApi\Annotations as OA; class ApplicationInfo { /** * @var string * @OA\Property( * description="Name of the application.", * type="string", * e<|fim_middl...
fim
wallabag/wallabag
php
<?php namespace Wallabag\Entity\Api; use Doctrine\ORM\Mapping as ORM; use FOS\OAuthServerBundle\Entity\AuthCode as BaseAuthCode; use Wallabag\Entity\User; #[ORM\Table('oauth2_auth_codes')] #[ORM\Entity] class AuthCode extends BaseAuthCode { #[ORM\Id] #[ORM\Column(type: 'integer')] #[ORM\GeneratedValue(st...
fim
wallabag/wallabag
php
<|fim_prefix|><?php namespace Wallabag\Entity\Api; use Doctrine\ORM\Mapping as ORM; use FOS\OAuthServerBundle\Entity\Client as BaseClient; use JMS\Serializer\Annotation\Groups; use JMS\Serializer\Annotation\SerializedName; use JMS\Serializer\Annotation\VirtualProperty; use OpenApi\Annotations as OA; use Wallabag\Enti...
fim
wallabag/wallabag
php
<|fim_prefix|><?php namespace Wallabag\Entity\Api; use Doctrine\ORM\Mapping as ORM; use FOS\OAuthServerBundle\Entity\RefreshToken as BaseRefreshToken; use Wallabag\Entity\User;<|fim_suffix|>#[ORM\Entity] class RefreshToken extends BaseRefreshToken { #[ORM\Id] #[ORM\Column(type: 'integer')] #[ORM\Generated...
fim
wallabag/wallabag
php
<|fim_suffix|>e $rule) { $this->ignoreOriginRules[] = $rule; return $this; } /** * @return ArrayCollection<IgnoreOriginUserRule> */ public function getIgnoreOriginRules() { return $this->ignoreOriginRules; } } <|fim_prefix|><?php namespace Wallabag\Entity; u...
fim
wallabag/wallabag
php
<|fim_prefix|><?php namespace Wallabag\Entity; use Doctrine\Common\Collections\ArrayCollection; use Doctrine\Common\Collections\Collection; use Doctrine\ORM\Mapping as ORM; use Hateoas\Configuration\Annotation as Hateoas; use JMS\Serializer\Annotation\Exclude; use JMS\Serializer\Annotation\Groups; use JMS\Serializer\...
fim
wallabag/wallabag
php
<|fim_prefix|><?php namespace Wallabag\Entity; use Doctrine\ORM\Mapping as ORM; use Symfony\Bridge\RulerZ\Validator\Constraints as RulerZAssert; use Symfony\Component\<|fim_suffix|>etId() { return $this->id; } /** * Set rule. * * @return IgnoreOriginRuleInterface */ public...
fim
wallabag/wallabag
php
<|fim_prefix|><?php <|fim_suffix|> public function setRule(string $rule); public function getRule(); } <|fim_middle|> namespace Wallabag\Entity; interface IgnoreOriginRuleInterface { public function getId(); <|endoftext|>
fim
wallabag/wallabag
php
<|fim_suffix|> return $this->rule; } /** * Set config. * * @return IgnoreOriginUserRule */ public function setConfig(Config $config) { $this->config = $config; return $this; } /** * Get config. * * @return Config */ public functio...
fim
wallabag/wallabag
php
<|fim_suffix|>e to fix utf8mb4 issue. */ #[ORM\Table(name: '`internal_setting`')] #[ORM\Entity(repositoryClass: SettingRepository::class)] class InternalSetting extends BaseSetting { /** * @var string|null */ #[ORM\Column(name: 'value', type: 'string', nullable: true)] protected $value; } <|fim_p...
fim
wallabag/wallabag
php
<|fim_prefix|><?php namespace Wallabag\Entit<|fim_suffix|> interface RuleInterface { } <|fim_middle|>y; <|endoftext|>
fim
wallabag/wallabag
php
<|fim_prefix|><?php namespace Wallabag\Entity; use Doctrine\ORM\Mapping as ORM; use Symfony\Component\Validator\Constraints as Assert; use Wallabag\Helper\EntityTimestampsTrait; use Wallabag\Repository\SiteCredentialRepository; /** * SiteCredential. */ #[ORM\Table(name: '`site_credential`')] #[ORM\Entity(repositor...
fim
wallabag/wallabag
php
<?php namespace Wallabag\Entity; use Doctrine\Common\Collections\ArrayCollection; use Doctrine\Common\Collections\Collection; use Doctrine\ORM\Mapping as ORM; use Gedmo\Mapping\Annotation as Gedmo; use JMS\Serializer\Annotation\ExclusionPolicy; use JMS\Serializer\Annotation\Expose; use JMS\Serializer\Annotation\XmlRo...
fim
wallabag/wallabag
php
<|fim_prefix|><?php namespace Wallabag\Entity; use Doctrine\ORM\Mapping as ORM; use JMS\Serializer\Annotation\Exclude; use JMS\Serializer\Annotation\Groups; use JMS\Serializer\Annotation\XmlRoot; use Symfony\Bridge\RulerZ\Validator\Constraints as RulerZAssert; use Symfony\Component\Validator\Constraints as Assert; us...
fim
wallabag/wallabag
php
<|fim_prefix|><?php namespace Wallabag\Entity; use Doctrine\Common\Collections\ArrayCollection; use Doctrine\Common\Collections\Collection; use Doctrine\ORM\Mapping as ORM; use FOS\UserBundle\Model\User as BaseUser; use JMS\Serializer\Annotation\Accessor; use JMS\Serializer\Annotation\Groups; use JMS\Serializer\Annot...
fim
wallabag/wallabag
php
<|fim_suffix|> NAME = 'config.updated'; public function __construct( protected Config $config, ) { } public function getConfig(): Config { return $this->config; } } <|fim_prefix|><?php namespace Wa<|fim_middle|>llabag\Event; use Symfony\Contracts\EventDispatcher\Event; use Wa...
fim
wallabag/wallabag
php
<?php namespace Wallabag\Event; use Symfony\Contracts\EventDispatcher\Event; use Wallabag\Entity\Entry; /** * This event is fired as soon as an entry is deleted. */ class EntryDeletedEvent extends Event { public const NAME = 'entry.deleted'; public function __construct( protected Entry $entry, ...
fim
wallabag/wallabag
php
<|fim_prefix|><?php namespace Wallabag\Event; us<|fim_suffix|>* * This event is fired as soon as an entry was saved. */ class EntrySavedEvent extends Event { public const NAME = 'entry.saved'; public function __construct( protected Entry $entry, ) { } public function getEntry(): Entry ...
fim
wallabag/wallabag
php
<|fim_suffix|>inFailureEvent::class => 'onAuthenticationFailure', ]; } /** * On failure, add a custom error in log so server admin can configure fail2ban to block IP from people who try to login too much. */ public function onAuthenticationFailure(): void { $request = $this->r...
fim
wallabag/wallabag
php
<|fim_suffix|>etMainRequest()->getSession(); $language = $session->get('_locale', $this->language); } $user = $event->getUser(); \assert($user instanceof User); $config = new Config($user); $config->setItemsPerPage($this->itemsOnPage); $config->setFeedLimit(...
fim
wallabag/wallabag
php
<|fim_suffix|> $request->setLocale($request->getSession()->get('_locale', $this->defaultLocale)); } } public static function getSubscribedEvents(): array { return [ // must be registered before the default Locale listener KernelEvents::REQUEST => [['onKernel...
fim
wallabag/wallabag
php
<?php namespace Wallabag\Event\Listener; use FOS\UserBundle\Event\FormEvent; use FOS\UserBundle\FOSUserEvents; use Symfony\Component\EventDispatcher\EventSubscriberInterface; use Symfony\Component\HttpFoundation\RedirectResponse; use Symfony\Component\Routing\Generator\UrlGeneratorInterface; /** * Listener responsi...
fim
wallabag/wallabag
php
<|fim_suffix|>ponse(new RedirectResponse($this->urlGenerator->generate('fos_user_security_login'), 301)); } } <|fim_prefix|><?php namespace Wallabag\Event\Listener; use FOS\UserBundle\Event\GetResponseUserEvent; use FOS\UserBundle\FOSUserEvents; use Symfony\Component\EventDispatcher\EventSubscriberInterface; use ...
fim
wallabag/wallabag
php
<|fim_prefix|><?php namespace Wallabag\Event\Listener; use Symfony\Component\HttpFoundation\Session\SessionInterface; use Symfony\Component\Security\Ht<|fim_suffix|>ser doesn't change it from the login screen), override it with the user's config one. * * This can be used by the LocaleListener afterwards. * * @see...
fim
wallabag/wallabag
php
<|fim_prefix|><?php namespace Wallabag\Event\Subscriber; use Symfony\Component\EventDispatcher\EventSubscriberInterface; use Symfony\Component\HttpKernel\Event\ExceptionEvent; use Symfony\Component\HttpKernel\Exception\AccessDeniedHttpException; use Symfony\Component\HttpKernel\Exception\NotFoundHttpException; use Sy...
fim
wallabag/wallabag
php
<|fim_suffix|>ery; use Symfony\Component\EventDispatcher\EventSubscriberInterface; /** * This custom class override the default behavior of SpiriitFormFilterBundle on `filter_date_range` * It converts a date_range to date_time_range to add hour to be able to grab a whole day (from 00:00:00 to 23:59:59). */ class Cu...
fim
wallabag/wallabag
php
<|fim_prefix|><?php namespace Wallabag\Event\Subscriber; use Doctrine\ORM\EntityManagerInterface; use Psr\Log\LoggerInterface; use Symfony\Component\EventDispatcher\EventSubscriberInterface; use Wallabag\Entity\Entry; use Wallabag\Event\EntryDeletedEvent; use Wallabag\Event\EntrySavedEvent; use Wallabag\Helper\Downlo...
fim
wallabag/wallabag
php
<|fim_prefix|><?php namespace Wallabag\Event\Subscriber; use Doctrine\ORM\EntityManagerInterface; use ScssPhp\ScssPhp\Compiler; use Symfony\Component\Even<|fim_suffix|> ; ')->getCss(); $config->setCustomCSS($css); $this->em->persist($config); $this->em->flush(); } } <|fim_middl...
fim
wallabag/wallabag
php
<|fim_prefix|><?php namespace Wallabag\Event\Subscriber; use Doctrine\Common\EventSubscriber; use Doctrine\DBAL\Platforms\SqlitePlatform; use Doctrine\ORM\Event\PreRemoveEventArgs; use Doctrin<|fim_suffix|>eleteSubscriber implements EventSubscriber { public function __construct( private readonly ManagerRe...
fim
wallabag/wallabag
php
<|fim_prefix|><?php namespace Wallabag\Event\Subscriber; use Doctrine\Common\EventSubscriber; use Doctrine\DBAL\Platforms\MySQLPlatform; use Doctrine\ORM\Tools\Event\GenerateSchemaEventArgs; class SchemaAdapterSubscriber implements EventSubscriber { public function __construct( <|fim_suffix|>', 'utf8mb4'...
fim
wallabag/wallabag
php
<?php namespace Wallabag\Event\Subscriber; use Doctrine\Common\EventSubscriber; use Doctrine\ORM\Event\LoadClassMetadataEventArgs; use Doctrine\ORM\Mapping\ClassMetadataInfo; /** * Puts a prefix to each table. * This way were used instead of using the built-in strategy from Doctrine, using `naming_strategy` * Bec...
fim
wallabag/wallabag
php
<?php namespace Wallabag\ExpressionLanguage; use Symfony\Component\DomCrawler\Crawler; use Symfony\Component\ExpressionLanguage\ExpressionFunction; use Symfony\Component\ExpressionLanguage\ExpressionFunctionProviderInterface; use Symfony\Contracts\HttpClient\HttpClientInterface; class AuthenticatorProvider implement...
fim
wallabag/wallabag
php
<?php namespace Wallabag\Form\DataTransformer; use Symfony\Component\Form\DataTransformerInterface; use Symfony\Component\Form\Exception\UnexpectedTypeException; /** * Transforms a comma-separated list to a proper PHP array. * Example: the string "foo, bar" will become the array ["foo", "bar"]. */ class StringToL...
fim
wallabag/wallabag
php
<|fim_prefix|><?php namespace Wallabag\Form\Type\Api; use Symfony\Component\Form\AbstractType; use Symfony\Component\Form\CallbackTransformer; use Symfony\Component\Form\Extension\Core\Type\SubmitType; use Symfony\Component\Form\Extension\Core\Typ<|fim_suffix|>unction buildForm(FormBuilderInterface $builder, array $o...
fim
wallabag/wallabag
php
<|fim_prefix|><?php namespace Wallabag\Form\Type; use Symfony\Component\Form\AbstractType; use Symfony\Component\Form\Extension\Core\Type\PasswordType; use Symfony\Component\Form\Extension\Core\Type\RepeatedType; use Symfony\Component\Form\Extension\Core\Type\SubmitType; use Symfony\Component\Form\FormBuilderInterfac...
fim
wallabag/wallabag
php
<|fim_suffix|> ]) ; } public function configureOptions(OptionsResolver $resolver): void { $resolver->setDefaults([ 'data_class' => Config::class, ]); } public function getBlockPrefix(): string { return 'config'; } /** * Creates ...
fim
wallabag/wallabag
php
<|fim_suffix|> ; } } <|fim_prefix|><?php namespace Wallabag\Form\Type; use Symfony\Component\Form\AbstractType; use Symfony\Component\Form\FormBuilderInterface; class EditAnnotationType extends AbstractType { public function buildForm(FormBuilderInterface $builder, array $options): void { $bui...
fim
wallabag/wallabag
php
<|fim_prefix|><?php namespace Wallabag\Form\Type; use Symfony\Component\Form\AbstractType; use Symfony\Component\Form\Extension\Core\Type\SubmitType; use Symfony\Component\Form\Extension\Core\Type\TextType; use Symfony\Component\Form\Extension\Core\Type\UrlType; use Symfony\Component\Form\FormBuilderInterface; use Sy...
fim
wallabag/wallabag
php
<|fim_prefix|><?php namespace Wallabag\Form\Type; use Spiriit\Bundle\FormFilterBundle\Filter\Doctrine\ORMQuery; use Spiriit\Bundle\FormFilterBundle\Filter\FilterOperands; use Spiriit\Bundle\FormFilterBundle\Filter\Form\Type\CheckboxFilterType; use Spiriit\Bundle\FormFilterBundle\Filter\Form\Type\ChoiceFilterType; use...
fim
wallabag/wallabag
php
<|fim_prefix|><?php namespace Wallabag\Form\Type; use Symfony\Component\Form\AbstractType; use Symfony\Component\Form\Extension\Core\Type\SubmitType; use Symfony\Component\Form\FormBuilderInterface; use Symfony\Component\OptionsResolver\OptionsResolver; use Wallabag\Entity\Config; class FeedType extends AbstractType...
fim
wallabag/wallabag
php
<|fim_suffix|>{ $resolver->setDefaults([ 'data_class' => IgnoreOriginInstanceRule::class, ]); } public function getBlockPrefix(): string { return 'ignore_origin_instance_rule'; } } <|fim_prefix|><?php namespace Wallabag\Form\Type; use Symfony\Component\Form\Abstrac...
fim
wallabag/wallabag
php
<|fim_suffix|>Options(OptionsResolver $resolver): void { $resolver->setDefaults([ 'data_class' => IgnoreOriginUserRule::class, ]); } public function getBlockPrefix(): string { return 'ignore_origin_user_rule'; } } <|fim_prefix|><?php namespace Wallabag\Form\Type...
fim
wallabag/wallabag
php
<|fim_suffix|> '', 'trim' => false, ]) ->add('ranges', CollectionType::class, [ 'entry_type' => RangeType::class, 'allow_add' => true, ]) ; } public function configureOptions(OptionsResolver $resolver): void { ...
fim
wallabag/wallabag
php
<|fim_suffix|>ntry'; } } <|fim_prefix|><?php namespace Wallabag\Form\Type; use Symfony\Component\Form\AbstractType; use Symfony\Component\Form\Extension\Core\Type\UrlType; use Symfony\Component\Form\FormBuilderInterface; use Symfony\Component\OptionsResolver\OptionsResolver; use Wallabag\Entity\Entry; class NewE...
fim
wallabag/wallabag
php
<|fim_prefix|><?php namespace Wallabag\Form\Type; use Symfony\Component\Form\AbstractType; use Symfony\Component\Form\Extension\Core\Type\SubmitType; use Symfony\Component\Form\Extension\Core\Type\TextType; use Symfony\Component\Form\FormBuilderInterface;<|fim_suffix|>r, array $options): void { $builder ...
fim
wallabag/wallabag
php