@@ -12,12 +12,12 @@ |
||
| 12 | 12 | { |
| 13 | 13 | $c = new \ReflectionClass($class); |
| 14 | 14 | $s = $c->getShortName(); |
| 15 | - $name = $s . 'Pagination'; |
|
| 15 | + $name = $s.'Pagination'; |
|
| 16 | 16 | |
| 17 | 17 | $config = [ |
| 18 | 18 | 'name' => $name, |
| 19 | 19 | 'description' => 'Describe available pages', |
| 20 | - 'fields' => function () use ($class): array { |
|
| 20 | + 'fields' => function() use ($class): array { |
|
| 21 | 21 | return [ |
| 22 | 22 | 'offset' => [ |
| 23 | 23 | 'type' => self::int(), |
@@ -36,7 +36,7 @@ |
||
| 36 | 36 | private function getClass(string $requestedName): ?string |
| 37 | 37 | { |
| 38 | 38 | if (preg_match(self::PATTERN, $requestedName, $m)) { |
| 39 | - return 'Application\Model\\' . $m[1]; |
|
| 39 | + return 'Application\Model\\'.$m[1]; |
|
| 40 | 40 | } |
| 41 | 41 | |
| 42 | 42 | return null; |
@@ -14,7 +14,7 @@ |
||
| 14 | 14 | $config = [ |
| 15 | 15 | 'name' => 'GlobalPermissionsList', |
| 16 | 16 | 'description' => 'Describe permissions for current user', |
| 17 | - 'fields' => function (): array { |
|
| 17 | + 'fields' => function(): array { |
|
| 18 | 18 | $user = new User(); |
| 19 | 19 | $globalPermissions = $user->getGlobalPermissions(); |
| 20 | 20 | |
@@ -45,7 +45,7 @@ |
||
| 45 | 45 | $value = $value->getEntity(); |
| 46 | 46 | } |
| 47 | 47 | |
| 48 | - $setter = 'set' . ucfirst($name); |
|
| 48 | + $setter = 'set'.ucfirst($name); |
|
| 49 | 49 | $object->$setter($value); |
| 50 | 50 | } |
| 51 | 51 | } |
@@ -84,14 +84,14 @@ discard block |
||
| 84 | 84 | throw new \Exception("Cannot read dump file \"$dumpFile\""); |
| 85 | 85 | } |
| 86 | 86 | |
| 87 | - self::executeLocalCommand(PHP_BINARY . ' ./vendor/bin/doctrine orm:schema-tool:drop --ansi --full-database --force'); |
|
| 87 | + self::executeLocalCommand(PHP_BINARY.' ./vendor/bin/doctrine orm:schema-tool:drop --ansi --full-database --force'); |
|
| 88 | 88 | self::executeLocalCommand("gunzip -c \"$dumpFile\" | mysql --user=$username --password=$password --host=$host $database"); |
| 89 | - self::executeLocalCommand(PHP_BINARY . ' ./vendor/bin/doctrine-migrations --ansi migrations:migrate --no-interaction'); |
|
| 89 | + self::executeLocalCommand(PHP_BINARY.' ./vendor/bin/doctrine-migrations --ansi migrations:migrate --no-interaction'); |
|
| 90 | 90 | } |
| 91 | 91 | |
| 92 | 92 | public static function loadRemoteData($remote): void |
| 93 | 93 | { |
| 94 | - $dumpFile = "/tmp/$remote." . exec('whoami') . '.backup.gz'; |
|
| 94 | + $dumpFile = "/tmp/$remote.".exec('whoami').'.backup.gz'; |
|
| 95 | 95 | self::dumpDataRemotely($remote, $dumpFile); |
| 96 | 96 | self::copyFile($remote, $dumpFile); |
| 97 | 97 | self::loadData($dumpFile); |
@@ -112,7 +112,7 @@ discard block |
||
| 112 | 112 | $fullCommand = "$command 2>&1"; |
| 113 | 113 | passthru($fullCommand, $return_var); |
| 114 | 114 | if ($return_var) { |
| 115 | - throw new \Exception('FAILED executing: ' . $command); |
|
| 115 | + throw new \Exception('FAILED executing: '.$command); |
|
| 116 | 116 | } |
| 117 | 117 | } |
| 118 | 118 | } |
@@ -99,7 +99,7 @@ |
||
| 99 | 99 | return ''; |
| 100 | 100 | } |
| 101 | 101 | |
| 102 | - return $targetTableAlias . '.' . $field . ' IN (' . $subQuery . ')'; |
|
| 102 | + return $targetTableAlias.'.'.$field.' IN ('.$subQuery.')'; |
|
| 103 | 103 | } |
| 104 | 104 | |
| 105 | 105 | private function getSubQuery(string $class): ?string |
@@ -227,7 +227,7 @@ |
||
| 227 | 227 | } |
| 228 | 228 | |
| 229 | 229 | if (!$newFound || !$oldFound) { |
| 230 | - throw new Exception($currentRole . ' is not allowed to change role to ' . $role); |
|
| 230 | + throw new Exception($currentRole.' is not allowed to change role to '.$role); |
|
| 231 | 231 | } |
| 232 | 232 | |
| 233 | 233 | $this->role = $role; |
@@ -36,7 +36,7 @@ discard block |
||
| 36 | 36 | public function __construct(string $class, ?AbstractModel $instance = null) |
| 37 | 37 | { |
| 38 | 38 | if (!is_subclass_of($class, AbstractModel::class)) { |
| 39 | - throw new InvalidArgumentException('The class name must be an implementation of AbstractModel but given: ' . $class); |
|
| 39 | + throw new InvalidArgumentException('The class name must be an implementation of AbstractModel but given: '.$class); |
|
| 40 | 40 | } |
| 41 | 41 | |
| 42 | 42 | $class = ClassUtils::getRealClass($class); |
@@ -64,6 +64,6 @@ discard block |
||
| 64 | 64 | { |
| 65 | 65 | $instance = $this->getInstance(); |
| 66 | 66 | |
| 67 | - return Utility::getShortClassName($instance) . '#' . $instance->getId(); |
|
| 67 | + return Utility::getShortClassName($instance).'#'.$instance->getId(); |
|
| 68 | 68 | } |
| 69 | 69 | } |
@@ -91,7 +91,7 @@ |
||
| 91 | 91 | $resource = $resource->getName(); |
| 92 | 92 | } |
| 93 | 93 | |
| 94 | - $user = User::getCurrent() ? 'User "' . User::getCurrent()->getName() . '"' : 'Non-logged user'; |
|
| 94 | + $user = User::getCurrent() ? 'User "'.User::getCurrent()->getName().'"' : 'Non-logged user'; |
|
| 95 | 95 | $privilege = $privilege === null ? 'NULL' : $privilege; |
| 96 | 96 | |
| 97 | 97 | return "$user with role $role is not allowed on resource \"$resource\" with privilege \"$privilege\""; |