Spatie\Php7to5\Exceptions\InvalidParameter::destinationDirectoryIsSource PHP Method

destinationDirectoryIsSource() public static method

public static destinationDirectoryIsSource ( )
    public static function destinationDirectoryIsSource()
    {
        return new static('A destination directory is a source directory. If you want to overwrite it, you must specify that as an option.');
    }

Usage Example

Example #1
0
 /**
  * @param string $source
  * @param string $destination
  *
  * @throws \Spatie\Php7to5\Exceptions\InvalidParameter
  */
 protected function isEqual($source, $destination)
 {
     if (!ends_with($destination, DIRECTORY_SEPARATOR)) {
         $destination = $destination . DIRECTORY_SEPARATOR;
     }
     if (!ends_with($source, DIRECTORY_SEPARATOR)) {
         $source = $source . DIRECTORY_SEPARATOR;
     }
     if ($destination === $source) {
         throw InvalidParameter::destinationDirectoryIsSource();
     }
 }