Erstellt eine neue Methode

@return GMethod
1547
public function createMethod($name, $params = array(), $body = NULL, $modifiers = 256) {
    $method = $this->class->createMethod($name, $params, $body, $modifiers);
    $method->setClassBuilder($this);
    return $method;
  }
1195938
public function getMethods()
    {
        $aMethods = [];
        foreach($this->reflectionClass->getMethods(\ReflectionMethod::IS_PUBLIC) as $xMethod)
        {
            $sMethodName = $xMethod->getShortName();
            // Don't take magic __call, __construct, __destruct methods
            if(strlen($sMethodName) > 2 && substr($sMethodName, 0, 2) == '__')
            {
                continue;
            }
            // Don't take excluded methods
            if(in_array($sMethodName, $this->aProtectedMethods))
            {
                continue;
            }
            $aMethods[] = $sMethodName;
        }
        return $aMethods;
    }
826315
private function createImagineInstance()
    {
        $extension = mb_strtolower(\Craft::$app->getConfig()->getGeneral()->imageDriver);
        
        try {
            if ($extension === 'gd') {
                return new \Imagine\Gd\Imagine();
            }

            if ($extension === 'imagick') {
                return new \Imagine\Imagick\Imagine();
            }
        } catch (RuntimeException $e) {
            // just ignore for now
        }

        return null;
    }
1187949
private function makeRoot()
    {
        $this->lft = 1;
        $this->rgt = 2;
        $this->level = 1;
        $this->root = $this->getMaxRoot();

        return $this;
    }
269610
public function createSentinel()
    {
        $persistence = $this->createPersistence();
        $users       = $this->createUsers();
        $roles       = $this->createRoles();
        $activations = $this->createActivations();
        $dispatcher  = $this->getEventDispatcher();

        $sentinel = new Sentinel(
            $persistence,
            $users,
            $roles,
            $activations,
            $dispatcher
        );

        $throttle = $this->createThrottling();

        $ipAddress = $this->getIpAddress();

        $checkpoints = $this->createCheckpoints($activations, $throttle, $ipAddress);

        foreach ($checkpoints as $key => $checkpoint) {
            $sentinel->addCheckpoint($key, $checkpoint);
        }

        $reminders = $this->createReminders($users);

        $sentinel->setActivationRepository($activations);

        $sentinel->setReminderRepository($reminders);

        $sentinel->setThrottleRepository($throttle);

        return $sentinel;
    }
599157
public function writeMethod(GMethod $method, $baseIndent = 0, $eol = "\n") {
    $php = NULL;
    
    if ($method->hasDocBlock()) {
      $php = $this->writeDocBlock($method->getDocBlock(), $baseIndent, $eol);
    }
    
    // vor die modifier muss das indent
    $php .= str_repeat(' ', $baseIndent);
    
    $php .= $this->writeModifiers($method->getModifiers());
    $php .= $this->writeGFunction($method, $baseIndent, $eol);
    
    return $php;
  }
371456
public function createInstance()
    {
        switch ($this->method) {
            case 'addBigIntegerColumn':
            case 'addBinaryColumn':
            case 'addBooleanColumn':
            case 'addDateColumn':
            case 'addDateTimeColumn':
            case 'addDecimalColumn':
            case 'addFloatColumn':
            case 'addIntegerColumn':
            case 'addSmallIntegerColumn':
            case 'addStringColumn':
            case 'addTextColumn':
            case 'addTimeColumn':
                $namespace = 'Rentgen\\Database\\Column\\';
                $class = $namespace . ltrim($this->method, 'add');
                $options = isset($this->params[1]) ? $this->params[1] : array();

                if ('addStringColumn' === $this->method && !isset($options['limit'])) {
                    $options['limit'] = 255;
                }
                $column = new $class($this->params[0], $options);
                break;
            case 'addCustomColumn':
                $options = isset($this->params[2]) ? $this->params[2] : [];
                $column = new CustomColumn($this->params[0], $this->params[1], $options);
                break;
            default:
                throw new \Exception(sprintf("Unsupported method " . $this->method));
        }

        if (isset($options['comment'])) {
            $column->setDescription($options['comment']);
        }

        return $column;
    }
