@@ -21,6 +21,9 @@ discard block |
||
| 21 | 21 | private $skipOnErrors = false; |
| 22 | 22 | private $yentu; |
| 23 | 23 | |
| 24 | + /** |
|
| 25 | + * @param string $itemType |
|
| 26 | + */ |
|
| 24 | 27 | public function skip($itemType) { |
| 25 | 28 | $this->skippedItemTypes[] = $itemType; |
| 26 | 29 | } |
@@ -36,6 +39,9 @@ discard block |
||
| 36 | 39 | $this->dryRun = $dryRun; |
| 37 | 40 | } |
| 38 | 41 | |
| 42 | + /** |
|
| 43 | + * @param string $itemType |
|
| 44 | + */ |
|
| 39 | 45 | public function allowOnly($itemType) { |
| 40 | 46 | $this->allowedItemTypes[] = $itemType; |
| 41 | 47 | } |
@@ -47,6 +53,9 @@ discard block |
||
| 47 | 53 | $this->yentu = $yentu; |
| 48 | 54 | } |
| 49 | 55 | |
| 56 | + /** |
|
| 57 | + * @param Yentu $yentu |
|
| 58 | + */ |
|
| 50 | 59 | public static function wrap($item, $yentu) { |
| 51 | 60 | return new ChangeLogger($item, $yentu); |
| 52 | 61 | } |
@@ -59,6 +68,9 @@ discard block |
||
| 59 | 68 | $this->migration = $migration; |
| 60 | 69 | } |
| 61 | 70 | |
| 71 | + /** |
|
| 72 | + * @param string[] $matches |
|
| 73 | + */ |
|
| 62 | 74 | private function performOperation($method, $matches, $arguments) { |
| 63 | 75 | try { |
| 64 | 76 | $return = $this->driver->$method($arguments[0]); |
@@ -74,6 +74,9 @@ discard block |
||
| 74 | 74 | return $this->newVersion; |
| 75 | 75 | } |
| 76 | 76 | |
| 77 | + /** |
|
| 78 | + * @return string |
|
| 79 | + */ |
|
| 77 | 80 | private function generateSchemaCode($description, $ref = false, $prefix = '') { |
| 78 | 81 | $refprefix = $ref === true ? 'ref' : '->'; |
| 79 | 82 | if ($description["{$prefix}schema"] == false) { |
@@ -176,6 +179,9 @@ discard block |
||
| 176 | 179 | } |
| 177 | 180 | } |
| 178 | 181 | |
| 182 | + /** |
|
| 183 | + * @param string $type |
|
| 184 | + */ |
|
| 179 | 185 | protected function importConstraints($type, $constraints) { |
| 180 | 186 | foreach ($constraints as $name => $constraint) { |
| 181 | 187 | $constraint = implode("','", $constraint['columns']); |
@@ -2,7 +2,6 @@ |
||
| 2 | 2 | |
| 3 | 3 | namespace yentu\commands; |
| 4 | 4 | |
| 5 | -use yentu\DatabaseManipulator; |
|
| 6 | 5 | use yentu\CodeWriter; |
| 7 | 6 | use yentu\Yentu; |
| 8 | 7 | |
@@ -26,11 +26,10 @@ |
||
| 26 | 26 | |
| 27 | 27 | namespace yentu\commands; |
| 28 | 28 | |
| 29 | +use clearice\ClearIce; |
|
| 29 | 30 | use clearice\CommandInterface; |
| 30 | 31 | use yentu\Yentu; |
| 31 | -use clearice\ClearIce; |
|
| 32 | 32 | use yentu\exceptions\CommandException; |
| 33 | -use ntentan\config\Config; |
|
| 34 | 33 | |
| 35 | 34 | /** |
| 36 | 35 | * The init command class. This command intiates a project for yentu migration |
@@ -53,6 +53,9 @@ |
||
| 53 | 53 | $this->yentu = $yentu; |
| 54 | 54 | } |
| 55 | 55 | |
| 56 | + /** |
|
| 57 | + * @param string $filter |
|
| 58 | + */ |
|
| 56 | 59 | public function setupOptions($options, &$filter) { |
| 57 | 60 | if (isset($options['no-foreign-keys'])) { |
| 58 | 61 | ClearIce::output("Ignoring all foreign key constraints ...\n"); |
@@ -26,12 +26,11 @@ |
||
| 26 | 26 | |
| 27 | 27 | namespace yentu\commands; |
| 28 | 28 | |
| 29 | -use yentu\database\DatabaseItem; |
|
| 30 | -use yentu\DatabaseManipulator; |
|
| 29 | +use clearice\ClearIce; |
|
| 31 | 30 | use yentu\ChangeLogger; |
| 32 | 31 | use yentu\Yentu; |
| 32 | +use yentu\database\DatabaseItem; |
|
| 33 | 33 | use yentu\database\ForeignKey; |
| 34 | -use clearice\ClearIce; |
|
| 35 | 34 | |
| 36 | 35 | /** |
| 37 | 36 | * The migrate command for the yentu database migration system. This class is |
@@ -1,11 +1,10 @@ |
||
| 1 | 1 | <?php |
| 2 | 2 | namespace yentu\commands; |
| 3 | 3 | |
| 4 | -use yentu\ChangeReverser; |
|
| 5 | -use yentu\DatabaseManipulator; |
|
| 6 | -use yentu\database\DatabaseItem; |
|
| 7 | 4 | use clearice\ClearIce; |
| 5 | +use yentu\ChangeReverser; |
|
| 8 | 6 | use yentu\Yentu; |
| 7 | +use yentu\database\DatabaseItem; |
|
| 9 | 8 | |
| 10 | 9 | class Rollback implements \clearice\CommandInterface |
| 11 | 10 | { |
@@ -2,8 +2,8 @@ |
||
| 2 | 2 | |
| 3 | 3 | namespace yentu\commands; |
| 4 | 4 | |
| 5 | -use yentu\Yentu; |
|
| 6 | 5 | use clearice\ClearIce; |
| 6 | +use yentu\Yentu; |
|
| 7 | 7 | |
| 8 | 8 | /** |
| 9 | 9 | * |
@@ -30,6 +30,9 @@ |
||
| 30 | 30 | { |
| 31 | 31 | private $defaultSchema; |
| 32 | 32 | |
| 33 | + /** |
|
| 34 | + * @param boolean $defaultSchema |
|
| 35 | + */ |
|
| 33 | 36 | public function __construct($defaultSchema) |
| 34 | 37 | { |
| 35 | 38 | $this->defaultSchema = new Schema($defaultSchema); |
@@ -29,6 +29,10 @@ |
||
| 29 | 29 | 'query' => 'Query' |
| 30 | 30 | ); |
| 31 | 31 | |
| 32 | + /** |
|
| 33 | + * @param string $property |
|
| 34 | + * @param string $attribute |
|
| 35 | + */ |
|
| 32 | 36 | protected function addChange($property, $attribute, $value, $callback = null) |
| 33 | 37 | { |
| 34 | 38 | if(!$this->isNew()){ |
@@ -21,6 +21,9 @@ |
||
| 21 | 21 | return $this->isReference; |
| 22 | 22 | } |
| 23 | 23 | |
| 24 | + /** |
|
| 25 | + * @param boolean $isReference |
|
| 26 | + */ |
|
| 24 | 27 | public function setIsReference($isReference) |
| 25 | 28 | { |
| 26 | 29 | $this->isReference = $isReference; |