Make a prototype binding closure method to store in the cache.

@param  string $id
@param  mixed $blueprint
@param  array $dependencies
@return Closure
167670
private function preparePrototypeBindingClosure($id, $blueprint, $dependencies): Closure
    {
        if ($blueprint instanceof ReflectionClass) {
            return $this->cache[$id] = function () use ($blueprint, $dependencies) {
                foreach ($dependencies as $key => $dependency) {
                    if ($dependency instanceof Closure) {
                        $dependencies[$key] = $dependency();
                    }
                }

                return $blueprint->newInstanceArgs($dependencies);
            };
        }
        if ($blueprint instanceof Closure) {
            return $this->cache[$id] = $blueprint;
        }

        return $this->cache[$id] = function () use ($blueprint) {
            return new $blueprint;
        };
    }
716486
public function create($table, Closure $callback = null)
    {
        $blueprint = $this->createBlueprint($table);
        $blueprint->create();
        if ($callback) {
            $callback($blueprint);
        }
    }
1237755
public function bind( $id, $value = null, $singleton = false ) {
		if ( is_string( $id ) && $this->is_singleton( $id ) ) {
			throw new Exception( sprintf( 'Identifier `%s` is a singleton and cannot be rebind', $id ) );
		}

		if ( is_string( $value ) && class_exists( $value ) ) {
			$closure = new ReflectionClass( $value );
			$value   = $this->call_closure( $closure );
			$closure = function () use ( $value ) {
				return $value;
			};

			$this->bindings[$id] = compact( 'closure', 'singleton' );
			$this->keys[$id]     = true;

			return $value;
		}

		if ( is_object( $id ) && get_class( $id ) !== false ) {
			$value              = $id;
			$id                 = $this->get_class_prefix( get_class( $id ), false );
			$this->classes[$id] = true;
		}

		if ( $value instanceof Closure ) {
			$closure = $value;
		} else {
			$closure = $this->get_closure( $value, $singleton );
		}

		$this->bindings[$id] = compact( 'closure', 'singleton' );
		$this->keys[$id]     = true;

		return $value;
	}
1343943
public function compileCreate( Blueprint $blueprint, Fluent $command, Connection $connection )
	{
		$columns = implode( ', ', $this->getColumns( $blueprint ) );

		$sql = $blueprint->temporary ? 'create temporary' : 'create';

		$sql .= ' table ' . $this->wrapTable( $blueprint ) . " ($columns)";

		// Once we have the primary SQL, we can add the encoding option to the SQL for
		// the table.  Then, we can check if a storage engine has been supplied for
		// the table. If so, we will add the engine declaration to the SQL query.
		$sql = $this->compileCreateEncoding( $sql, $connection, $blueprint );

		if ( isset( $blueprint->engine ) )
		{
			$sql .= ' engine = ' . $blueprint->engine;
		}
		elseif ( !is_null( $engine = $connection->getConfig( 'engine' ) ) )
		{
			$sql .= ' engine = ' . $engine;
		}

		return $sql;
	}
482781
public function compileForeign(Blueprint $blueprint, Fluent $command)
    {
        $sql = parent::compileForeign($blueprint, $command);

        if (! is_null($command->deferrable)) {
            $sql .= $command->deferrable ? ' deferrable' : ' not deferrable';
        }

        if ($command->deferrable && ! is_null($command->initiallyImmediate)) {
            $sql .= $command->initiallyImmediate ? ' initially immediate' : ' initially deferred';
        }

        if (! is_null($command->notValid)) {
            $sql .= ' not valid';
        }

        return $sql;
    }
1080082
public function compileCreate(Blueprint $blueprint, Fluent $command, Connection $connection) {
       
        // $columns = implode(', ', $this->getColumns($blueprint));
        //$sql = 'create class '.$this->wrapTable($blueprint)." ($columns)";
        return  $sql = 'create class '.$this->wrapTable($blueprint)." extends V";
    }
680442
public function merge(Blueprint $mergeBlueprint): Blueprint
    {
        return new Blueprint(
            $this->className,
            $this->mergeParams($mergeBlueprint),
            $this->mergeSetters($mergeBlueprint),
            $this->mergeMutations($mergeBlueprint)
        );
    }
61682
public function compileCreate(Blueprint $blueprint, Fluent $command)
    {
        return sprintf('%s table %s (%s)',
            $blueprint->temporary ? 'create temporary' : 'create',
            $this->wrapTable($blueprint),
            implode(', ', $this->getColumns($blueprint))
        );
    }
