Set the attachments defaults.

@param  array  $defaults
@return $this
162578
public function setAttachmentDefaults($defaults)
    {
        if ($this->attachmentDefaults != ($defaults = (array) $defaults)) {
            $this->attachmentDefaults = $defaults;

            $this->setAttachments($this->attachments);
        }

        return $this;
    }
91188
public function setProperties(array $properties)
    {
        foreach ($properties as $propertyIdent => $propertyMetadata) {
            if (isset($this->properties[$propertyIdent])) {
                $this->properties[$propertyIdent] = array_replace_recursive(
                    $this->properties[$propertyIdent],
                    $propertyMetadata
                );
            } else {
                $this->properties[$propertyIdent] = $propertyMetadata;
            }
        }

        return $this;
    }
500092
public function addFields($fields = [], $defaults = [])
    {
        foreach ($fields as $field) {
            if (is_string($field)) {
                $this->addField($field, $defaults);
                continue;
            }

            if (is_array($field) && isset($field[0])) {
                $name = $field[0];
                unset($field[0]);
                $this->addField($name, $field);
                continue;
            }
        }

        return $this;
    }
1152878
public function addDefaults(array $defaults)
    {
        if ($defaults) {
            foreach ($this->routes as $route) {
                $route->addDefaults($defaults);
            }
        }
    }
423077
public function setOriginals(array $originals)
    {
        if (gettype($originals) == 'array') {
            $originals = new ArrayCollection($originals);
        }

        $this->originals = $originals;

        return $this;
    }
1040710
public function setProperties(array $properties)
    {
        if (isset($properties[ 'presets' ])) {
            $this->setPresets($properties[ 'presets' ]);

            unset($properties[ 'presets' ]);
        }

        $this->properties = $properties;

        return $this;
    }
1023653
public function setScopes(array $scopes = null)
    {
        ValidationUtility::ensureNullOrArrayOfString('$scopes', $scopes);

        $this->scopes = $scopes;

        return $this;
    }
1088148
public function mountFilesystems(array $filesystems)
    {
        foreach ($filesystems as $prefix => $filesystem) {
            $this->mountFilesystem($prefix, $filesystem);
        }

        return $this;
    }
711409
public function setDefaults(array $defaults)
    {
        foreach ($defaults as $option => $value) {
            $this->setDefault($option, $value);
        }

        return $this;
    }
659200
public function setConstants(array $constants)
    {
        $this->_constants = [];
        foreach ($constants as $name => $value) {
            $this->addConstant($name, $value);
        }

        return $this;
    }
641234
public function set(array $files)
    {
        if (!empty($files)) {
            foreach ($files as $_file) {
                $this->add($_file);
            }
        }
        return $this;
    }
1107652
public function to($destination, array $defaults = [])
    {
        if ($this->name === null) {
            $this->name = strtolower(
                str_replace(['\\', '::'], '_', $destination)
            );
        }

        $this->destination = $destination;
        $this->defaults    = $defaults;
        return $this;
    }
370699
public function addAction($defaults = [])
    {
        if (!is_array($defaults)) {
            $defaults = [$defaults];
        }

        $this->action = $this->add(new Button($defaults), 'AfterInput');
        $this->addClass('action');

        return $this->action;
    }
1286182
protected function setDefaultClasses(array $options = [])
    {
        $wrapper_class = $this->getConfig('defaults.' . $this->type . '.wrapper_class', '');
        $label_class = $this->getConfig('defaults.' . $this->type . '.label_class', '');
        $field_class = $this->getConfig('defaults.' . $this->type . '.field_class', '');

        $defaults = [];
        if ($wrapper_class && !Arr::get($options, 'wrapper.class')) {
            $defaults['wrapper']['class'] = $wrapper_class;
        }
        if ($label_class && !Arr::get($options, 'label_attr.class')) {
            $defaults['label_attr']['class'] = $label_class;
        }
        if ($field_class && !Arr::get($options, 'attr.class')) {
            $defaults['attr']['class'] = $field_class;
        }
        return $defaults;
    }
607432
public function setDefaultImage($defaultImage = '')
    {
        if (empty($defaultImage)) {
            $image        = DataRepository::getData('config_image');
            $defaultImage = $image['default_image'];
        }
        $this->defaultImage = $defaultImage;

        return $this;
    }
1362074
public static function set( $configs, $defaults = null ) {
		$defaults = $defaults ? $defaults : self::get();

		/**
		 * Allow the default configs to be filtered.
		 *
		 * @since 2.8.0
		 *
		 * @param array $defaults
		 */
		$defaults = apply_filters( 'Boldgrid\Library\Configs\set', $defaults );

		// Check if local library file is added.
		$localPath = dirname( __DIR__ ) . '/library.local.php';
		if ( file_exists( $localPath ) && is_readable( $localPath ) ) {
			$local = include_once $localPath;
			$defaults = wp_parse_args( $local, $defaults );
		}

		// Check if constant is added.
		if ( defined( 'BGLIB_CONFIGS' ) ) {
			$localPath = ABSPATH . BGLIB_CONFIGS;
			if ( file_exists( $localPath ) && is_readable( $localPath ) ) {
				$local = include_once $localPath;
				$defaults = wp_parse_args( $local, $defaults );
			}
		}

		return self::$configs = wp_parse_args( $configs, $defaults );
	}
399728
private function createAttachments($attachments) {
        if (is_array($attachments) && count($attachments) > 0) {
            foreach ($attachments as $attachment) {
                $this->mailer->addAttachment($attachment);
            }
        } else if (!empty($attachments)) {
            $this->mailer->addAttachment($attachments);
        }
    }