src/Repository/DeploymentBuilder.php
public function addResource(string $name, $resource): self
    {
        if ($resource instanceof StreamInterface) {
            $in = $resource;
        } elseif (\is_resource($resource)) {
            $in = new ResourceInputStream($resource);
        } else {
            $resource = (string) $resource;
            
            if (\preg_match("'^/|(?:[^:\\\\/]+://)|(?:[a-z]:[\\\\/])'i", $resource)) {
                $in = ResourceInputStream::fromUrl($resource);
            } else {
                $in = new StringStream($resource);
            }
        }
        
        $this->resources[\trim(\str_replace('\\', '/', $name), '/')] = $in;
        
        return $this;
    }
public function addResource(string $name, $resource): self
    {
        if ($resource instanceof StreamInterface) {
            $in = $resource;
        } elseif (\is_resource($resource)) {
            $in = new ResourceInputStream($resource);
        } else {
            $resource = (string) $resource;
            
            if (\preg_match("'^/|(?:[^:\\\\/]+://)|(?:[a-z]:[\\\\/])'i", $resource)) {
                $in = ResourceInputStream::fromUrl($resource);
            } else {
                $in = new StringStream($resource);
            }
        }
        
        $this->resources[\trim(\str_replace('\\', '/', $name), '/')] = $in;
        
        return $this;
    }
public function addResource ( string $ name , $ resource ) : self { if ( $ resource instanceof StreamInterface ) { $ in = $ resource ; } elseif ( \ is_resource ( $ resource ) ) { $ in = new ResourceInputStream ( $ resource ) ; } else { $ resource = ( string ) $ resource ; if ( \ preg_match ( "'^/|(?:[^:\\\\/]+://)|(?:[a-z]:[\\\\/])'i" , $ resource ) ) { $ in = ResourceInputStream :: fromUrl ( $ resource ) ; } else { $ in = new StringStream ( $ resource ) ; } } $ this -> resources [ \ trim ( \ str_replace ( '\\' , '/' , $ name ) , '/' ) ] = $ in ; return $ this ; }
Add a resource to the deployment.

@param string $name Local path and filename of the resource within the deployment.
@param mixed $resource Deployable resource (file), that can be loaded using a stream.
Add a resource to the deployment .