1174503
public function compileCreate(Blueprint $blueprint, Fluent $command, Connection $connection)
    {
        $sql = $this->compileCreateTable(
            $blueprint, $command, $connection
        );

        // Once we have the primary SQL, we can add the encoding option to the SQL for
        // the table.  Then, we can check if a storage engine has been supplied for
        // the table. If so, we will add the engine declaration to the SQL query.
        $sql = $this->compileCreateEncoding(
            $sql, $connection, $blueprint
        );

        // Finally, we will append the engine configuration onto this SQL statement as
        // the final thing we do before returning this finished SQL. Once this gets
        // added the query will be ready to execute against the real connections.
        return $this->compileCreateEngine(
            $sql, $connection, $blueprint
        );
    }
600298
public function setDependencyId($v)
    {
        if ($v !== null) {
            $v = (int) $v;
        }

        if ($this->dependency_id !== $v) {
            $this->dependency_id = $v;
            $this->modifiedColumns[SkillDependencyTableMap::COL_DEPENDENCY_ID] = true;
        }

        if ($this->aSkillRelatedByDependencyId !== null && $this->aSkillRelatedByDependencyId->getId() !== $v) {
            $this->aSkillRelatedByDependencyId = null;
        }

        return $this;
    }
1184139
public static function buildDependencies(DependencyBuilder $dependencies)
    {
        $classes = [
            // guarantee DoctrineBundle
            DoctrineBundle::class,
            // guarantee ORM
            Column::class,
        ];

        foreach ($classes as $class) {
            $dependencies->addClassDependency(
                $class,
                'orm'
            );
        }
    }
262029
protected function createBlueprint($table, Closure $callback = null)
    {
        $blueprint = new OracleBlueprint($table, $callback);
        $blueprint->setTablePrefix($this->connection->getTablePrefix());

        return $blueprint;
    }
966884
public function delete(BlueprintInterface $blueprint)
    {
        Notification::where($this->getAttributes($blueprint))->update(['is_deleted' => true]);
    }
525531
public function compileGin(Blueprint $blueprint, Fluent $command)
    {
        $columns = $this->columnize($command->columns);

        return sprintf('CREATE INDEX %s ON %s USING GIN(%s)', $command->index, $this->wrapTable($blueprint), $columns);
    }
280380
protected static function getTableWithColumnChanges(Blueprint $blueprint, Table $table)
    {
        $table = clone $table;

        foreach ($blueprint->getChangedColumns() as $fluent) {
            $column = static::getDoctrineColumn($table, $fluent);

            // Here we will spin through each fluent column definition and map it to the proper
            // Doctrine column definitions - which is necessary because Laravel and Doctrine
            // use some different terminology for various column attributes on the tables.
            foreach ($fluent->getAttributes() as $key => $value) {
                if (! is_null($option = static::mapFluentOptionToDoctrine($key))) {
                    if (method_exists($column, $method = 'set'.ucfirst($option))) {
                        $column->{$method}(static::mapFluentValueToDoctrine($option, $value));
                    }
                }
            }
        }

        return $table;
    }
1300136
public function compilePrimary(Blueprint $blueprint, Fluent $command)
    {
        $command->name(null);

        return $this->compileKey($blueprint, $command, 'primary key');
    }
184850
public function create($blueprint)
    {
        $name = $blueprint->name;
        $type = $blueprint->type;
        if (!isset($this->count[$name])) {
            $this->count[$name] = 0;
        }

        $count = ++$this->count[$name];

        $values = $blueprint->values();

        $strings = array_map(function ($value) use ($count) {
            return str_replace('#{sn}', str_pad($count, 4, '0', STR_PAD_LEFT), $value);
        }, $blueprint->strings());

        $relationships = $blueprint->relationships();

        foreach ($relationships as $key => $relationship) {
            $relationships[$key] = $relationship->create($blueprint->persisted);
        }

        $values = array_merge($values, $strings, $relationships);

        $dependencies = array_map(function ($value) use ($values) {
            return $value->meet($values);
        }, $blueprint->dependencies());

        $values = array_merge($values, $dependencies);

        //$object = $this->toObject($name, $values);
        $object = $this->to_object($name, $values); // @deprecated Backwards compatibility

        if (false == $blueprint->persisted) {
            return $object;
        }

        \Phactory::triggers()->beforeSave($name, $type, $object);

        //$object = $this->saveObject($name, $object);
        $object = $this->save_object($name, $object); // @deprecated Backwards compatibility

        \Phactory::triggers()->afterSave($name, $type, $object);

        return $object;
    }