@@ -31,18 +31,18 @@ |
||
31 | 31 | |
32 | 32 | public function execute(InputInterface $input, OutputInterface $output) |
33 | 33 | { |
34 | - $output->writeln('<info>Fetching data from </info> ' . $this->suffixListEndpoint); |
|
34 | + $output->writeln('<info>Fetching data from </info> '.$this->suffixListEndpoint); |
|
35 | 35 | $filesystem = new Filesystem(); |
36 | - $dir = $this->container->getParameter('kernel.project_dir') . '/src/SWP/Component/MultiTenancy/'; |
|
37 | - if ($filesystem->exists($dir . $this->suffixListFilename)) { |
|
38 | - $filesystem->remove($dir . $this->suffixListFilename); |
|
36 | + $dir = $this->container->getParameter('kernel.project_dir').'/src/SWP/Component/MultiTenancy/'; |
|
37 | + if ($filesystem->exists($dir.$this->suffixListFilename)) { |
|
38 | + $filesystem->remove($dir.$this->suffixListFilename); |
|
39 | 39 | } |
40 | 40 | $filesystem->mkdir($dir); |
41 | - $filesystem->touch($dir . $this->suffixListFilename); |
|
41 | + $filesystem->touch($dir.$this->suffixListFilename); |
|
42 | 42 | $data = file_get_contents($this->suffixListEndpoint); |
43 | - $filesystem->dumpFile($dir . $this->suffixListFilename, $data); |
|
43 | + $filesystem->dumpFile($dir.$this->suffixListFilename, $data); |
|
44 | 44 | |
45 | - $output->writeln('<info>Data saved into:</info> ' . $dir . $this->suffixListFilename); |
|
45 | + $output->writeln('<info>Data saved into:</info> '.$dir.$this->suffixListFilename); |
|
46 | 46 | return 0; |
47 | 47 | } |
48 | 48 | } |
49 | 49 | \ No newline at end of file |
@@ -25,7 +25,7 @@ |
||
25 | 25 | */ |
26 | 26 | public function generateUrl(FileInterface $file, string $basePath): string |
27 | 27 | { |
28 | - $key = $basePath . '/' . $file->getAssetId() . '.' . $file->getFileExtension(); |
|
29 | - return 'https://storage.googleapis.com/' . $this->bucket->name() . '/' . $key; |
|
28 | + $key = $basePath.'/'.$file->getAssetId().'.'.$file->getFileExtension(); |
|
29 | + return 'https://storage.googleapis.com/'.$this->bucket->name().'/'.$key; |
|
30 | 30 | } |
31 | 31 | } |
32 | 32 | \ No newline at end of file |
@@ -15,7 +15,7 @@ |
||
15 | 15 | */ |
16 | 16 | public static function createGCSClient(ContainerInterface $container, string $keyFilePath): StorageClient |
17 | 17 | { |
18 | - $path = $container->getParameter('kernel.project_dir') . '/config/gcs/' . $keyFilePath; |
|
18 | + $path = $container->getParameter('kernel.project_dir').'/config/gcs/'.$keyFilePath; |
|
19 | 19 | return new StorageClient([ |
20 | 20 | 'keyFilePath' => $path, |
21 | 21 | ]); |
@@ -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); |