@@ -16,6 +16,6 @@ |
||
| 16 | 16 | |
| 17 | 17 | $type = $field['autoincrement'] ? 'smallserial' : 'smallint'; |
| 18 | 18 | |
| 19 | - return $type . $commonIntegerTypeDeclaration; |
|
| 19 | + return $type.$commonIntegerTypeDeclaration; |
|
| 20 | 20 | } |
| 21 | 21 | } |
@@ -19,10 +19,10 @@ |
||
| 19 | 19 | $pdo = DB::connection()->getPdo(); |
| 20 | 20 | |
| 21 | 21 | // trim the values |
| 22 | - $fieldDeclaration['allowed'] = array_map(function ($value) use ($pdo) { |
|
| 22 | + $fieldDeclaration['allowed'] = array_map(function($value) use ($pdo) { |
|
| 23 | 23 | return $pdo->quote(trim($value)); |
| 24 | 24 | }, $allowed); |
| 25 | 25 | |
| 26 | - return 'set(' . implode(', ', $field['allowed']) . ')'; |
|
| 26 | + return 'set('.implode(', ', $field['allowed']).')'; |
|
| 27 | 27 | } |
| 28 | 28 | } |
@@ -19,10 +19,10 @@ |
||
| 19 | 19 | $pdo = DB::connection()->getPdo(); |
| 20 | 20 | |
| 21 | 21 | // trim the values |
| 22 | - $allowed = array_map(function ($value) use ($pdo) { |
|
| 22 | + $allowed = array_map(function($value) use ($pdo) { |
|
| 23 | 23 | return $pdo->quote(trim($value)); |
| 24 | 24 | }, $allowed); |
| 25 | 25 | |
| 26 | - return 'enum(' . implode(', ', $allowed) . ')'; |
|
| 26 | + return 'enum('.implode(', ', $allowed).')'; |
|
| 27 | 27 | } |
| 28 | 28 | } |
@@ -40,13 +40,13 @@ |
||
| 40 | 40 | |
| 41 | 41 | protected static function getCustomTypes($platformName) |
| 42 | 42 | { |
| 43 | - $customPlatformDir = __DIR__ . DIRECTORY_SEPARATOR . $platformName . DIRECTORY_SEPARATOR; |
|
| 43 | + $customPlatformDir = __DIR__.DIRECTORY_SEPARATOR.$platformName.DIRECTORY_SEPARATOR; |
|
| 44 | 44 | |
| 45 | 45 | $customTypes = []; |
| 46 | 46 | |
| 47 | - foreach (glob($customPlatformDir . '*.php') as $file) { |
|
| 47 | + foreach (glob($customPlatformDir.'*.php') as $file) { |
|
| 48 | 48 | $className = basename($file, ".php"); |
| 49 | - $customTypes[] = __NAMESPACE__ . '\\' . $platformName . '\\' . $className; |
|
| 49 | + $customTypes[] = __NAMESPACE__.'\\'.$platformName.'\\'.$className; |
|
| 50 | 50 | } |
| 51 | 51 | |
| 52 | 52 | return $customTypes; |
@@ -130,7 +130,7 @@ |
||
| 130 | 130 | $transform = []; |
| 131 | 131 | |
| 132 | 132 | foreach ($indexOrColumns as $column) { |
| 133 | - $transform[$column] = $column . '_1'; |
|
| 133 | + $transform[$column] = $column.'_1'; |
|
| 134 | 134 | } |
| 135 | 135 | |
| 136 | 136 | $indexOrColumns = implode('_', $transform); |
@@ -144,7 +144,7 @@ |
||
| 144 | 144 | break; |
| 145 | 145 | } |
| 146 | 146 | |
| 147 | - $options['name'] = strtolower($collection->getCollectionName() . "_" . $column . "_" . $type); |
|
| 147 | + $options['name'] = strtolower($collection->getCollectionName()."_".$column."_".$type); |
|
| 148 | 148 | |
| 149 | 149 | $options['ns'] = $collection->getNamespace(); |
| 150 | 150 | |
@@ -46,7 +46,7 @@ discard block |
||
| 46 | 46 | public static function javascript(string $code, $scope = []) |
| 47 | 47 | { |
| 48 | 48 | if (!is_array($scope) || !is_array()) { |
| 49 | - throw new \Exception($scope . " should be array or object"); |
|
| 49 | + throw new \Exception($scope." should be array or object"); |
|
| 50 | 50 | |
| 51 | 51 | } |
| 52 | 52 | |
@@ -81,7 +81,7 @@ discard block |
||
| 81 | 81 | public static function dateTime($milliseconds = null) |
| 82 | 82 | { |
| 83 | 83 | if (!is_int($milliseconds) || !is_float($milliseconds) || !is_string($milliseconds) || !$milliseconds instanceof \DateTimeInterface) { |
| 84 | - throw new \Exception($milliseconds . " integer or float or string or instance of DateTimeInterface"); |
|
| 84 | + throw new \Exception($milliseconds." integer or float or string or instance of DateTimeInterface"); |
|
| 85 | 85 | |
| 86 | 86 | } |
| 87 | 87 | return new UTCDateTime($milliseconds); |
@@ -47,7 +47,7 @@ discard block |
||
| 47 | 47 | |
| 48 | 48 | public function getNamespace($databaseName, $collectionName) |
| 49 | 49 | { |
| 50 | - return $databaseName . '.' . $collectionName; |
|
| 50 | + return $databaseName.'.'.$collectionName; |
|
| 51 | 51 | } |
| 52 | 52 | |
| 53 | 53 | public function getCollections() |
@@ -96,7 +96,7 @@ discard block |
||
| 96 | 96 | $oldName = $collection['oldName']; |
| 97 | 97 | $collectionName = $oldName; |
| 98 | 98 | $connection = config('database.default'); |
| 99 | - $database = config('database.connections.' . $connection . ".database"); |
|
| 99 | + $database = config('database.connections.'.$connection.".database"); |
|
| 100 | 100 | $fromNs = $this->getNamespace($database, $oldName); |
| 101 | 101 | $toNs = $this->getNamespace($database, $newName); |
| 102 | 102 | |
@@ -113,10 +113,10 @@ discard block |
||
| 113 | 113 | // DoctrineType::addType('varchar', 'App\CodexShaper\Database\Types\Common\VarCharType'); |
| 114 | 114 | // SchemaManager::getInstance()->getDatabasePlatform()->registerDoctrineTypeMapping('db_varchar', 'varchar'); |
| 115 | 115 | |
| 116 | - $conn = 'database.connections.' . config('database.default'); |
|
| 116 | + $conn = 'database.connections.'.config('database.default'); |
|
| 117 | 117 | |
| 118 | - $table['options']['collate'] = config($conn . '.collation', 'utf8mb4_unicode_ci'); |
|
| 119 | - $table['options']['charset'] = config($conn . '.charset', 'utf8mb4'); |
|
| 118 | + $table['options']['collate'] = config($conn.'.collation', 'utf8mb4_unicode_ci'); |
|
| 119 | + $table['options']['charset'] = config($conn.'.charset', 'utf8mb4'); |
|
| 120 | 120 | |
| 121 | 121 | $tableName = $table['name']; |
| 122 | 122 | $columns = $table['columns']; |
@@ -212,7 +212,7 @@ discard block |
||
| 212 | 212 | $items = static::all(); |
| 213 | 213 | $collection = $items instanceof Collection ? $items : Collection::make($items); |
| 214 | 214 | if (!empty($query)) { |
| 215 | - $collection = $collection->filter(function ($value, $key) use ($query) { |
|
| 215 | + $collection = $collection->filter(function($value, $key) use ($query) { |
|
| 216 | 216 | return false !== stristr($value, $query); |
| 217 | 217 | }); |
| 218 | 218 | } |