Stringy\Stringy::append PHP Method

append() public method

Returns a new string with $string appended.
public append ( string $string ) : Stringy
$string string The string to append
return Stringy Object with appended $string
    public function append($string)
    {
        return static::create($this->str . $string, $this->encoding);
    }

Usage Example

示例#1
13
 /**
  * Generate the alelo orders file.
  *
  * @return string
  */
 public function generate()
 {
     if ($this->productType === null) {
         throw new ProductTypeIsRequiredException();
     }
     $this->header = new HeaderRegistry(['requesterUser' => $this->orderUser, 'orderDate' => (new Carbon())->format('Ymd'), 'orderTime' => (new Carbon())->format('H.i.s')]);
     $this->generateTraillerRegistry();
     $this->fileLayout = $this->fileLayout->append($this->header->__toString());
     $this->fileLayout = $this->fileLayout->append(PHP_EOL);
     $this->fileLayout = $this->fileLayout->append($this->headerEletronic->__toString());
     $this->fileLayout = $this->fileLayout->append(PHP_EOL);
     $this->fileLayout = $this->fileLayout->append($this->branch->__toString());
     $this->fileLayout = $this->fileLayout->append(PHP_EOL);
     foreach ($this->getAllEmployees() as $employeeRegistry) {
         $this->fileLayout = $this->fileLayout->append($employeeRegistry->__toString());
         $this->fileLayout = $this->fileLayout->append(PHP_EOL);
     }
     $this->fileLayout = $this->fileLayout->append($this->traillerRegistry->__toString());
     return $this->fileLayout->__toString();
 }
All Usage Examples Of Stringy\Stringy::append