src/LIN3S/WPFoundation/Configuration/Assets/Assets.php
protected function addScript(
        $name,
        $from = AssetsInterface::ASSETS_JS,
        array $dependencies = ['jquery'],
        $version = '1.0.0',
        $inFooter = true,
        $ajaxUrl = null
    ) {
        wp_enqueue_script($name, $this->path($from, $name), $dependencies, $version, $inFooter);

        if (null !== $ajaxUrl) {
            $this->registerAjaxUrls($name, $ajaxUrl);
        }

        return $this;
    }
protected function addScript(
        $name,
        $from = AssetsInterface::ASSETS_JS,
        array $dependencies = ['jquery'],
        $version = '1.0.0',
        $inFooter = true,
        $ajaxUrl = null
    ) {
        wp_enqueue_script($name, $this->path($from, $name), $dependencies, $version, $inFooter);

        if (null !== $ajaxUrl) {
            $this->registerAjaxUrls($name, $ajaxUrl);
        }

        return $this;
    }
protected function addScript ( $ name , $ from = AssetsInterface :: ASSETS_JS , array $ dependencies = [ 'jquery' ] , $ version = '1.0.0' , $ inFooter = true , $ ajaxUrl = null ) { wp_enqueue_script ( $ name , $ this -> path ( $ from , $ name ) , $ dependencies , $ version , $ inFooter ) ; if ( null !== $ ajaxUrl ) { $ this -> registerAjaxUrls ( $ name , $ ajaxUrl ) ; } return $ this ; }
Method that wraps the WordPress internal "wp_enqueue_script"
simplifying the process adding some common default values.

@param string            $name         The name of asset
@param string            $from         The from location, by default is the JS files default location
@param array             $dependencies Array which contains the dependencies of the given asset
@param string            $version      The version, by default is "1.0.0"
@param bool              $inFooter     Checks if the asset is going to be in the footer or not
@param array|string|null $ajaxUrl      The ajax url to expose in JS files

@return $this Self class instance
Method that wraps the WordPress internal wp_enqueue_script simplifying the process adding some common default values .