@@ -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); |
@@ -73,7 +73,7 @@ discard block |
||
| 73 | 73 | if (is_array($extraItem)) { |
| 74 | 74 | $extra = ArticleExtraEmbedField::newFromValue($key, $extraItem); |
| 75 | 75 | } else { |
| 76 | - $extra = ArticleExtraTextField::newFromValue($key, (string)$extraItem); |
|
| 76 | + $extra = ArticleExtraTextField::newFromValue($key, (string) $extraItem); |
|
| 77 | 77 | } |
| 78 | 78 | $extra->setArticle($article); |
| 79 | 79 | $this->entityManager->persist($extra); |
@@ -113,9 +113,9 @@ discard block |
||
| 113 | 113 | return $unserialized; |
| 114 | 114 | } |
| 115 | 115 | |
| 116 | - $callback = function ($matches) { |
|
| 116 | + $callback = function($matches) { |
|
| 117 | 117 | $matches[2] = trim(preg_replace('/\s\s+/', ' ', $matches[2])); |
| 118 | - return 's:' . mb_strlen($matches[2]) . ':"' . $matches[2] . '";'; |
|
| 118 | + return 's:'.mb_strlen($matches[2]).':"'.$matches[2].'";'; |
|
| 119 | 119 | }; |
| 120 | 120 | |
| 121 | 121 | $fixedData = preg_replace_callback('!s:(\d+):"(.*?)";!s', $callback, $data); |
@@ -94,15 +94,15 @@ |
||
| 94 | 94 | |
| 95 | 95 | if ($seoMetadata->getMetaMedia()) { |
| 96 | 96 | $metaImage = $seoMetadata->getMetaMedia()->getImage(); |
| 97 | - $response['_links']['meta_media_url'] = [ 'href' => $this->mediaManager->getMediaPublicUrl($metaImage)]; |
|
| 97 | + $response['_links']['meta_media_url'] = ['href' => $this->mediaManager->getMediaPublicUrl($metaImage)]; |
|
| 98 | 98 | } |
| 99 | 99 | if ($seoMetadata->getOgMedia()) { |
| 100 | 100 | $metaImage = $seoMetadata->getOgMedia()->getImage(); |
| 101 | - $response['_links']['og_media_url'] = [ 'href' => $this->mediaManager->getMediaPublicUrl($metaImage)]; |
|
| 101 | + $response['_links']['og_media_url'] = ['href' => $this->mediaManager->getMediaPublicUrl($metaImage)]; |
|
| 102 | 102 | } |
| 103 | 103 | if ($seoMetadata->getTwitterMedia()) { |
| 104 | 104 | $metaImage = $seoMetadata->getTwitterMedia()->getImage(); |
| 105 | - $response['_links']['twitter_media_url'] = [ 'href' => $this->mediaManager->getMediaPublicUrl($metaImage)]; |
|
| 105 | + $response['_links']['twitter_media_url'] = ['href' => $this->mediaManager->getMediaPublicUrl($metaImage)]; |
|
| 106 | 106 | } |
| 107 | 107 | |
| 108 | 108 | return new SingleResourceResponse($response, new ResponseContext(201)); |