@@ -86,7 +86,7 @@ discard block |
||
86 | 86 | return $domainString; |
87 | 87 | } |
88 | 88 | |
89 | - return $domainString . '.' . $result->suffix()->toString(); |
|
89 | + return $domainString.'.'.$result->suffix()->toString(); |
|
90 | 90 | } |
91 | 91 | |
92 | 92 | protected function extractSubdomain(string $host = null): string |
@@ -119,15 +119,15 @@ discard block |
||
119 | 119 | */ |
120 | 120 | private function getPublicSuffixList(): string |
121 | 121 | { |
122 | - return $this->cacheProvider->get('suffix_list', function (ItemInterface $item) { |
|
123 | - $dir = __DIR__ . '/../'; |
|
122 | + return $this->cacheProvider->get('suffix_list', function(ItemInterface $item) { |
|
123 | + $dir = __DIR__.'/../'; |
|
124 | 124 | $filesystem = new Filesystem(); |
125 | - if (!$filesystem->exists($dir . $this->suffixListFilename)) { |
|
125 | + if (!$filesystem->exists($dir.$this->suffixListFilename)) { |
|
126 | 126 | throw new \LogicException( |
127 | 127 | 'Public suffix list file not found. Run swp:public-suffix-list:get command' |
128 | 128 | ); |
129 | 129 | } |
130 | - return file_get_contents($dir . $this->suffixListFilename); |
|
130 | + return file_get_contents($dir.$this->suffixListFilename); |
|
131 | 131 | }); |
132 | 132 | } |
133 | 133 | } |
@@ -42,11 +42,11 @@ discard block |
||
42 | 42 | class ContentPushController extends AbstractController { |
43 | 43 | private EventDispatcherInterface $eventDispatcher; |
44 | 44 | private FormFactoryInterface $formFactory; |
45 | - private MessageBusInterface $messageBus;//swp_multi_tenancy.tenant_context |
|
45 | + private MessageBusInterface $messageBus; //swp_multi_tenancy.tenant_context |
|
46 | 46 | private DataTransformerInterface $dataTransformer; // swp_bridge.transformer.json_to_package |
47 | 47 | private MediaManagerInterface $mediaManager; // swp_content_bundle.manager.media |
48 | 48 | private EntityManagerInterface $entityManager; // swp.object_manager.media |
49 | - private PackageRepository $packageRepository;//swp.repository.package |
|
49 | + private PackageRepository $packageRepository; //swp.repository.package |
|
50 | 50 | private FileProviderInterface $fileProvider; |
51 | 51 | |
52 | 52 | /** |
@@ -122,7 +122,7 @@ discard block |
||
122 | 122 | ); |
123 | 123 | } |
124 | 124 | |
125 | - throw new \Exception('Uploaded file is not valid:' . $uploadedFile->getErrorMessage()); |
|
125 | + throw new \Exception('Uploaded file is not valid:'.$uploadedFile->getErrorMessage()); |
|
126 | 126 | } |
127 | 127 | |
128 | 128 | return new SingleResourceResponse($form); |
@@ -41,11 +41,11 @@ |
||
41 | 41 | |
42 | 42 | protected function configureRoutes(RoutingConfigurator $routes): void |
43 | 43 | { |
44 | - $confDir = $this->getProjectDir() . '/config'; |
|
44 | + $confDir = $this->getProjectDir().'/config'; |
|
45 | 45 | |
46 | 46 | |
47 | - $routes->import($confDir . '/{routes}/' . $this->environment . '/**/*' . self::CONFIG_EXTS, 'glob'); |
|
48 | - $routes->import($confDir . '/{routes}/*' . self::CONFIG_EXTS, 'glob'); |
|
49 | - $routes->import($confDir . '/{routes}' . self::CONFIG_EXTS, 'glob'); |
|
47 | + $routes->import($confDir.'/{routes}/'.$this->environment.'/**/*'.self::CONFIG_EXTS, 'glob'); |
|
48 | + $routes->import($confDir.'/{routes}/*'.self::CONFIG_EXTS, 'glob'); |
|
49 | + $routes->import($confDir.'/{routes}'.self::CONFIG_EXTS, 'glob'); |
|
50 | 50 | } |
51 | 51 | } |
@@ -47,7 +47,7 @@ |
||
47 | 47 | } |
48 | 48 | } |
49 | 49 | $mim = MimeTypeHelper::getByExtension($extension); |
50 | - $response->headers->set('Content-Type', $mim .'; charset=UTF-8'); |
|
50 | + $response->headers->set('Content-Type', $mim.'; charset=UTF-8'); |
|
51 | 51 | } |
52 | 52 | } |
53 | 53 | } |
@@ -50,38 +50,38 @@ |
||
50 | 50 | protected function execute(InputInterface $input, OutputInterface $output) |
51 | 51 | { |
52 | 52 | $dir = $this->container->getParameter('kernel.project_dir'); |
53 | - $path = $dir . '/' . $input->getArgument('path'); |
|
53 | + $path = $dir.'/'.$input->getArgument('path'); |
|
54 | 54 | |
55 | 55 | if (!file_exists($path)) { |
56 | - throw new \InvalidArgumentException('File ' . $path . ' doe not exist.'); |
|
56 | + throw new \InvalidArgumentException('File '.$path.' doe not exist.'); |
|
57 | 57 | } |
58 | 58 | |
59 | - $output->writeln('<info>Checking file:</info> ' . $path); |
|
59 | + $output->writeln('<info>Checking file:</info> '.$path); |
|
60 | 60 | |
61 | 61 | $mimType = new FileBinaryMimeTypeGuesser(); |
62 | - $output->writeln('<info>FileBinaryMimeTypeGuesser:</info> ' . $mimType->guessMimeType($path)); |
|
62 | + $output->writeln('<info>FileBinaryMimeTypeGuesser:</info> '.$mimType->guessMimeType($path)); |
|
63 | 63 | |
64 | 64 | $mimType = new FileinfoMimeTypeGuesser(); |
65 | - $output->writeln('<info>FileinfoMimeTypeGuesser:</info> ' . $mimType->guessMimeType($path)); |
|
65 | + $output->writeln('<info>FileinfoMimeTypeGuesser:</info> '.$mimType->guessMimeType($path)); |
|
66 | 66 | |
67 | 67 | $mim = MimeTypes::getDefault()->guessMimeType($path); |
68 | - $output->writeln('<info>Default Symfony MimType:</info> ' . $mim); |
|
68 | + $output->writeln('<info>Default Symfony MimType:</info> '.$mim); |
|
69 | 69 | |
70 | 70 | |
71 | 71 | $mimByExtension = MimeTypes::getDefault()->getMimeTypes($ext = pathinfo($path, PATHINFO_EXTENSION)); |
72 | - $output->writeln('<info>MimType by extension:</info> ' . implode(',', $mimByExtension)); |
|
72 | + $output->writeln('<info>MimType by extension:</info> '.implode(',', $mimByExtension)); |
|
73 | 73 | |
74 | 74 | |
75 | 75 | $mimExtension = MimeTypes::getDefault()->getExtensions($mimByExtension[0]); |
76 | - $output->writeln('<info>Extension of mim types:</info> ' . $mimByExtension[0] . ' <info>is:</info> ' . implode(',', $mimExtension)); |
|
76 | + $output->writeln('<info>Extension of mim types:</info> '.$mimByExtension[0].' <info>is:</info> '.implode(',', $mimExtension)); |
|
77 | 77 | |
78 | 78 | $output->writeln('--------------- My ----------------'); |
79 | 79 | |
80 | - $output->writeln('<info>My MimTypes checker:</info> ' . \SWP\Bundle\CoreBundle\Util\MimeTypeHelper::getByPath($path)); |
|
81 | - $output->writeln('<info>My Extensions by MimTypes checker:</info> ' . \SWP\Bundle\CoreBundle\Util\MimeTypeHelper::getExtensionByMimeType('application/json')); |
|
82 | - $output->writeln('<info>My Extensions by MimTypes checker:</info> ' . \SWP\Bundle\CoreBundle\Util\MimeTypeHelper::getExtensionByMimeType('application/javascript')); |
|
83 | - $output->writeln('<info>My Extensions by MimTypes checker:</info> ' . \SWP\Bundle\CoreBundle\Util\MimeTypeHelper::getExtensionByMimeType('image/png')); |
|
84 | - $output->writeln('<info>My Extensions by MimTypes checker:</info> ' . \SWP\Bundle\CoreBundle\Util\MimeTypeHelper::getExtensionByMimeType('image/jpeg')); |
|
80 | + $output->writeln('<info>My MimTypes checker:</info> '.\SWP\Bundle\CoreBundle\Util\MimeTypeHelper::getByPath($path)); |
|
81 | + $output->writeln('<info>My Extensions by MimTypes checker:</info> '.\SWP\Bundle\CoreBundle\Util\MimeTypeHelper::getExtensionByMimeType('application/json')); |
|
82 | + $output->writeln('<info>My Extensions by MimTypes checker:</info> '.\SWP\Bundle\CoreBundle\Util\MimeTypeHelper::getExtensionByMimeType('application/javascript')); |
|
83 | + $output->writeln('<info>My Extensions by MimTypes checker:</info> '.\SWP\Bundle\CoreBundle\Util\MimeTypeHelper::getExtensionByMimeType('image/png')); |
|
84 | + $output->writeln('<info>My Extensions by MimTypes checker:</info> '.\SWP\Bundle\CoreBundle\Util\MimeTypeHelper::getExtensionByMimeType('image/jpeg')); |
|
85 | 85 | |
86 | 86 | return 0; |
87 | 87 | } |
@@ -20,7 +20,7 @@ discard block |
||
20 | 20 | * @param bool $all |
21 | 21 | * @return array|string |
22 | 22 | */ |
23 | - public static function getByPath(string $path, bool $all = false): array|string |
|
23 | + public static function getByPath(string $path, bool $all = false): array | string |
|
24 | 24 | { |
25 | 25 | $ext = pathinfo($path, PATHINFO_EXTENSION); |
26 | 26 | return self::getByExtension($ext, $all); |
@@ -31,7 +31,7 @@ discard block |
||
31 | 31 | * @param bool $all |
32 | 32 | * @return array|string |
33 | 33 | */ |
34 | - public static function getByExtension(string $ext, bool $all = false): array|string |
|
34 | + public static function getByExtension(string $ext, bool $all = false): array | string |
|
35 | 35 | { |
36 | 36 | $mimeType = MimeTypes::getDefault(); |
37 | 37 | $types = $mimeType->getMimeTypes($ext); |
@@ -52,7 +52,7 @@ discard block |
||
52 | 52 | * @param bool $all |
53 | 53 | * @return array|string |
54 | 54 | */ |
55 | - public static function getExtensionByMimeType(string $mime, bool $all = false): array|string |
|
55 | + public static function getExtensionByMimeType(string $mime, bool $all = false): array | string |
|
56 | 56 | { |
57 | 57 | $mimeType = MimeTypes::getDefault(); |
58 | 58 | $extensions = $mimeType->getExtensions($mime); |
@@ -137,7 +137,7 @@ |
||
137 | 137 | GuardAuthenticatorHandler $guardHandler, |
138 | 138 | LoginAuthenticator $authenticator |
139 | 139 | ): Response { |
140 | - $id = (int)$request->get('id'); // retrieve the user id from the url |
|
140 | + $id = (int) $request->get('id'); // retrieve the user id from the url |
|
141 | 141 | |
142 | 142 | if ($request->isXmlHttpRequest()) { |
143 | 143 | return $this->verifyUserEmailFromPWA($id, $request); |
@@ -54,7 +54,7 @@ |
||
54 | 54 | return $user; |
55 | 55 | } |
56 | 56 | |
57 | - public function loadUserByIdentifier(string $identifier): SecurityUserInterface|UserInterface |
|
57 | + public function loadUserByIdentifier(string $identifier): SecurityUserInterface | UserInterface |
|
58 | 58 | { |
59 | 59 | $user = $this->findUser($identifier); |
60 | 60 |
@@ -126,9 +126,9 @@ |
||
126 | 126 | return $data; |
127 | 127 | } |
128 | 128 | |
129 | - $callback = function ($matches) { |
|
129 | + $callback = function($matches) { |
|
130 | 130 | $matches[2] = trim(preg_replace('/\s\s+/', ' ', $matches[2])); |
131 | - return 's:' . mb_strlen($matches[2]) . ':"' . $matches[2] . '";'; |
|
131 | + return 's:'.mb_strlen($matches[2]).':"'.$matches[2].'";'; |
|
132 | 132 | }; |
133 | 133 | |
134 | 134 | $data = preg_replace_callback('!s:(\d+):"(.*?)";!s', $callback, $data); |