src/PackageTrait.php
public function register(string $vendor, ...$args)
    {
        //determine class
        if (method_exists($this, 'resolve')) {
            $this->packages[$vendor] = $this->resolve(Package::class, $vendor);
        // @codeCoverageIgnoreStart
        } else {
            $this->packages[$vendor] = new Package($vendor);
        }
        // @codeCoverageIgnoreEnd

        //if the type is not pseudo (vendor or root)
        if ($this->packages[$vendor]->getPackageType() !== Package::TYPE_PSEUDO) {
            //let's try to call the bootstrap
            $cradle = $this;

            //we should check for events
            $file = $this->packages[$vendor]->getPackagePath() . '/' . $this->bootstrapFile;

            // @codeCoverageIgnoreStart
            if (file_exists($file)) {
                //so you can access cradle
                //within the included file
                include_once($file);
            } else if (file_exists($file . '.php')) {
                //so the IDE can have color
                include_once($file . '.php');
            }
            // @codeCoverageIgnoreEnd
        }

        return $this;
    }
public function register(string $vendor, ...$args)
    {
        //determine class
        if (method_exists($this, 'resolve')) {
            $this->packages[$vendor] = $this->resolve(Package::class, $vendor);
        // @codeCoverageIgnoreStart
        } else {
            $this->packages[$vendor] = new Package($vendor);
        }
        // @codeCoverageIgnoreEnd

        //if the type is not pseudo (vendor or root)
        if ($this->packages[$vendor]->getPackageType() !== Package::TYPE_PSEUDO) {
            //let's try to call the bootstrap
            $cradle = $this;

            //we should check for events
            $file = $this->packages[$vendor]->getPackagePath() . '/' . $this->bootstrapFile;

            // @codeCoverageIgnoreStart
            if (file_exists($file)) {
                //so you can access cradle
                //within the included file
                include_once($file);
            } else if (file_exists($file . '.php')) {
                //so the IDE can have color
                include_once($file . '.php');
            }
            // @codeCoverageIgnoreEnd
        }

        return $this;
    }
public function register ( string $ vendor , ... $ args ) { //determine class if ( method_exists ( $ this , 'resolve' ) ) { $ this -> packages [ $ vendor ] = $ this -> resolve ( Package :: class , $ vendor ) ; // @codeCoverageIgnoreStart } else { $ this -> packages [ $ vendor ] = new Package ( $ vendor ) ; } // @codeCoverageIgnoreEnd //if the type is not pseudo (vendor or root) if ( $ this -> packages [ $ vendor ] -> getPackageType ( ) !== Package :: TYPE_PSEUDO ) { //let's try to call the bootstrap $ cradle = $ this ; //we should check for events $ file = $ this -> packages [ $ vendor ] -> getPackagePath ( ) . '/' . $ this -> bootstrapFile ; // @codeCoverageIgnoreStart if ( file_exists ( $ file ) ) { //so you can access cradle //within the included file include_once ( $ file ) ; } else if ( file_exists ( $ file . '.php' ) ) { //so the IDE can have color include_once ( $ file . '.php' ) ; } // @codeCoverageIgnoreEnd } return $ this ; }
Registers and initializes a plugin

@param *string $vendor  The vendor/package name
@param mixed   ...$args

@return PackageTrait
Registers and initializes a plugin