@@ -281,7 +281,7 @@ discard block |
||
| 281 | 281 | * |
| 282 | 282 | * @param string $newFilename The new file name. |
| 283 | 283 | * |
| 284 | - * @param null $backupTarget The backup file name. |
|
| 284 | + * @param string $backupTarget The backup file name. |
|
| 285 | 285 | * |
| 286 | 286 | * @return \UnexpectedValueException|\PharException|null |
| 287 | 287 | * |
@@ -329,7 +329,7 @@ discard block |
||
| 329 | 329 | * |
| 330 | 330 | * @param string $rollbackDir The directory where the rollback files are contained within. |
| 331 | 331 | * |
| 332 | - * @return bool|string |
|
| 332 | + * @return string|false |
|
| 333 | 333 | */ |
| 334 | 334 | protected function getLastBackupVersion($rollbackDir) |
| 335 | 335 | { |
@@ -157,7 +157,7 @@ discard block |
||
| 157 | 157 | return 0; |
| 158 | 158 | } |
| 159 | 159 | |
| 160 | - $tempFilename = $tmpDir . '/' . basename($localFilename, '.phar').'-temp.phar'; |
|
| 160 | + $tempFilename = $tmpDir . '/' . basename($localFilename, '.phar') . '-temp.phar'; |
|
| 161 | 161 | $backupFile = sprintf( |
| 162 | 162 | '%s/%s-%s%s', |
| 163 | 163 | $rollbackDir, |
@@ -183,7 +183,7 @@ discard block |
||
| 183 | 183 | } |
| 184 | 184 | |
| 185 | 185 | if ($err = $this->setLocalPhar($localFilename, $tempFilename, $backupFile)) { |
| 186 | - $inputOutput->writeError('<error>The file is corrupted ('.$err->getMessage().').</error>'); |
|
| 186 | + $inputOutput->writeError('<error>The file is corrupted (' . $err->getMessage() . ').</error>'); |
|
| 187 | 187 | $inputOutput->writeError('<error>Please re-run the self-update command to try again.</error>'); |
| 188 | 188 | |
| 189 | 189 | return 1; |
@@ -249,10 +249,10 @@ discard block |
||
| 249 | 249 | $old = $rollbackDir . '/' . $rollbackVersion . self::OLD_INSTALL_EXT; |
| 250 | 250 | |
| 251 | 251 | if (!is_file($old)) { |
| 252 | - throw new FilesystemException('Composer rollback failed: "'.$old.'" could not be found'); |
|
| 252 | + throw new FilesystemException('Composer rollback failed: "' . $old . '" could not be found'); |
|
| 253 | 253 | } |
| 254 | 254 | if (!is_readable($old)) { |
| 255 | - throw new FilesystemException('Composer rollback failed: "'.$old.'" could not be read'); |
|
| 255 | + throw new FilesystemException('Composer rollback failed: "' . $old . '" could not be read'); |
|
| 256 | 256 | } |
| 257 | 257 | |
| 258 | 258 | $oldFile = sprintf('%s/"%s"', $rollbackDir, $rollbackVersion, self::OLD_INSTALL_EXT); |
@@ -49,7 +49,7 @@ |
||
| 49 | 49 | * |
| 50 | 50 | * @param string $providerKey The provider key |
| 51 | 51 | * |
| 52 | - * @param string|object $user The user |
|
| 52 | + * @param \Symfony\Component\Security\Core\User\UserInterface $user The user |
|
| 53 | 53 | * |
| 54 | 54 | * @param RoleInterface[]|string[] $roles An array of roles |
| 55 | 55 | * |
@@ -230,7 +230,7 @@ |
||
| 230 | 230 | // Add non-standard scripts as own commands - keep this last to ensure we do not override internal commands. |
| 231 | 231 | if ($file->has('scripts')) { |
| 232 | 232 | foreach (array_keys($file->get('scripts')) as $script) { |
| 233 | - if (!defined('Composer\Script\ScriptEvents::'.str_replace('-', '_', strtoupper($script)))) { |
|
| 233 | + if (!defined('Composer\Script\ScriptEvents::' . str_replace('-', '_', strtoupper($script)))) { |
|
| 234 | 234 | if ($this->has($script)) { |
| 235 | 235 | $output->writeln( |
| 236 | 236 | sprintf( |
@@ -37,10 +37,10 @@ |
||
| 37 | 37 | use Symfony\Component\DependencyInjection\ContainerAwareInterface; |
| 38 | 38 | use Symfony\Component\HttpKernel\Bundle\Bundle; |
| 39 | 39 | use Symfony\Component\HttpKernel\KernelInterface; |
| 40 | +use Tenside\CoreBundle\Command\SelfUpdateCommand; |
|
| 40 | 41 | use Tenside\Core\Composer\ComposerJson; |
| 41 | 42 | use Tenside\Core\Tenside; |
| 42 | 43 | use Tenside\Core\Util\RuntimeHelper; |
| 43 | -use Tenside\CoreBundle\Command\SelfUpdateCommand; |
|
| 44 | 44 | |
| 45 | 45 | /** |
| 46 | 46 | * The console application that handles the commands. |
@@ -253,7 +253,7 @@ |
||
| 253 | 253 | $filters = []; |
| 254 | 254 | if ('contao' === $type) { |
| 255 | 255 | $filters[] = |
| 256 | - function ($package) { |
|
| 256 | + function($package) { |
|
| 257 | 257 | /** @var PackageInterface $package */ |
| 258 | 258 | return in_array($package->getType(), ['contao-module', 'contao-bundle', 'legacy-contao-module']); |
| 259 | 259 | }; |
@@ -28,12 +28,12 @@ |
||
| 28 | 28 | use Nelmio\ApiDocBundle\Annotation\ApiDoc; |
| 29 | 29 | use Symfony\Component\HttpFoundation\JsonResponse; |
| 30 | 30 | use Symfony\Component\HttpFoundation\Request; |
| 31 | -use Tenside\Core\Composer\Package\VersionedPackage; |
|
| 31 | +use Tenside\CoreBundle\Annotation\ApiDescription; |
|
| 32 | 32 | use Tenside\Core\Composer\PackageConverter; |
| 33 | +use Tenside\Core\Composer\Package\VersionedPackage; |
|
| 33 | 34 | use Tenside\Core\Composer\Search\CompositeSearch; |
| 34 | 35 | use Tenside\Core\Composer\Search\RepositorySearch; |
| 35 | 36 | use Tenside\Core\Util\JsonArray; |
| 36 | -use Tenside\CoreBundle\Annotation\ApiDescription; |
|
| 37 | 37 | |
| 38 | 38 | /** |
| 39 | 39 | * List and manipulate the installed packages. |
@@ -46,7 +46,7 @@ |
||
| 46 | 46 | |
| 47 | 47 | // Load our annotation if it get's mentioned, Doctrine does not try to autoload it via plain PHP. |
| 48 | 48 | AnnotationRegistry::registerLoader( |
| 49 | - function ($class) { |
|
| 49 | + function($class) { |
|
| 50 | 50 | if (0 === strcmp('Tenside\CoreBundle\Annotation\ApiDescription', $class)) { |
| 51 | 51 | class_exists('Tenside\CoreBundle\Annotation\ApiDescription'); |
| 52 | 52 | return true; |
@@ -77,7 +77,7 @@ discard block |
||
| 77 | 77 | |
| 78 | 78 | $uri = $this->buildUrl($url, $params); |
| 79 | 79 | |
| 80 | - return $uri.(false === (strpos($uri, '?')) ? '?' : '&').'_hash='.$this->computeHash($uri); |
|
| 80 | + return $uri . (false === (strpos($uri, '?')) ? '?' : '&') . '_hash=' . $this->computeHash($uri); |
|
| 81 | 81 | } |
| 82 | 82 | |
| 83 | 83 | /** |
@@ -143,16 +143,16 @@ discard block |
||
| 143 | 143 | ksort($params); |
| 144 | 144 | $url['query'] = http_build_query($params, '', '&'); |
| 145 | 145 | |
| 146 | - $scheme = isset($url['scheme']) ? $url['scheme'].'://' : ''; |
|
| 146 | + $scheme = isset($url['scheme']) ? $url['scheme'] . '://' : ''; |
|
| 147 | 147 | $host = isset($url['host']) ? $url['host'] : ''; |
| 148 | - $port = isset($url['port']) ? ':'.$url['port'] : ''; |
|
| 148 | + $port = isset($url['port']) ? ':' . $url['port'] : ''; |
|
| 149 | 149 | $user = isset($url['user']) ? $url['user'] : ''; |
| 150 | - $pass = isset($url['pass']) ? ':'.$url['pass'] : ''; |
|
| 150 | + $pass = isset($url['pass']) ? ':' . $url['pass'] : ''; |
|
| 151 | 151 | $pass = ($user || $pass) ? $pass . '@' : ''; |
| 152 | 152 | $path = isset($url['path']) ? $url['path'] : ''; |
| 153 | - $query = isset($url['query']) && $url['query'] ? '?'.$url['query'] : ''; |
|
| 154 | - $fragment = isset($url['fragment']) ? '#'.$url['fragment'] : ''; |
|
| 153 | + $query = isset($url['query']) && $url['query'] ? '?' . $url['query'] : ''; |
|
| 154 | + $fragment = isset($url['fragment']) ? '#' . $url['fragment'] : ''; |
|
| 155 | 155 | |
| 156 | - return $scheme.$user.$pass.$host.$port.$path.$query.$fragment; |
|
| 156 | + return $scheme . $user . $pass . $host . $port . $path . $query . $fragment; |
|
| 157 | 157 | } |
| 158 | 158 | } |
@@ -75,7 +75,7 @@ |
||
| 75 | 75 | public function getRoles() |
| 76 | 76 | { |
| 77 | 77 | $user = $this; |
| 78 | - $comparator = function ($level) use ($user) { |
|
| 78 | + $comparator = function($level) use ($user) { |
|
| 79 | 79 | return $user->hasAccessLevel($level); |
| 80 | 80 | }; |
| 81 | 81 | |
@@ -66,7 +66,7 @@ discard block |
||
| 66 | 66 | * |
| 67 | 67 | * @param UserInformationInterface $userData The user data to issue a token for. |
| 68 | 68 | * |
| 69 | - * @param int|null $lifetime The lifetime in seconds this token shall be valid. |
|
| 69 | + * @param integer $lifetime The lifetime in seconds this token shall be valid. |
|
| 70 | 70 | * Use null for no limit. |
| 71 | 71 | * |
| 72 | 72 | * @return string |
@@ -185,7 +185,7 @@ discard block |
||
| 185 | 185 | * |
| 186 | 186 | * @param string $jwt The jwt as string. |
| 187 | 187 | * |
| 188 | - * @return object |
|
| 188 | + * @return string |
|
| 189 | 189 | * |
| 190 | 190 | * @throws \UnexpectedValueException When the token does not match the local id. |
| 191 | 191 | */ |
@@ -25,8 +25,8 @@ |
||
| 25 | 25 | use Symfony\Bundle\FrameworkBundle\Controller\Controller; |
| 26 | 26 | use Symfony\Component\HttpFoundation\JsonResponse; |
| 27 | 27 | use Symfony\Component\HttpFoundation\Request; |
| 28 | -use Tenside\Core\Util\JsonArray; |
|
| 29 | 28 | use Tenside\CoreBundle\Annotation\ApiDescription; |
| 29 | +use Tenside\Core\Util\JsonArray; |
|
| 30 | 30 | |
| 31 | 31 | /** |
| 32 | 32 | * Validation of version constraints. |