1065841
public function globalRollback()
    {
        $res = null;

        if ($this->isInDbTransaction()) {
            $res = pg_query($this->pgConn, 'rollback');
            if ($res === false) {
                throw $this->createException();
            }
        }
        $this->dbTransLevel = 0;
        $this->transLevel = 0;
        $this->commitCallbacks = [];

        return $this;
    }
373848
public function instance()
    {
        $settings = $this->getValidatedSettings();

        $objectManager = $this->createObjectManager($settings);
        $logger = isset($settings['logger']) ? isset($settings['logger']) : null;

        $this->initializeRegistry($objectManager, $logger);

        return new DataMapper($objectManager);
    }
990453
function() {
				var mMethods = {};
				var oMetadata = this.getMetadata();
				var aPublicMethods = oMetadata.getAllPublicMethods();

				aPublicMethods.forEach(function(sMethod) {
					var fnFunction = this[sMethod];
					if (typeof fnFunction === 'function') {
						mMethods[sMethod] = function() {
							var tmp = fnFunction.apply(this, arguments);
							return (tmp instanceof ControllerExtension) ? tmp.getInterface() : tmp;
						}.bind(this);
					}
					//}
				}.bind(this));
				this.getInterface = function() {
					return mMethods;
				};
				return mMethods;
			}
676030
public static function newInstance()
    {
        $config = self::create();

        $config->username = 'null';
        $config->password = 'null';
        $config->credentials = ['null', 'null'];
        $config->bindtoInterface = 'null';
        $config->timeout = 5;

        return $config;
    }
1335560
private function createSmf()
    {
        $definition = new Definition(
            Utility::getLibraryClass('Persister\MongoDb\StorageMetadataFactory'),
            [new Reference(Utility::getAliasedName('util.entity'))]
        );
        $definition->setPublic(false);
        return $definition;
    }
1115077
public static function factory()
    {
        $self = new static();
        $self->downloader = new Plugins\Xml\Downloader();
        $self->writer     = new Plugins\Xml\Writer();
        
        $self->outputter  = new Plugins\NullObject();

        return $self;
    }
468710
public function getOperation()
    {
        $direction = $this->getDirection();
        if ($direction === null) {
            return new DummyOperation();
        }
        if ($this->root !== null) {
            /** @var Grid $root */
            $root = $this->root;
            $fieldName = $root->getColumn($this->columnId)->getDataFieldName();
        } else {
            $fieldName = $this->columnId;
        }
        return new SortOperation($fieldName, $direction);
    }
645615
public function getForkMag(): Mag {
		IllegalStateException::assertTrue($this->translationForm !== null);
		
		return new ForkMag($this->label, $this->translationForm, $this->n2nLocaleDefs, $this->min,
				$this->getMarkClassKey());
	}
600530
public function sync_original() {
		$this->original = $this->attributes;

		if ( $this->attributes[ self::OBJECT_KEY ] ) {
			$this->original[ self::OBJECT_KEY ] = clone $this->attributes[ self::OBJECT_KEY ];
		}

		foreach ( $this->original[ self::TABLE_KEY ] as $key => $item ) {
			if ( is_object( $item ) ) {
				$this->original[ $key ] = clone $item;
			}
		}

		return $this;
	}
159856
public function createAbstractMethodStubs() {
    if ($this->isAbstract()) return $this;
    
    if (($parent = $this->getParentClass()) !== NULL) {
      $parent->elevateClass();
      foreach ($parent->getAllMethods() as $method) {
        if ($method->isAbstract()) {
          $this->createMethodStub($method);
        }
      }
    }
    
    foreach ($this->getAllInterfaces() as $interface) {
      $interface->elevateClass();
      foreach ($interface->getAllMethods() as $method) {
        $this->createMethodStub($method);
      }
    }
    return $this;
  }