src/Metabox/Factory.php
public function make(string $id, $screen = 'post'): MetaboxInterface
    {
        $metabox = (new Metabox($id, $this->action, $this->filter, new FieldsRepository()))
            ->setContainer($this->container)
            ->setTitle($this->setDefaultTitle($id))
            ->setScreen($screen)
            ->setContext('normal')
            ->setPriority('default')
            ->setArguments([
                '__block_editor_compatible_meta_box' => true,
                '__back_compat_meta_box' => false
            ])
            ->setResource($this->resource)
            ->setLocale($this->container->getLocale());

        $this->setMetaboxTranslations($metabox);

        $abstract = sprintf('themosis.metabox.%s', $id);

        if (! $this->container->bound($abstract)) {
            $this->container->instance($abstract, $metabox);
        } else {
            throw new MetaboxException('The metabox with an ID of ['.$id.'] is already bound.');
        }

        return $metabox;
    }
public function make(string $id, $screen = 'post'): MetaboxInterface
    {
        $metabox = (new Metabox($id, $this->action, $this->filter, new FieldsRepository()))
            ->setContainer($this->container)
            ->setTitle($this->setDefaultTitle($id))
            ->setScreen($screen)
            ->setContext('normal')
            ->setPriority('default')
            ->setArguments([
                '__block_editor_compatible_meta_box' => true,
                '__back_compat_meta_box' => false
            ])
            ->setResource($this->resource)
            ->setLocale($this->container->getLocale());

        $this->setMetaboxTranslations($metabox);

        $abstract = sprintf('themosis.metabox.%s', $id);

        if (! $this->container->bound($abstract)) {
            $this->container->instance($abstract, $metabox);
        } else {
            throw new MetaboxException('The metabox with an ID of ['.$id.'] is already bound.');
        }

        return $metabox;
    }
public function make ( string $ id , $ screen = 'post' ) : MetaboxInterface { $ metabox = ( new Metabox ( $ id , $ this -> action , $ this -> filter , new FieldsRepository ( ) ) ) -> setContainer ( $ this -> container ) -> setTitle ( $ this -> setDefaultTitle ( $ id ) ) -> setScreen ( $ screen ) -> setContext ( 'normal' ) -> setPriority ( 'default' ) -> setArguments ( [ '__block_editor_compatible_meta_box' => true , '__back_compat_meta_box' => false ] ) -> setResource ( $ this -> resource ) -> setLocale ( $ this -> container -> getLocale ( ) ) ; $ this -> setMetaboxTranslations ( $ metabox ) ; $ abstract = sprintf ( 'themosis.metabox.%s' , $ id ) ; if ( ! $ this -> container -> bound ( $ abstract ) ) { $ this -> container -> instance ( $ abstract , $ metabox ) ; } else { throw new MetaboxException ( 'The metabox with an ID of [' . $ id . '] is already bound.' ) ; } return $ metabox ; }
Create a new metabox instance.

@param string                  $id
@param string|array|\WP_Screen $screen

@throws MetaboxException

@return MetaboxInterface
Create a new metabox instance .